Thing Methods

Thing has all the Concept methods plus what follows.

[tab:Java]

Retrieve type

thing.type();

Retrieves the type which the thing belongs to.

Returns

Type object

Retrieve relationships

thing.relationships(Role… roles);

Retrieves the relationships which the thing plays a role in.

Accepts

Param Description Type Required Default

roles

The list of roles to filter the relationships by.

Array of Roles

false

N/A

Returns

Stream of Relationship objects

Retrieve roles

thing.roles();

Retrieves the roles that the thing plays.

Returns

Stream of Role objects

Retrieve attributes

thing.attributes();

Retrieves the attributes that the thing has.

Accepts

Param Description Type Required Default

roles

The list of types to filter the attributes by.

Array of AttributeTypes

false

N/A

Returns

Stream of Attribute objects

Retrieve keys

thing.keys();

Retrieves the attributes that the thing has as its keys.

Accepts

Param Description Type Required Default

roles

The list of types to filter the attributes by.

Array of AttributeTypes

false

N/A

Returns

Stream of Attribute objects

Assign attribute

thing.has(Attribute attribute);

Assigns an attribute to the thing.

Accepts

Param Description Type Required Default

attribute

The attribute to be owned by the thing.

Attribute

true

N/A

Returns

Thing object

Unassign attribute

thing.unhas(Attribute attribute);

Unassigns an attribute from the thing.

Accepts

Param Description Type Required Default

attribute

The attribute to be disowned from the thing.

Attribute

true

N/A

Returns

Thing object

Check if inferred

thing.isInferred();

Checks if the thing is inferred by a rule.

Returns

boolean

[tab:end] [tab:Javascript]

Retrieve type

async thing.type();

Retrieves the type which the thing belongs to.

Returns

Type object

Retrieve relationships

async thing.relationships(roles);

Retrieves the relationships which the thing plays a role in.

Accepts

Param Description Type Required Default

roles

The list of roles to filter the relationships by.

Array of Roles

false

N/A

Returns

Iterator of Relationship objects

Retrieve roles

async thing.roles();

Retrieves the roles that the thing plays.

Returns

Iterator of Role objects

Retrieve attributes

async thing.attributes();

Retrieves the attributes that the thing has.

Accepts

Param Description Type Required Default

roles

The list of types to filter the attributes by.

Array of AttributeTypes

false

N/A

Returns

Iterator of Attribute objects

Retrieve keys

async thing.keys();

Retrieves the attributes that the thing has as its keys.

Accepts

Param Description Type Required Default

roles

The list of types to filter the attributes by.

Array of AttributeTypes

false

N/A

Returns

Iterator of Attribute objects

Assign attribute

async thing.has(attribute);

Assigns an attribute to the thing.

Accepts

Param Description Type Required Default

attribute

The attribute to be owned by the thing.

Attribute

true

N/A

Returns

Thing object

Unassign attribute

async thing.unhas(attribute);

Unassigns an attribute from the thing.

Accepts

Param Description Type Required Default

attribute

The attribute to be disowned from the thing.

Attribute

true

N/A

Returns

Thing object

Check if inferred

async thing.isInferred();

Checks if the thing is inferred by a rule.

Returns

boolean

[tab:end] [tab:Python]

Retrieve type

thing.type()

Retrieves the type which the thing belongs to.

Returns

Type object

Retrieve relationships

thing.relationships(roles)

Retrieves the relationships which the thing plays a role in.

Accepts

Param Description Type Required Default

roles

The list of roles to filter the relationships by.

List of Roles

false

N/A

Returns

Iterator of Relationship objects

Retrieve roles

thing.roles()

Retrieves the roles that the thing plays.

Returns

Iterator of Role objects

Retrieve attributes

thing.attributes()

Retrieves the attributes that the thing has.

Accepts

Param Description Type Required Default

roles

The list of types to filter the attributes by.

List of AttributeTypes

false

N/A

Returns

Iterator of Attribute objects

Retrieve keys

thing.keys()

Retrieves the attributes that the thing has as its keys.

Accepts

Param Description Type Required Default

roles

The list of types to filter the attributes by.

List of AttributeTypes

false

N/A

Returns

Iterator of Attribute objects

Assign attribute

thing.has(attribute)

Assigns an attribute to the thing.

Accepts

