D - The data type of this resource type.
Supported Types include: String, Long, Double, and Booleanpublic interface Resource<D> extends Thing
Represent a literal resource in the graph.
Acts as an Thing when relating to other instances except it has the added functionality of:
1. It is unique to its ResourceType based on it's value.
2. It has a ResourceType.DataType associated with it which constrains the allowed values.
| Modifier and Type | Method and Description |
|---|---|
ResourceType.DataType<D> |
dataType()
Retrieves the data type of this Resource's ResourceType.
|
D |
getValue()
Retrieves the value of the Resource.
|
Thing |
owner()
If the Resource is unique, this method retrieves the Thing that possesses it.
|
Collection<Thing> |
ownerInstances()
Retrieves the set of all Instances that possess this Resource.
|
Resource |
resource(Resource resource)
Creates a relation from this instance to the provided resource.
|
ResourceType<D> |
type()
Retrieves the type of the Resource, that is, the ResourceType of which this resource is an Thing.
|
asEntity, asEntityType, asInstance, asOntologyConcept, asRelation, asRelationType, asResource, asResourceType, asRoleType, asRule, asRuleType, asType, delete, getId, isEntity, isEntityType, isInstance, isOntologyConcept, isRelation, isRelationType, isResource, isResourceType, isRoleType, isRule, isRuleType, isTypecompareTo@CheckReturnValue D getValue()
ResourceType<D> type()
@CheckReturnValue ResourceType.DataType<D> dataType()
@CheckReturnValue Collection<Thing> ownerInstances()
@CheckReturnValue Thing owner()
Copyright © 2017 Grakn Labs Ltd. All rights reserved.