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 engine,
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 engine, Properties properties)
public TypeId convertToId(TypeLabel label)
convertToId in interface GraknAdminpublic abstract boolean isConceptModified(ai.grakn.graph.internal.ConceptImpl concept)
concept - A concept in the graphpublic abstract int numOpenTx()
public void openTransaction(GraknTxType txType)
public String getKeyspace()
getKeyspace in interface GraknGraphpublic boolean isClosed()
isClosed in interface GraknGraphpublic abstract boolean isSessionClosed()
public boolean implicitConceptsVisible()
implicitConceptsVisible in interface GraknGraphpublic boolean isReadOnly()
isReadOnly in interface GraknGraphpublic void showImplicitConcepts(boolean flag)
showImplicitConcepts 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 boolean isBatchGraph()
isBatchGraph in interface GraknAdminpublic G getTinkerPopGraph()
public org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal<org.apache.tinkerpop.gremlin.structure.Vertex,org.apache.tinkerpop.gremlin.structure.Vertex> getTinkerTraversal()
getTinkerTraversal in interface GraknAdminpublic QueryBuilder graql()
graql in interface GraknGraphpublic <T extends Concept> T getConcept(Schema.ConceptProperty key, Object value)
getConcept in interface GraknAdminpublic EntityType putEntityType(String label)
putEntityType in interface GraknGraphpublic EntityType putEntityType(TypeLabel label)
putEntityType in interface GraknGraphpublic RelationType putRelationType(String label)
putRelationType in interface GraknGraphpublic RelationType putRelationType(TypeLabel label)
putRelationType in interface GraknGraphpublic RoleType putRoleType(String label)
putRoleType in interface GraknGraphpublic RoleType putRoleType(TypeLabel label)
putRoleType in interface GraknGraphpublic <V> ResourceType<V> putResourceType(String label, ResourceType.DataType<V> dataType)
putResourceType in interface GraknGraphpublic <V> ResourceType<V> putResourceType(TypeLabel label, ResourceType.DataType<V> dataType)
putResourceType in interface GraknGraphpublic RuleType putRuleType(String label)
putRuleType in interface GraknGraphpublic RuleType putRuleType(TypeLabel 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 Type> T getType(TypeLabel 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 RoleType getRoleType(String label)
getRoleType in interface GraknGraphpublic RuleType getRuleType(String label)
getRuleType in interface GraknGraphpublic Type getMetaConcept()
getMetaConcept in interface GraknAdminpublic RelationType getMetaRelationType()
getMetaRelationType in interface GraknAdminpublic RoleType getMetaRoleType()
getMetaRoleType 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 duplicateCastingsExist(String index, Set<ConceptId> castingVertexIds)
duplicateCastingsExist in interface GraknAdminpublic boolean fixDuplicateCastings(String index, Set<ConceptId> castingVertexIds)
fixDuplicateCastings in interface GraknAdmincastingVertexIds - The vertex Ids of the duplicate castingspublic 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.