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.
| Modifier and Type | Field and Description |
|---|---|
static String |
NORMAL_CACHE_TIMEOUT_MS |
static String |
SHARDING_THRESHOLD |
| Constructor and Description |
|---|
GraknTxAbstract(G graph,
Keyspace keyspace,
String engineUri,
Properties properties) |
public static final String SHARDING_THRESHOLD
public static final String NORMAL_CACHE_TIMEOUT_MS
public GraknTxAbstract(G graph, Keyspace 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 CommitLog commitLog()
public String getEngineUrl()
getEngineUrl in interface GraknAdminpublic Keyspace getKeyspace()
getKeyspace in interface GraknTxpublic TxCache txCache()
public abstract boolean isSessionClosed()
public boolean isReadOnly()
isReadOnly in interface GraknTxpublic GraknAdmin admin()
public <T extends Concept> Optional<T> buildConcept(org.apache.tinkerpop.gremlin.structure.Vertex vertex)
buildConcept in interface GraknAdminpublic <T extends Concept> Optional<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 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 getMetaResourceType()
getMetaResourceType in interface GraknAdminpublic EntityType getMetaEntityType()
getMetaEntityType in interface GraknAdminpublic Rule getMetaRule()
getMetaRule in interface GraknAdminpublic void putShortcutEdge(Thing toThing, RelationshipReified fromRelation, Role roleType)
public void delete()
delete in interface GraknAdminprotected void clearGraph()
public void closeSession()
closeSession in interface GraknAdminpublic void close()
close in interface GraknTxclose in interface AutoCloseablepublic void commit()
throws InvalidKBException
commit in interface GraknTxInvalidKBExceptionpublic Optional<String> commitNoLogs() throws InvalidKBException
commitNoLogs in interface GraknAdminInvalidKBExceptionpublic boolean validElement(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 updateConceptCounts(Map<ConceptId,Long> typeCounts)
updateConceptCounts in interface GraknAdminpublic void shard(ConceptId conceptId)
shard in interface GraknAdminCopyright © 2017 Grakn Labs Ltd. All rights reserved.