G - A vendor specific implementation of a Tinkerpop Graph.public abstract class AbstractGraknGraph<G extends org.apache.tinkerpop.gremlin.structure.Graph> extends Object implements GraknGraph, GraknAdmin
The Grakn Graph Base Implementation
This defines how a grakn graph sits on top of a Tinkerpop Graph.
It mostly act as a construction object which ensure the resulting graph conforms to the Grakn Object model.
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
LOG |
static String |
NORMAL_CACHE_TIMEOUT_MS |
static String |
SHARDING_THRESHOLD |
| Constructor and Description |
|---|
AbstractGraknGraph(G graph,
String keyspace,
String engineUri,
Properties properties) |
protected final org.slf4j.Logger LOG
public static final String SHARDING_THRESHOLD
public static final String NORMAL_CACHE_TIMEOUT_MS
public AbstractGraknGraph(G graph, String keyspace, String engineUri, Properties properties)
public LabelId convertToId(Label label)
convertToId in interface GraknAdminpublic abstract boolean isConceptModified(Concept concept)
concept - A concept in the graphpublic abstract int numOpenTx()
public void openTransaction(GraknTxType txType)
public String getEngineUrl()
getEngineUrl in interface GraknAdminpublic String getKeyspace()
getKeyspace in interface GraknGraphpublic boolean isClosed()
isClosed in interface GraknGraphpublic abstract boolean isSessionClosed()
public boolean isReadOnly()
isReadOnly in interface GraknGraphpublic GraknAdmin admin()
admin in interface GraknGraphpublic <T extends Concept> T buildConcept(org.apache.tinkerpop.gremlin.structure.Vertex vertex)
buildConcept in interface GraknAdminpublic <T extends Concept> T buildConcept(org.apache.tinkerpop.gremlin.structure.Edge edge)
buildConcept in interface GraknAdminpublic boolean isBatchGraph()
isBatchGraph in interface GraknAdminpublic G getTinkerPopGraph()
public org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource getTinkerTraversal()
getTinkerTraversal in interface GraknAdminpublic QueryBuilder graql()
graql in interface GraknGraphpublic <T extends Concept> T getConcept(Schema.VertexProperty key, Object value)
getConcept in interface GraknAdminpublic EntityType putEntityType(String label)
putEntityType in interface GraknGraphpublic EntityType putEntityType(Label label)
putEntityType in interface GraknGraphpublic RelationType putRelationType(String label)
putRelationType in interface GraknGraphpublic RelationType putRelationType(Label label)
putRelationType in interface GraknGraphpublic Role putRole(String label)
putRole in interface GraknGraphpublic Role putRole(Label label)
putRole in interface GraknGraphpublic <V> ResourceType<V> putResourceType(String label, ResourceType.DataType<V> dataType)
putResourceType in interface GraknGraphpublic <V> ResourceType<V> putResourceType(Label label, ResourceType.DataType<V> dataType)
putResourceType in interface GraknGraphpublic RuleType putRuleType(String label)
putRuleType in interface GraknGraphpublic RuleType putRuleType(Label label)
putRuleType in interface GraknGraphpublic <T extends Concept> T getConcept(ConceptId id)
getConcept in interface GraknGraphpublic <V> Collection<Resource<V>> getResourcesByValue(V value)
getResourcesByValue in interface GraknGraphpublic <T extends OntologyConcept> T getOntologyConcept(Label label)
getOntologyConcept in interface GraknGraphpublic <T extends Type> T getType(Label label)
getType in interface GraknGraphpublic EntityType getEntityType(String label)
getEntityType in interface GraknGraphpublic RelationType getRelationType(String label)
getRelationType in interface GraknGraphpublic <V> ResourceType<V> getResourceType(String label)
getResourceType in interface GraknGraphpublic Role getRole(String label)
getRole in interface GraknGraphpublic RuleType getRuleType(String label)
getRuleType in interface GraknGraphpublic OntologyConcept getMetaConcept()
getMetaConcept in interface GraknAdminpublic RelationType getMetaRelationType()
getMetaRelationType in interface GraknAdminpublic Role getMetaRole()
getMetaRole in interface GraknAdminpublic ResourceType getMetaResourceType()
getMetaResourceType in interface GraknAdminpublic EntityType getMetaEntityType()
getMetaEntityType in interface GraknAdminpublic RuleType getMetaRuleType()
getMetaRuleType in interface GraknAdminpublic RuleType getMetaRuleInference()
getMetaRuleInference in interface GraknAdminpublic RuleType getMetaRuleConstraint()
getMetaRuleConstraint in interface GraknAdminpublic void delete()
delete in interface GraknAdminprotected void clearGraph()
public void closeSession()
closeSession in interface GraknAdminpublic void close()
close in interface GraknGraphclose in interface AutoCloseablepublic void abort()
abort in interface GraknGraphpublic void commit()
throws InvalidGraphException
commit in interface GraknGraphInvalidGraphExceptionpublic Optional<String> commitNoLogs() throws InvalidGraphException
commitNoLogs in interface GraknAdminInvalidGraphException - when the graph does not conform to the object conceptpublic void validVertex(org.apache.tinkerpop.gremlin.structure.Vertex vertex)
public boolean duplicateResourcesExist(String index, Set<ConceptId> resourceVertexIds)
duplicateResourcesExist in interface GraknAdminindex - Index of the potentially duplicated resourceresourceVertexIds - Set of vertex ids containing potential duplicatespublic boolean fixDuplicateResources(String index, Set<ConceptId> resourceVertexIds)
fixDuplicateResources in interface GraknAdminresourceVertexIds - The resource vertex ids which need to be merged.public void updateConceptCounts(Map<ConceptId,Long> typeCounts)
updateConceptCounts in interface GraknAdminpublic void shard(ConceptId conceptId)
shard in interface GraknAdminCopyright © 2017 Grakn Labs Ltd. All rights reserved.