public abstract class AbstractMindmapsGraph<G extends org.apache.tinkerpop.gremlin.structure.Graph> extends Object implements MindmapsGraph
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
AbstractMindmapsGraph(G graph,
String keyspace,
String engine,
boolean batchLoadingEnabled) |
| Modifier and Type | Method and Description |
|---|---|
Entity |
addEntity(EntityType type) |
Relation |
addRelation(RelationType type) |
Rule |
addRule(String lhs,
String rhs,
RuleType type) |
void |
clear()
Clears the graph completely.
|
void |
close()
Closes the current graph, rendering it unusable.
|
void |
commit()
Commits the graph
|
protected void |
commitTx() |
boolean |
fixDuplicateCasting(Object castingId)
Merges duplicate castings if one is found.
|
boolean |
fixDuplicateResources(Set<Object> resourceIds) |
protected String |
getCommitLogEndPoint() |
io.mindmaps.graph.internal.ConceptImpl |
getConcept(Schema.ConceptProperty key,
String value) |
Concept |
getConcept(String id) |
io.mindmaps.graph.internal.ConceptImpl |
getConceptByBaseIdentifier(Object baseIdentifier) |
io.mindmaps.graph.internal.ConceptLog |
getConceptLog() |
Set<io.mindmaps.graph.internal.ConceptImpl> |
getConcepts(Schema.ConceptProperty key,
Object value) |
io.mindmaps.graph.internal.ElementFactory |
getElementFactory() |
Entity |
getEntity(String id) |
EntityType |
getEntityType(String id) |
Instance |
getInstance(String id) |
String |
getKeyspace() |
Type |
getMetaEntityType() |
Type |
getMetaRelationType() |
Type |
getMetaResourceType() |
Type |
getMetaRoleType() |
RuleType |
getMetaRuleConstraint() |
RuleType |
getMetaRuleInference() |
Type |
getMetaRuleType() |
Type |
getMetaType() |
Set<String> |
getModifiedCastingIds() |
Set<io.mindmaps.graph.internal.ConceptImpl> |
getModifiedConcepts() |
Set<String> |
getModifiedResourceIds() |
Relation |
getRelation(RelationType relationType,
Map<RoleType,Instance> roleMap) |
Relation |
getRelation(String id) |
RelationType |
getRelationType(String id) |
<V> Resource<V> |
getResource(String id) |
<V> Collection<Resource<V>> |
getResourcesByValue(V value) |
<V> ResourceType<V> |
getResourceType(String id) |
RoleType |
getRoleType(String id) |
Rule |
getRule(String id) |
RuleType |
getRuleType(String id) |
G |
getTinkerPopGraph() |
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal<org.apache.tinkerpop.gremlin.structure.Vertex,org.apache.tinkerpop.gremlin.structure.Vertex> |
getTinkerTraversal() |
Type |
getType(String id) |
boolean |
initialiseMetaConcepts() |
boolean |
isBatchLoadingEnabled() |
boolean |
isMetaOntologyNotInitialised() |
io.mindmaps.graph.internal.CastingImpl |
putCasting(io.mindmaps.graph.internal.RoleTypeImpl role,
io.mindmaps.graph.internal.InstanceImpl rolePlayer,
io.mindmaps.graph.internal.RelationImpl relation) |
Entity |
putEntity(String itemIdentifier,
EntityType type)
Deprecated.
|
EntityType |
putEntityType(String itemIdentifier) |
Relation |
putRelation(String itemIdentifier,
RelationType type)
Deprecated.
|
RelationType |
putRelationType(String itemIdentifier) |
<V> Resource<V> |
putResource(V value,
ResourceType<V> type) |
<V> ResourceType<V> |
putResourceType(String id,
ResourceType.DataType<V> dataType) |
RoleType |
putRoleType(String itemIdentifier) |
Rule |
putRule(String itemIdentifier,
String lhs,
String rhs,
RuleType type)
Deprecated.
|
RuleType |
putRuleType(String itemIdentifier) |
void |
putShortcutEdges(Relation relation,
RelationType relationType) |
void |
rollback()
Resets the current transaction without commiting.
|
protected void |
submitCommitLogs(Map<Schema.BaseType,Set<String>> concepts) |
protected void |
validateGraph() |
public String getKeyspace()
getKeyspace in interface MindmapsGraphpublic boolean isBatchLoadingEnabled()
public boolean initialiseMetaConcepts()
public boolean isMetaOntologyNotInitialised()
public 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 MindmapsGraphpublic io.mindmaps.graph.internal.ElementFactory getElementFactory()
public io.mindmaps.graph.internal.ConceptImpl getConcept(Schema.ConceptProperty key, String value)
public Set<io.mindmaps.graph.internal.ConceptImpl> getConcepts(Schema.ConceptProperty key, Object value)
public Set<io.mindmaps.graph.internal.ConceptImpl> getModifiedConcepts()
public io.mindmaps.graph.internal.ConceptLog getConceptLog()
@Deprecated public Entity putEntity(String itemIdentifier, EntityType type)
putEntity in interface MindmapsGraphitemIdentifier - A unique id for the Entitytype - The type of this Entitypublic Entity addEntity(EntityType type)
addEntity in interface MindmapsGraphtype - The type of this Entitypublic EntityType putEntityType(String itemIdentifier)
putEntityType in interface MindmapsGraphitemIdentifier - A unique Id for the Entity Typepublic RelationType putRelationType(String itemIdentifier)
putRelationType in interface MindmapsGraphitemIdentifier - A unique Id for the Relation Typepublic RoleType putRoleType(String itemIdentifier)
putRoleType in interface MindmapsGraphitemIdentifier - A unique Id for the Role Typepublic <V> ResourceType<V> putResourceType(String id, ResourceType.DataType<V> dataType)
putResourceType in interface MindmapsGraphV - The data type of the resource type. Supported types include: String, Long, Double, Boolean.
This should match the parameter typeid - A unique Id for the Resource TypedataType - The data type of the resource type.
Supported types include: DataType.STRING, DataType.LONG, DataType.DOUBLE, and DataType.BOOLEANpublic <V> Resource<V> putResource(V value, ResourceType<V> type)
putResource in interface MindmapsGraphV - The data type of both the ResourceType and the Resource.
Supported types include: String, Long, Double, Boolean.value - A value for the Resource which is unique to it's typetype - The resource type of this resource.public RuleType putRuleType(String itemIdentifier)
putRuleType in interface MindmapsGraphitemIdentifier - A unique Id for the Rule Type@Deprecated public Rule putRule(String itemIdentifier, String lhs, String rhs, RuleType type)
putRule in interface MindmapsGraphitemIdentifier - A unique Id for the Rulelhs - A string representing the left hand side Graql query.rhs - A string representing the right hand side Graql query.type - The rule type of this Rulepublic Rule addRule(String lhs, String rhs, RuleType type)
addRule in interface MindmapsGraphlhs - A string representing the left hand side Graql query.rhs - A string representing the right hand side Graql query.type - The rule type of this Rule@Deprecated public Relation putRelation(String itemIdentifier, RelationType type)
putRelation in interface MindmapsGraphitemIdentifier - A unique Id for the Relationtype - The relation type of this Relationpublic Relation addRelation(RelationType type)
addRelation in interface MindmapsGraphtype - The relation type of this Relationpublic io.mindmaps.graph.internal.ConceptImpl getConceptByBaseIdentifier(Object baseIdentifier)
public Concept getConcept(String id)
getConcept in interface MindmapsGraphid - A unique Id which identifies the Concept in the graph.public Type getType(String id)
getType in interface MindmapsGraphid - A unique Id which identifies the Type in the graph.public Instance getInstance(String id)
getInstance in interface MindmapsGraphid - A unique Id which identifies the Instance in the graph.public Entity getEntity(String id)
getEntity in interface MindmapsGraphid - A unique Id which identifies the Entity in the graph.public <V> Resource<V> getResource(String id)
getResource in interface MindmapsGraphV - The data type of the value. Supported types include: String, Long, Double, and Boolean.id - A unique Id which identifies the Resource in the graph.public <V> Collection<Resource<V>> getResourcesByValue(V value)
getResourcesByValue in interface MindmapsGraphV - The data type of the value. Supported types include: String, Long, Double, and Boolean.value - A value which a Resource in the graph may be holding.public Rule getRule(String id)
getRule in interface MindmapsGraphid - A unique Id which identifies the Rule in the graph.public EntityType getEntityType(String id)
getEntityType in interface MindmapsGraphid - A unique Id which identifies the Entity Type in the graph.public RelationType getRelationType(String id)
getRelationType in interface MindmapsGraphid - A unique Id which identifies the Relation Type in the graph.public <V> ResourceType<V> getResourceType(String id)
getResourceType in interface MindmapsGraphV - The data type of the value. Supported types include: String, Long, Double, and Boolean.id - A unique Id which identifies the Resource Type in the graph.public RoleType getRoleType(String id)
getRoleType in interface MindmapsGraphid - A unique Id which identifies the Role Type in the graph.public RuleType getRuleType(String id)
getRuleType in interface MindmapsGraphid - A unique Id which identifies the Rule Type in the graph.public Type getMetaType()
getMetaType in interface MindmapsGraphpublic Type getMetaRelationType()
getMetaRelationType in interface MindmapsGraphpublic Type getMetaRoleType()
getMetaRoleType in interface MindmapsGraphpublic Type getMetaResourceType()
getMetaResourceType in interface MindmapsGraphpublic Type getMetaEntityType()
getMetaEntityType in interface MindmapsGraphpublic Type getMetaRuleType()
getMetaRuleType in interface MindmapsGraphpublic RuleType getMetaRuleInference()
getMetaRuleInference in interface MindmapsGraphpublic RuleType getMetaRuleConstraint()
getMetaRuleConstraint in interface MindmapsGraphpublic io.mindmaps.graph.internal.CastingImpl putCasting(io.mindmaps.graph.internal.RoleTypeImpl role,
io.mindmaps.graph.internal.InstanceImpl rolePlayer,
io.mindmaps.graph.internal.RelationImpl relation)
public void putShortcutEdges(Relation relation, RelationType relationType)
public Relation getRelation(RelationType relationType, Map<RoleType,Instance> roleMap)
getRelation in interface MindmapsGraphrelationType - The Relation Type which we wish to find a Relation instance of.roleMap - A role map specifying the rolePlayers (Instances or Resources) in the relationship and the roles (Role Types) they play.public Relation getRelation(String id)
getRelation in interface MindmapsGraphid - The id of the relation object you are looking forpublic void rollback()
MindmapsGraphrollback in interface MindmapsGraphpublic void clear()
clear in interface MindmapsGraphpublic void close()
close in interface MindmapsGraphclose in interface AutoCloseablepublic void commit()
throws MindmapsValidationException
commit in interface MindmapsGraphMindmapsValidationException - when the graph does not conform to the object conceptprotected void commitTx()
protected void validateGraph()
throws MindmapsValidationException
MindmapsValidationExceptionprotected void submitCommitLogs(Map<Schema.BaseType,Set<String>> concepts)
protected String getCommitLogEndPoint()
public boolean fixDuplicateCasting(Object castingId)
castingId - The id of the casting to check for duplicatesCopyright © 2016. All rights reserved.