public class RelationshipImpl extends Object implements Relationship, ConceptVertex, ContainsTxCache
Encapsulates relationships between Thing
A relation which is an instance of a RelationshipType defines how instances may relate to one another.
clone, finalize, getClass, notify, notifyAll, wait, wait, waitasRelationship, isRelationshipasAttribute, asAttributeType, asEntity, asEntityType, asRelationshipType, asRole, asRule, asSchemaConcept, asType, isAttribute, isAttributeType, isEntity, isEntityType, isRelationshipType, isRole, isRule, isSchemaConcept, isTypefromfrompublic static RelationshipImpl create(ai.grakn.kb.internal.concept.RelationshipStructure relationshipStructure)
public Optional<RelationshipReified> reified()
RelationshipReified if the Relationship has been reified.
To reify the Relationship you use reify().
NOTE: This approach is done to make sure that only write operations will cause the Relationship to reifyRelationshipReified if the Relationship has been reifiedpublic RelationshipReified reify()
RelationshipReifiedpublic ai.grakn.kb.internal.concept.RelationshipStructure structure()
public Relationship attribute(Attribute attribute)
attribute in interface Relationshipattribute in interface Thingpublic Relationship attributeRelationship(Attribute attribute)
attributeRelationship in interface Thingpublic java.util.stream.Stream<Attribute<?>> attributes(AttributeType[] attributeTypes)
attributes in interface Thingpublic RelationshipType type()
type in interface Relationshiptype in interface Thingpublic java.util.stream.Stream<Relationship> relationships(Role... roles)
relationships in interface Thingpublic java.util.stream.Stream<Role> plays()
public Map<Role,Set<Thing>> allRolePlayers()
allRolePlayers in interface RelationshipRoles and the Things playing them in this Relationship.Rolepublic java.util.stream.Stream<Thing> rolePlayers(Role... roles)
rolePlayers in interface Relationshippublic Relationship addRolePlayer(Role role, Thing thing)
Relationship to include a new role player which is playing a specific Role.addRolePlayer in interface Relationshiprole - The role of the new role player.thing - The new role player.Relationship itselfpublic Relationship deleteAttribute(Attribute attribute)
deleteAttribute in interface RelationshipdeleteAttribute in interface Thingpublic int compareTo(Concept o)
compareTo in interface Comparable<Concept>public VertexElement vertex()
vertex in interface ConceptVertexpublic static RelationshipImpl from(Relationship relationship)
public void txCacheClear()
ContainsTxCacheCachetxCacheClear in interface ContainsTxCacheCopyright © 2017 Grakn Labs Ltd. All rights reserved.