public interface Type extends Concept
A Type represents any ontological element in the graph.
Types are used to model the behaviour of Instance and how they relate to each other.
They also aid in categorising Instance to different types.
EntityType,
RoleType,
RelationType,
ResourceType,
RuleType| Modifier and Type | Method and Description |
|---|---|
Type |
copy() |
Type |
deletePlays(RoleType roleType) |
Type |
deleteScope(Instance scope)
Delete the scope specified.
|
TypeLabel |
getLabel()
Returns the unique label of this Type.
|
Collection<Rule> |
getRulesOfConclusion()
Return the collection of Rules for which this Type serves as a conclusion.
|
Collection<Rule> |
getRulesOfHypothesis()
Return the collection of Rules for which this Type serves as a hypothesis.
|
Collection<? extends Instance> |
instances()
Get all indirect instances of this type.
|
Boolean |
isAbstract()
Return if the type is set to abstract.
|
Boolean |
isImplicit()
Return whether the Type was created implicitly.
|
Type |
key(ResourceType resourceType)
Creates a RelationType which allows this type and a resource type to be linked in a strictly one-to-one mapping.
|
Collection<ResourceType> |
keys() |
Collection<RoleType> |
plays() |
Type |
plays(RoleType roleType) |
Type |
resource(ResourceType resourceType)
Creates a RelationType which allows this type and a resource type to be linked.
|
Collection<ResourceType> |
resources() |
Type |
scope(Instance scope)
Classifies the type to a specific scope.
|
Collection<Instance> |
scopes()
Retrieve a list of the Instances that scope this Type.
|
Type |
setAbstract(Boolean isAbstract)
Sets the Entity Type to be abstract - which prevents it from having any instances.
|
Collection<? extends Type> |
subTypes()
Get all indirect sub-types of this type.
|
Type |
superType() |
asEntity, asEntityType, asInstance, asRelation, asRelationType, asResource, asResourceType, asRoleType, asRule, asRuleType, asType, delete, getId, isEntity, isEntityType, isInstance, isRelation, isRelationType, isResource, isResourceType, isRoleType, isRule, isRuleType, isTypecompareToType setAbstract(Boolean isAbstract) throws ConceptException
isAbstract - Specifies if the concept is to be abstract (true) or not (false).ConceptException - if this is a meta-typeType plays(RoleType roleType) throws ConceptException
roleType - The Role Type which the instances of this Type are allowed to play.ConceptException - if this is a meta-typeType key(ResourceType resourceType) throws ConceptException
resourceType - The resource type which instances of this type should be allowed to play.ConceptException - if this is a meta-typeType resource(ResourceType resourceType) throws ConceptException
resourceType - The resource type which instances of this type should be allowed to play.ConceptException - if this is a meta-typeType scope(Instance scope)
scope - The category of this TypeType deleteScope(Instance scope)
scope - The Instances that is currently scoping this Type.TypeLabel getLabel()
Collection<RoleType> plays()
Collection<ResourceType> resources()
Collection<ResourceType> keys()
Type superType()
Collection<? extends Type> subTypes()
Collection<? extends Instance> instances()
Boolean isAbstract()
Boolean isImplicit()
resource(ai.grakn.concept.ResourceType)Collection<Rule> getRulesOfHypothesis()
RuleCollection<Rule> getRulesOfConclusion()
RuleCollection<Instance> scopes()
Type deletePlays(RoleType roleType)
roleType - The Role Type which the instances of this Type should no longer be allowed to play.Type copy()
Copyright © 2017 Grakn Labs Ltd. All rights reserved.