Thing Methods
Thing
has all the Concept
methods plus what follows.
Retrieves internal ID (Local)
thing.getIID();
Retrieves the unique id of the Thing.
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
Check if inferred (Local)
thing.isInferred();
Checks if this Thing is inferred by a Reasoning Rule.
Returns
boolean
Assign attribute
thing.asRemote(Transaction tx).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.asRemote(Transaction tx).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
Retrieve attributes
thing.asRemote(Transaction tx).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.asRemote(Transaction tx).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.asRemote(Transaction tx).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.asRemote(Transaction tx).getPlaying();
Retrieves the roles that this Thing is currently playing.
Returns
Stream of RoleType
Retrieve relations
thing.asRemote(Transaction tx).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.iid;
Retrieves the unique id of the Thing.
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
Check if inferred (Local)
thing.inferred;
Checks if this Thing is inferred by a Reasoning Rule.
Returns
boolean
Assign attribute
await thing.asRemote(tx).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.asRemote(tx).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
Retrieve attributes
await thing.asRemote(tx).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.asRemote(tx).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.asRemote(tx).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.asRemote(tx).getPlaying();
Retrieves the roles that this Thing is currently playing.
Returns
Retrieve relations
await thing.asRemote(tx).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 Thing.
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
Check if inferred (Local)
thing.is_inferred()
Checks if this Thing is inferred by a Reasoning Rule.
Returns
boolean
Assign attribute
thing.as_remote(tx).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.as_remote(tx).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
Retrieve attributes
thing.as_remote(tx).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.as_remote(tx).get_playing()
Retrieves the roles that this Thing is currently playing.
Returns
Iterator of RoleType
Retrieve relations
thing.as_remote(tx).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)
entity.type;
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.
Returns
string
|Long
float
boolean
|Date
Retrieve owners
attribute.asRemote(Transaction tx).getOwners(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 |
Returns
Stream<Thing
>
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 (Local)
attribute.isBoolean();
Returns true if the attribute value is of type boolean. Otherwise, returns false.
Returns
boolean
Check if value is of type long (Local)
attribute.isLong();
Returns true if the attribute value is of type long. Otherwise, returns false.
Returns
boolean
Check if value is of type double (Local)
attribute.isDouble();
Returns true if the attribute value is of type double. Otherwise, returns false.
Returns
boolean
Check if value is of type string (Local)
attribute.isString();
Returns true if the attribute value is of type string. Otherwise, returns false.
Returns
boolean
Check if value is of type double (Local)
attribute.isDateTime();
Returns true if the attribute value is of type double. Otherwise, returns false.
Returns
boolean
Retrieve type (Local)
attribute.type;
Retrieves the type which this Attribute belongs to.
Returns
Retrieve value (Local)
attribute.value;
Retrieves the value which the Attribute instance holds.
Returns
string
|number
|boolean
|Date
Retrieve owners
attribute.asRemote(tx).getOwners(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 |
Returns
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 (Local)
attribute.isBoolean();
Returns true if the attribute value is of type boolean. Otherwise, returns false.
Returns
boolean
Check if value is of type long (Local)
attribute.isLong();
Returns true if the attribute value is of type long. Otherwise, returns false.
Returns
boolean
Check if value is of type double (Local)
attribute.isDouble();
Returns true if the attribute value is of type double. Otherwise, returns false.
Returns
boolean
Check if value is of type string (Local)
attribute.isString();
Returns true if the attribute value is of type string. Otherwise, returns false.
Returns
boolean
Check if value is of type double (Local)
attribute.isDateTime();
Returns true if the attribute value is of type double. Otherwise, returns false.
Returns
boolean
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.
Returns
string
|int
float
boolean
|Date
Retrieve owners
attribute.as_remote(tx).get_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 |
Returns
Iterator of Thing
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 (Local)
attribute.is_boolean()
Returns true if the attribute value is of type boolean. Otherwise, returns false.
Returns
boolean
Check if value is of type long (Local)
attribute.is_long()
Returns true if the attribute value is of type long. Otherwise, returns false.
Returns
boolean
Check if value is of type double (Local)
attribute.is_double()
Returns true if the attribute value is of type double. Otherwise, returns false.
Returns
boolean
Check if value is of type string (Local)
attribute.is_string()
Returns true if the attribute value is of type string. Otherwise, returns false.
Returns
boolean
Check if value is of type double (Local)
attribute.is_datetime()
Returns true if the attribute value is of type double. Otherwise, returns false.
Returns
boolean
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.asRemote(Transaction tx).getPlayersByRoleType();
Retrieves a map of all instances involved in the Relation and the role each play.
Returns
Retrieve role types currently played
relation.asRemote(Transaction tx).getRelating();
Retrieves all role types currently played in this Relation.
Returns
Stream<RoleType
>
Retrieve role players
relation.asRemote(Transaction tx).getPlayers(RoleType… roleTypes);
Retrieves all roleplayers of this this Relation, optionally filtered by given role types.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
role |
The roles to filter the role players by. |
false |
N/A |
Returns
Stream<Thing
>
Add roleplayer
relation.asRemote(Transaction tx).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.asRemote(Transaction tx).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)
relation.type;
Retrieves the type which this Relation belongs to.
Returns
Retrieve role players per role
await relation.asRemote(tx).getPlayersByRoleType();
Retrieves a map of all instances involved in the Relation and the role each play.
Returns
Retrieve role types currently played
relation.asRemote(tx).getRelating();
Retrieves all role types currently played in this Relation.
Returns
Retrieve role players
relation.asRemote(tx).getPlayers(roleTypes);
Retrieves all roleplayers of this this Relation, optionally filtered by given role types.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
role |
The roles to filter the role players by. |
Array of |
false |
N/A |
Returns
Add roleplayer
await relation.asRemote(tx).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.asRemote(tx).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.as_remote(tx).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.as_remote(tx).get_relating()
Retrieves all role types currently played in this Relation.
Returns
Iterator of RoleType
Retrieve role players
relation.as_remote(tx).get_players(role_types)
Retrieves all roleplayers of this this Relation, optionally filtered by given role types.
Accepts
Param | Description | Type | Required | Default |
---|---|---|---|---|
role |
The roles to filter the role players by. |
List of |
false |
N/A |
Returns
Iterator of Thing
Add roleplayer
relation.as_remote(tx).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.as_remote(tx).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