G - A vendor specific implementation of a Tinkerpop Graph.public abstract class GraknTxAbstract<G extends org.apache.tinkerpop.gremlin.structure.Graph> extends Object implements GraknTx, GraknAdmin
The GraknTx 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.
| Constructor and Description |
|---|
GraknTxAbstract(GraknSession session,
G graph) |
public GraknTxAbstract(GraknSession session, G graph)
public GraknSession session()
public LabelId convertToId(Label label)
convertToId in interface GraknAdminpublic abstract int numOpenTx()
public void openTransaction(GraknTxType txType)
public long shardingThreshold()
shardingThreshold in interface GraknAdminpublic TxCache txCache()
public abstract boolean isSessionClosed()
public GraknTxType txType()
public GraknAdmin admin()
public <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 isBatchTx()
isBatchTx in interface GraknAdminpublic G getTinkerPopGraph()
public org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource getTinkerTraversal()
getTinkerTraversal in interface GraknAdminpublic QueryBuilder graql()
public ElementFactory factory()
public <T extends Concept> Optional<T> getConcept(Schema.VertexProperty key, Object value)
getConcept in interface GraknAdminpublic final java.util.stream.Stream<SchemaConcept> sups(SchemaConcept schemaConcept)
sups in interface GraknAdminpublic void checkSchemaMutationAllowed()
public void checkMutationAllowed()
public VertexElement addVertexElement(Schema.BaseType baseType, ConceptId... conceptIds)
public EntityType putEntityType(String label)
putEntityType in interface GraknTxpublic EntityType putEntityType(Label label)
putEntityType in interface GraknTxpublic RelationshipType putRelationshipType(String label)
putRelationshipType in interface GraknTxpublic RelationshipType putRelationshipType(Label label)
putRelationshipType in interface GraknTxpublic RelationshipType putRelationTypeImplicit(Label label)
public <V> AttributeType<V> putAttributeType(String label, AttributeType.DataType<V> dataType)
putAttributeType in interface GraknTxpublic <V> AttributeType<V> putAttributeType(Label label, AttributeType.DataType<V> dataType)
putAttributeType in interface GraknTxpublic <T extends Concept> T getConcept(ConceptId id)
getConcept in interface GraknTx@Nullable public <T extends SchemaConcept> T getSchemaConcept(LabelId id)
public <V> Collection<Attribute<V>> getAttributesByValue(V value)
getAttributesByValue in interface GraknTxpublic <T extends SchemaConcept> T getSchemaConcept(Label label)
getSchemaConcept in interface GraknTxpublic EntityType getEntityType(String label)
getEntityType in interface GraknTxpublic RelationshipType getRelationshipType(String label)
getRelationshipType in interface GraknTxpublic <V> AttributeType<V> getAttributeType(String label)
getAttributeType in interface GraknTxpublic Type getMetaConcept()
getMetaConcept in interface GraknAdminpublic RelationshipType getMetaRelationType()
getMetaRelationType in interface GraknAdminpublic Role getMetaRole()
getMetaRole in interface GraknAdminpublic AttributeType getMetaAttributeType()
getMetaAttributeType in interface GraknAdminpublic EntityType getMetaEntityType()
getMetaEntityType in interface GraknAdminpublic Rule getMetaRule()
getMetaRule in interface GraknAdminpublic void delete()
delete in interface GraknAdminprotected void clearGraph()
public void closeSession()
public void close()
close in interface GraknTxclose in interface AutoCloseablepublic void commit()
throws InvalidKBException
commit in interface GraknTxInvalidKBExceptionpublic Optional<CommitLog> commitSubmitNoLogs() throws InvalidKBException
commitSubmitNoLogs in interface GraknAdminInvalidKBExceptionpublic boolean isValidElement(org.apache.tinkerpop.gremlin.structure.Element element)
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 shard(ConceptId conceptId)
shard in interface GraknAdminpublic long getShardCount(Type concept)
getShardCount in interface GraknAdminCopyright © 2018 Grakn Labs Ltd. All rights reserved.