The relationsWithRole method returns all relations that connect the subject object to objects via the given role:
A value of type Object or an expression evaluating to a value of type Object not being a Relation.
A value of type string or an expression evaluating to a value of type string: the role name.
A value of type string or an expression evaluating to a value of type string, or a list or set of those: the type (or types) the connected objects must have (or derive from). This argument is optional: relations connected to objects of all types will be returned when omitted.
A list containing elements of type Relation: the relations connected to <object> with the given <role>.