Param Description Type Required Default

attribute

The attribute to be owned by the thing.

Attribute

true

N/A

Returns

Thing object

Unassign attribute

thing.unhas(attribute)

Unassigns an attribute from the thing.

Accepts

Param Description Type Required Default

attribute

The attribute to be disowned from the thing.

Attribute

true

N/A

Returns

Thing object

Check if inferred

thing.is_inferred()

Checks if the thing is inferred by a rule.

Returns

boolean

[tab:end]

Attribute Methods

Attribute has all the Thing methods plus what follows.

[tab:Java]

Retrieve value

attribute.value();

Retrieves the value which the attribute holds.

Retrieve owners

attribute.owners();

Retrieves the things that own the attribute.

[tab:end] [tab:Javascript]

Retrieve value

async attribute.value();

Retrieves the value which the attribute holds.

Retrieve owners

async attribute.owners();

Retrieves the things that own the attribute.

[tab:end] [tab:Python]

Retrieve value

attribute.value()

Retrieves the value which the attribute holds.

Retrieve owners

attribute.owners()

Retrieves the things that own the attribute.

[tab:end]

Relationship Methods

Relationship has all the Thing methods plus what follows.

[tab:Java]

Retrieve roleplayers per role

relationship.rolePlayersMap();

Retrieves the roleplayers of a relationship mapped to each of its roles.

Returns

Map<Role, Set<Thing»

Retrieve roleplayers

relationship.rolePlayers(Role role);

Retrieves the things that play a role in the relationship.

Accepts

Param Description Type Required Default

role

The role to filter the roleplayers by.

Role

false

N/A

Returns

Stream of Thing objects

Add roleplayer

relationship.assign(Role role, Thing thing);

Adds a new roleplayer to play the given role in the relationship.

Accepts

Param Description Type Required Default

role

The role to be played by the thing

Role

true

N/A

thing

The thing to play the role

Thing

true

N/A

Returns

Relationship object

Removes roleplayer

relationship.unassign(Role role, Thing thing);

Removes a roleplayer from playing the given role in the relationship.

Accepts

Param Description Type Required Default

role

The role to not be played by the thing

Role

true

N/A

thing

The thing to not play the role

Thing

true

N/A

Returns

Relationship object

[tab:end] [tab:Javascript]

Retrieve roleplayers per role

async relationship.rolePlayersMap();

Retrieves the roleplayers of a relationship mapped to each of its roles.

Returns

Map<Role, Set<Thing»

Retrieve roleplayers

async relationship.rolePlayers(role);

Retrieves the things that play a role in the relationship.

Accepts

Param Description Type Required Default

role

The role to filter the roleplayers by.

Role

false

N/A

Returns

Iterator of Thing objects

Add roleplayer

async relationship.assign(role, thing);

Adds a new roleplayer to play the given role in the relationship.

Accepts

Param Description Type Required Default

role

The role to be played by the thing

Role

true

N/A

thing

The thing to play the role

Thing

true

N/A

Returns

void

Removes roleplayer

async relationship.unassign(role, thing);

Removes a roleplayer from playing the given role in the relationship.

Accepts

Param Description Type Required Default

role

The role to not be played by the thing

Role

true

N/A

thing

The thing to not play the role

Thing

true

N/A

Returns

void

[tab:end] [tab:Python]

Retrieve roleplayers per role

relationship.role_players_map()

Retrieves the roleplayers of a relationship mapped to each of its roles.

Returns

Dict[Role, set[Thing]]

Retrieve roleplayers

relationship.role_players(role)

Retrieves the things that play a role in the relationship.

Accepts

Param Description Type Required Default

role

The role to filter the roleplayers by.

Role

false

N/A

Returns

Iterator of Thing objects

Add roleplayer

relationship.assign(role, thing)

Adds a new roleplayer to play the given role in the relationship.

Accepts

Param Description Type Required Default

role

The role to be played by the thing

Role

true

N/A

thing

The thing to play the role

Thing

true

N/A

Returns

Relationship object

Removes roleplayer

relationship.unassign(role, thing)

Removes a roleplayer from playing the given role in the relationship.

Accepts

Param Description Type Required Default

role

The role to not be played by the thing

Role

true

N/A

thing

The thing to not play the role

Thing

true

N/A

Returns

Relationship object

[tab:end]