public interface RelationType extends Type
An ontological element which categorises how Instances 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 |
copy() |
RelationType |
deletePlays(RoleType roleType)
Removes the RoleType to prevent instances of this RelationType from playing it.
|
RelationType |
deleteRelates(RoleType roleType)
Delete a RoleType from this RelationType
|
RelationType |
deleteScope(Instance 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(RoleType roleType)
Sets the RoleType which instances of this RelationType may play.
|
Collection<RoleType> |
relates()
Retrieves a list of the RoleTypes that make up this RelationType.
|
RelationType |
relates(RoleType roleType)
Sets a new RoleType for this RelationType.
|
RelationType |
resource(ResourceType resourceType)
Creates a RelationType which allows this type and a resource type to be linked.
|
RelationType |
scope(Instance 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 |
subType(RelationType type)
Adds another subtype to this type
|
Collection<RelationType> |
subTypes()
Returns a collection of subtypes of this RelationType.
|
RelationType |
superType()
Returns the direct supertype of this RelationType.
|
RelationType |
superType(RelationType type)
Sets the supertype of the RelationType to be the RelationType specified.
|
getLabel, getRulesOfConclusion, getRulesOfHypothesis, isAbstract, isImplicit, keys, plays, resources, scopesasEntity, asEntityType, asInstance, asRelation, asRelationType, asResource, asResourceType, asRoleType, asRule, asRuleType, asType, delete, getId, isEntity, isEntityType, isInstance, isRelation, isRelationType, isResource, isResourceType, isRoleType, isRule, isRuleType, isTypecompareToRelation addRelation()
Relation instance, whose direct type will be this type.ConceptException - if this is a meta typeRelationRelationType superType(RelationType type)
type - The supertype of this RelationTypeRelationType subType(RelationType type)
type - The sub type of this relation typeRelationType scope(Instance scope)
RelationType deleteScope(Instance scope)
deleteScope in interface Typescope - The Instances that is currently scoping this Type.RelationType key(ResourceType resourceType)
RelationType resource(ResourceType resourceType)
Collection<RoleType> relates()
RoleTypeRelationType relates(RoleType roleType)
roleType - A new role which is part of this relationship.RoleTypeRelationType deleteRelates(RoleType roleType)
roleType - The RoleType to delete from the RelationType.RoleTypeRelationType setAbstract(Boolean isAbstract)
setAbstract in interface TypeisAbstract - Specifies if the concept is to be abstract (true) or not (false).RelationType superType()
Collection<RelationType> subTypes()
RelationType plays(RoleType roleType)
RelationType deletePlays(RoleType roleType)
deletePlays in interface TyperoleType - The RoleType which the instances of this Type should no longer be allowed to play.Collection<Relation> instances()
RelationType copy()
Copyright © 2017 Grakn Labs Ltd. All rights reserved.