public interface RelationType extends Type
An ontological element which categorises how Things may relate to each other.
A relation type defines how Type may relate to one another.
They are used to model and categorise n-ary relationships.
| Modifier and Type | Method and Description |
|---|---|
Relation |
addRelation()
Creates and returns a new
Relation instance, whose direct type will be this type. |
RelationType |
deletePlays(Role role)
Removes the Role to prevent instances of this RelationType from playing it.
|
RelationType |
deleteRelates(Role role)
Delete a Role from this RelationType
|
RelationType |
deleteScope(Thing scope)
Delete the scope specified.
|
Collection<Relation> |
instances()
Retrieve all the Relation instances of this RelationType
|
RelationType |
key(ResourceType resourceType)
Creates a RelationType which allows this type and a resource type to be linked in a strictly one-to-one mapping.
|
RelationType |
plays(Role role)
Sets the Role which instances of this RelationType may play.
|
Collection<Role> |
relates()
Retrieves a list of the RoleTypes that make up this RelationType.
|
RelationType |
relates(Role role)
Sets a new Role for this RelationType.
|
RelationType |
resource(ResourceType resourceType)
Creates a RelationType which allows this type and a resource type to be linked.
|
RelationType |
scope(Thing scope)
Classifies the type to a specific scope.
|
RelationType |
setAbstract(Boolean isAbstract)
Sets the RelationType to be abstract - which prevents it from having any instances.
|
RelationType |
sub(RelationType type)
Adds another subtype to this type
|
Collection<RelationType> |
subs()
Returns a collection of subtypes of this RelationType.
|
RelationType |
sup()
Returns the direct supertype of this RelationType.
|
RelationType |
sup(RelationType type)
Sets the supertype of the RelationType to be the RelationType specified.
|
getLabel, getRulesOfConclusion, getRulesOfHypothesis, getTypeId, isImplicitasEntity, asEntityType, asInstance, asOntologyConcept, asRelation, asRelationType, asResource, asResourceType, asRoleType, asRule, asRuleType, asType, delete, getId, isEntity, isEntityType, isInstance, isOntologyConcept, isRelation, isRelationType, isResource, isResourceType, isRoleType, isRule, isRuleType, isTypecompareToRelation addRelation()
Relation instance, whose direct type will be this type.GraphOperationException - if this is a meta typeRelationRelationType sup(RelationType type)
type - The supertype of this RelationTypeRelationType sub(RelationType type)
type - The sub type of this relation typeRelationType scope(Thing scope)
RelationType deleteScope(Thing scope)
deleteScope in interface Typescope - The Instances that is currently scoping this Type.RelationType key(ResourceType resourceType)
RelationType resource(ResourceType resourceType)
@CheckReturnValue Collection<Role> relates()
RoleRelationType relates(Role role)
role - A new role which is part of this relationship.RoleRelationType deleteRelates(Role role)
role - The Role to delete from the RelationType.RoleRelationType setAbstract(Boolean isAbstract)
setAbstract in interface TypeisAbstract - Specifies if the concept is to be abstract (true) or not (false).RelationType sup()
sup in interface OntologyConceptsup in interface TypeCollection<RelationType> subs()
subs in interface OntologyConceptsubs in interface TypeRelationType plays(Role role)
RelationType deletePlays(Role role)
deletePlays in interface Typerole - The Role which the instances of this Type should no longer be allowed to play.Collection<Relation> instances()
Copyright © 2017 Grakn Labs Ltd. All rights reserved.