public class RelationshipReified extends ThingImpl<Relationship,RelationshipType>
Encapsulates The Relationship as a VertexElement
This wraps up a Relationship as a VertexElement. It is used to represent any Relationship which
has been reified.
| Modifier and Type | Method and Description |
|---|---|
void |
addRolePlayer(Role role,
Thing thing) |
Map<Role,Set<Thing>> |
allRolePlayers() |
java.util.stream.Stream<Casting> |
castingsRelation(Role... roles)
Castings are retrieved from the perspective of the
Relationship |
static RelationshipReified |
create(VertexElement vertexElement,
RelationshipType type) |
void |
delete()
|
static RelationshipReified |
get(VertexElement vertexElement) |
ConceptId |
id() |
String |
innerToString() |
boolean |
isDeleted()
Return whether the relationship has been deleted.
|
boolean |
isInferred()
Used to indicate if this
Relationship has been created as the result of a Rule inference. |
boolean |
isReified() |
Keyspace |
keyspace()
Used for determining which
Keyspace a RelationshipStructure was created in and is bound to. |
void |
owner(RelationshipImpl relationship)
Sets the owner of this structure to a specific
RelationshipImpl. |
void |
putRolePlayerEdge(Role role,
Thing toThing)
If the edge does not exist then it adds a
Schema.EdgeLabel#ROLE_PLAYER edge from
this Relationship to a target Thing which is playing some Role. |
RelationshipReified |
reify() |
java.util.stream.Stream<Thing> |
rolePlayers(Role... roles) |
RelationshipType |
type() |
attributeInferred, attributes, delete, getIndex, has, isInferred, keys, relationships, relhas, roles, type, unhasbaseType, caches, createShard, currentShard, deleteNode, equals, hashCode, id, isDeleted, keyspace, shardCount, shards, toString, vertexclone, finalize, getClass, notify, notifyAll, wait, wait, waitcaches, from, registerCache, txCacheClear, txCacheFlushasAttribute, asAttributeType, asEntity, asEntityType, asRelationship, asRelationshipType, asRole, asRule, asSchemaConcept, asType, id, isAttribute, isAttributeType, isDeleted, isEntity, isEntityType, isRelationship, isRelationshipType, isRole, isRule, isSchemaConcept, isType, keyspacefrompublic static RelationshipReified get(VertexElement vertexElement)
public static RelationshipReified create(VertexElement vertexElement, RelationshipType type)
public java.util.stream.Stream<Thing> rolePlayers(Role... roles)
public void putRolePlayerEdge(Role role, Thing toThing)
Schema.EdgeLabel#ROLE_PLAYER edge from
this Relationship to a target Thing which is playing some Role.
If the edge does exist nothing is done.role - The Role being played by the Thing in this RelationshiptoThing - The Thing playing a Role in this Relationshippublic java.util.stream.Stream<Casting> castingsRelation(Role... roles)
Relationshippublic String innerToString()
public void owner(RelationshipImpl relationship)
RelationshipImpl.
This is so that the internal structure can use the Relationship reference;relationship - the owner of this RelationshipReifiedpublic RelationshipReified reify()
public boolean isReified()
Relationship has been reified meaning it can support n-ary relationshipspublic ConceptId id()
ConceptId of the Relationshippublic Keyspace keyspace()
Keyspace a RelationshipStructure was created in and is bound to.Keyspace this RelationshipStructure belongs to.public RelationshipType type()
RelationshipType of the Relationshippublic void delete()
public boolean isDeleted()
public boolean isInferred()
Relationship has been created as the result of a Rule inference.Relationship exists due to a ruleRuleCopyright © 2018 Grakn Labs Ltd. All rights reserved.