Thing Methods
Thing
has all the Concept
methods plus what follows.
Retrieves internal ID (Local)
thing.getIID();
Retrieves the unique id of the type.
Returns
string
Get a Remote version of the Thing.
thing.asRemote(tx);
The remote version uses the given transaction to execute every method call.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
tx |
The transaction to be used to make method calls. |
Transaction |
true |
N/A |
Returns
Thing.Remote
Retrieve type (Local)
thing.getType();
Retrieves the type which this Thing belongs to.
Returns
Assign attribute
thing.setHas(Attribute<?> attribute);
Assigns an Attribute to be owned by this Thing.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
attribute |
The Attribute to be owned by this Thing. |
true |
N/A |
Returns
Unassign attribute
thing.unsetHas(Attribute<?> attribute);
Unassigns an Attribute from this Thing.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
attribute |
The Attribute to be disowned from this Thing. |
true |
N/A |
Returns
Check if inferred
thing.isInferred();
Checks if this Thing is inferred by a Reasoning Rule.
Returns
boolean
Retrieve attributes
thing.getHas(boolean onlyKey));
Retrieves the Attributes that this Thing owns, optionally filtered by one or more AttributeTypes.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
onlyKey |
If set to |
boolean |
false |
false |
Returns
Stream<Attribute<?>
>
Retrieve attributes
thing.getHas(AttributeType attributeType);
Retrieves the Attributes that this Thing owns, optionally filtered by one or more AttributeTypes.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
attributeType |
The AttributeType to filter the attributes by. |
false |
Returns
Stream<Attribute
>
Retrieve attributes
thing.getHas(AttributeType… attributeTypes);
Retrieves the Attributes that this Thing owns, optionally filtered by one or more AttributeTypes.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
attributeTypes |
The AttributeTypes to filter the attributes by. |
false |
(empty array) |
Returns
Stream<Attribute
>
Retrieve roles
thing.getPlaying();
Retrieves the roles that this Thing is currently playing.
Returns
Stream of RoleType
Retrieve relations
thing.getRelations(RoleType… roleTypes);
Retrieves all the Relations which this Thing plays a role in, optionally filtered by one or more given roles.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
roleTypes |
The list of roles to filter the relations by. |
false |
N/A |
Returns
Stream<Relation
>
Retrieves internal ID (Local)
thing.getIID();
Retrieves the unique id of the type.
Returns
string
Get a Remote version of the Thing.
thing.asRemote(tx);
The remote version uses the given transaction to execute every method call.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
tx |
The transaction to be used to make method calls. |
Transaction |
true |
N/A |
Returns
RemoteThing
Retrieve type (Local)
await thing.getType();
Retrieves the type which this Thing belongs to.
Returns
Assign attribute
await thing.setHas(attribute);
Assigns an Attribute to be owned by this Thing.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
attribute |
The Attribute to be owned by this Thing. |
true |
N/A |
Returns
Unassign attribute
await thing.unsetHas(attribute);
Unassigns an Attribute from this Thing.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
attribute |
The Attribute to be disowned from this Thing. |
true |
N/A |
Returns
Check if inferred
await thing.isInferred();
Checks if this Thing is inferred by a Reasoning Rule.
Returns
boolean
Retrieve attributes
await thing.getHas(onlyKey);
Retrieves the Attributes that this Thing owns, optionally filtered by one or more AttributeTypes.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
onlyKey |
If set to |
boolean |
false |
false |
Returns
Retrieve attributes
await thing.getHas(attributeType);
Retrieves the Attributes that this Thing owns, optionally filtered by one or more AttributeTypes.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
attributeType |
The AttributeType to filter the attributes by. |
false |
Returns
Retrieve attributes
await thing.getHas(attributeTypes);
Retrieves the Attributes that this Thing owns, optionally filtered by one or more AttributeTypes.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
attributeTypes |
The AttributeTypes to filter the attributes by. |
Array of |
false |
(empty array) |
Returns
Retrieve roles
await thing.getPlaying();
Retrieves the roles that this Thing is currently playing.
Returns
Retrieve relations
await thing.getRelations(roleTypes);
Retrieves all the Relations which this Thing plays a role in, optionally filtered by one or more given roles.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
roleTypes |
The list of roles to filter the relations by. |
Array of |
false |
N/A |
Returns
Retrieves internal ID (Local)
thing.get_iid()
Retrieves the unique id of the type.
Returns
string
Get a Remote version of the Thing.
thing.as_remote(tx)
The remote version uses the given transaction to execute every method call.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
tx |
The transaction to be used to make method calls. |
Transaction |
true |
N/A |
Returns
RemoteThing
Retrieve type (Local)
thing.get_type()
Retrieves the type which this Thing belongs to.
Returns
Assign attribute
thing.set_has(attribute)
Assigns an Attribute to be owned by this Thing.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
attribute |
The Attribute to be owned by this Thing. |
true |
N/A |
Returns
Unassign attribute
thing.unset_has(attribute)
Unassigns an Attribute from this Thing.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
attribute |
The Attribute to be disowned from this Thing. |
true |
N/A |
Returns
Check if inferred
thing.is_inferred()
Checks if this Thing is inferred by a Reasoning Rule.
Returns
boolean
Retrieve attributes
thing.get_has(attribute_type=None, attribute_types=[], only_key=False)
Retrieves the Attributes that this Thing owns, optionally filtered by one or more AttributeTypes.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
attribute_type |
The AttributeType to filter the attributes by. |
|
false |
None |
attribute_types |
The AttributeTypes to filter the attributes by. |
list of |
false |
[] |
only_key |
If set to |
boolean |
false |
false |
Returns
Iterator of Attribute
Retrieve roles
thing.get_playing()
Retrieves the roles that this Thing is currently playing.
Returns
Iterator of RoleType
Retrieve relations
thing.get_relations(role_types)
Retrieves all the Relations which this Thing plays a role in, optionally filtered by one or more given roles.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
roleTypes |
The list of roles to filter the relations by. |
list of |
false |
N/A |
Returns
Iterator of Relation
Entity Methods
Entity
has all the Thing
methods plus what follows.
Retrieve type (Local)
entity.getType();
Retrieves the type which this Entity belongs to.
Returns
Get a Remote version of the Entity.
entity.asRemote(tx);
The remote version uses the given transaction to execute every method call.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
tx |
The transaction to be used to make method calls. |
Transaction |
true |
N/A |
Returns
Entity.Remote
Retrieve type (Local)
await entity.getType();
Retrieves the type which this Entity belongs to.
Returns
Get a Remote version of the Entity.
entity.asRemote(tx);
The remote version uses the given transaction to execute every method call.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
tx |
The transaction to be used to make method calls. |
Transaction |
true |
N/A |
Returns
RemoteEntity
Retrieve type (Local)
entity.get_type()
Retrieves the type which this Entity belongs to.
Returns
Get a Remote version of the Entity.
entity.as_remote(tx)
The remote version uses the given transaction to execute every method call.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
tx |
The transaction to be used to make method calls. |
Transaction |
true |
N/A |
Returns
RemoteEntity
Attribute Methods
Attribute
has all the Thing
methods plus what follows.
Retrieve type (Local)
attribute.getType();
Retrieves the type which this Attribute belongs to.
Returns
Retrieve value (Local)
attribute.getValue();
Retrieves the value which the Attribute instance holds.
Retrieve owners
attribute.owners(Type ownerType);
Retrieves the instances that own this Attribute.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
ownerType |
If specified, filter results for only owners of the given type |
Type |
false |
N/A |
Get a Remote version of the Attribute.
concept.asRemote(Transaction tx);
The remote version uses the given transaction to execute every method call.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
transaction |
The transaction to be used to make method calls. |
Transaction |
true |
N/A |
Returns
Attribute.Remote
Check if value is of type boolean
attribute.isBoolean();
Returns true if the attribute value is of type boolean. Otherwise, returns false.
Check if value is of type long
attribute.isLong();
Returns true if the attribute value is of type long. Otherwise, returns false.
Check if value is of type double
attribute.isDouble();
Returns true if the attribute value is of type double. Otherwise, returns false.
Check if value is of type string
attribute.isString();
Returns true if the attribute value is of type string. Otherwise, returns false.
Check if value is of type double
attribute.isDateTime();
Returns true if the attribute value is of type double. Otherwise, returns false.
Retrieve type (Local)
attribute.getType();
Retrieves the type which this Attribute belongs to.
Returns
Retrieve value (Local)
await attribute.getValue();
Retrieves the value which the Attribute instance holds.
Retrieve owners
attribute.owners(ownerType);
Retrieves the instances that own this Attribute.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
ownerType |
If specified, filter results for only owners of the given type |
Type |
false |
N/A |
Get a Remote version of the Attribute.
concept.asRemote(tx);
The remote version uses the given transaction to execute every method call.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
transaction |
The transaction to be used to make method calls. |
Transaction |
true |
N/A |
Returns
RemoteAttribute
Check if value is of type boolean
attribute.isBoolean();
Returns true if the attribute value is of type boolean. Otherwise, returns false.
Check if value is of type long
attribute.isLong();
Returns true if the attribute value is of type long. Otherwise, returns false.
Check if value is of type double
attribute.isDouble();
Returns true if the attribute value is of type double. Otherwise, returns false.
Check if value is of type string
attribute.isString();
Returns true if the attribute value is of type string. Otherwise, returns false.
Check if value is of type double
attribute.isDateTime();
Returns true if the attribute value is of type double. Otherwise, returns false.
Retrieve type (Local)
attribute.get_type()
Retrieves the type which this Attribute belongs to.
Returns
Retrieve value (Local)
attribute.get_value()
Retrieves the value which the Attribute instance holds.
Retrieve owners
attribute.owners(ownerType)
Retrieves the instances that own this Attribute.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
ownerType |
If specified, filter results for only owners of the given type |
Type |
false |
N/A |
Get a Remote version of the Attribute.
concept.as_remote(tx)
The remote version uses the given transaction to execute every method call.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
transaction |
The transaction to be used to make method calls. |
Transaction |
true |
N/A |
Returns
RemoteAttribute
Check if value is of type boolean
attribute.is_boolean()
Returns true if the attribute value is of type boolean. Otherwise, returns false.
Check if value is of type long
attribute.is_long()
Returns true if the attribute value is of type long. Otherwise, returns false.
Check if value is of type double
attribute.is_double()
Returns true if the attribute value is of type double. Otherwise, returns false.
Check if value is of type string
attribute.is_string()
Returns true if the attribute value is of type string. Otherwise, returns false.
Check if value is of type double
attribute.is_datetime()
Returns true if the attribute value is of type double. Otherwise, returns false.
Relation Methods
Relation
has all the Thing
methods plus what follows.
Retrieve type (Local)
relation.getType();
Retrieves the type which this Relation belongs to.
Returns
Retrieve role players per role
relation.getPlayersByRoleType();
Retrieves a map of all instances involved in the Relation and the role each play.
Returns
Retrieve role types currently played
relation.getRelating();
Retrieves all role types currently played in this Relation.
Returns
Stream<RoleType
>
Retrieve role players
relation.getPlayers(RoleType role);
Retrieves all roleplayers of this this Relation, optionally filtered by given a role.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
role |
The role to filter the role players by. |
false |
N/A |
Returns
Stream<Thing
>
Add roleplayer
relation.addPlayer(RoleType role, Thing thing);
Adds a new roleplayer to play the given role in this Relation.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
role |
The role to be played by the |
true |
N/A |
|
thing |
The thing to play the |
true |
N/A |
Returns
void
Remove a roleplayer
relation.removePlayer(RoleType role, Thing thing);
Removes the association of the given instance that plays the given role in this Relation.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
role |
The role to no longer be played by the |
true |
N/A |
|
thing |
The instance to no longer play the |
true |
N/A |
Returns
void
Get a Remote version of the Relation.
relation.asRemote(Transaction tx);
The remote version uses the given transaction to execute every method call.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
transaction |
The transaction to be used to make method calls. |
Transaction |
true |
N/A |
Returns
Relation.Remote
Retrieve type (Local)
await relation.getType();
Retrieves the type which this Relation belongs to.
Returns
Retrieve role players per role
await relation.getPlayersByRoleType();
Retrieves a map of all instances involved in the Relation and the role each play.
Returns
Retrieve role types currently played
relation.getRelating();
Retrieves all role types currently played in this Relation.
Returns
Retrieve role players
relation.getPlayers(role);
Retrieves all roleplayers of this this Relation, optionally filtered by given a role.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
role |
The role to filter the role players by. |
false |
N/A |
Returns
Add roleplayer
await relation.addPlayer(role, thing);
Adds a new roleplayer to play the given role in this Relation.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
role |
The role to be played by the |
true |
N/A |
|
thing |
The thing to play the |
true |
N/A |
Returns
void
Remove a roleplayer
await relation.removePlayer(role, thing);
Removes the association of the given instance that plays the given role in this Relation.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
role |
The role to no longer be played by the |
true |
N/A |
|
thing |
The instance to no longer play the |
true |
N/A |
Returns
void
Get a Remote version of the Relation.
relation.asRemote(tx);
The remote version uses the given transaction to execute every method call.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
transaction |
The transaction to be used to make method calls. |
Transaction |
true |
N/A |
Returns
RemoteRelation
Retrieve type (Local)
relation.get_type()
Retrieves the type which this Relation belongs to.
Returns
Retrieve role players per role
relation.get_players_by_role_type()
Retrieves a map of all instances involved in the Relation and the role each play.
Returns
Retrieve role types currently played
relation.get_relating()
Retrieves all role types currently played in this Relation.
Returns
Iterator of RoleType
Retrieve role players
relation.get_players(role)
Retrieves all roleplayers of this this Relation, optionally filtered by given a role.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
role |
The role to filter the role players by. |
false |
N/A |
Returns
Iterator of Thing
Add roleplayer
relation.add_player(role, thing)
Adds a new roleplayer to play the given role in this Relation.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
role |
The role to be played by the |
true |
N/A |
|
thing |
The thing to play the |
true |
N/A |
Returns
None
Remove a roleplayer
relation.remove_player(role, thing)
Removes the association of the given instance that plays the given role in this Relation.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
role |
The role to no longer be played by the |
true |
N/A |
|
thing |
The instance to no longer play the |
true |
N/A |
Returns
None
Get a Remote version of the Relation.
relation.as_remote(tx)
The remote version uses the given transaction to execute every method call.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
transaction |
The transaction to be used to make method calls. |
Transaction |
true |
N/A |
Returns
RemoteRelation