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 String |
generateNewHash(RelationshipType relationshipType,
Map<Role,Set<Thing>> roleMap) |
static String |
generateNewHash(RelationshipType relationshipType,
TreeMap<String,String> resourceMap)
Creates a hash for a relation based on it's
RelationshipType and the Attribute which serves as it's key |
static RelationshipReified |
get(VertexElement vertexElement) |
ConceptId |
getId() |
String |
innerToString() |
boolean |
isDeleted()
Return whether the relationship has been deleted.
|
boolean |
isReified() |
RelationshipReified |
reify() |
java.util.stream.Stream<Thing> |
rolePlayers(Role... roles) |
void |
setHash(String hash)
Sets the internal hash in order to perform a faster lookup
|
RelationshipType |
type() |
attribute, attributeRelationship, attributes, delete, deleteAttribute, getIndex, plays, relationships, txCacheClear, typeaddEdge, baseType, compareTo, createShard, currentShard, deleteNode, equals, getId, getShardCount, hashCode, isDeleted, setShardCount, shards, toString, vertexclone, finalize, getClass, notify, notifyAll, wait, wait, waitfrom, txCacheClearasAttribute, asAttributeType, asEntity, asEntityType, asRelationship, asRelationshipType, asRole, asRule, asSchemaConcept, asType, getId, isAttribute, isAttributeType, isDeleted, isEntity, isEntityType, isRelationship, isRelationshipType, isRole, isRule, isSchemaConcept, isTypecompareTofrompublic static RelationshipReified get(VertexElement vertexElement)
public static RelationshipReified create(VertexElement vertexElement, RelationshipType type)
public java.util.stream.Stream<Thing> rolePlayers(Role... roles)
public void setHash(String hash)
public static String generateNewHash(RelationshipType relationshipType, Map<Role,Set<Thing>> roleMap)
relationshipType - The type of this relationroleMap - The roles and their corresponding role playersRelationshippublic static String generateNewHash(RelationshipType relationshipType, TreeMap<String,String> resourceMap)
RelationshipType and the Attribute which serves as it's keyrelationshipType - the RelationshipType of the RelationshipresourceMap - a sorted map of AttributeType Ids to Attribute IdsRelationshippublic java.util.stream.Stream<Casting> castingsRelation(Role... roles)
Relationshiproles - The role which the instances are playingCasting which unify a Role and Thing with this Relationshippublic String innerToString()
public RelationshipReified reify()
public boolean isReified()
Relationship has been reified meaning it can support n-ary relationshipspublic ConceptId getId()
ConceptId of the Relationshippublic RelationshipType type()
RelationshipType of the Relationshippublic void delete()
public boolean isDeleted()
Copyright © 2017 Grakn Labs Ltd. All rights reserved.