public class Neo4j2Graph extends Object implements com.tinkerpop.blueprints.TransactionalGraph, com.tinkerpop.blueprints.MetaGraph<org.neo4j.graphdb.GraphDatabaseService>
Modifier and Type | Field and Description |
---|---|
protected ThreadLocal<Boolean> |
checkElementsInTransaction |
protected ThreadLocal<org.neo4j.graphdb.Transaction> |
tx |
Constructor and Description |
---|
Neo4j2Graph(org.apache.commons.configuration.Configuration configuration) |
Neo4j2Graph(org.neo4j.graphdb.GraphDatabaseService rawGraph) |
Neo4j2Graph(String directory) |
Neo4j2Graph(String directory,
Map<String,String> configuration) |
Modifier and Type | Method and Description |
---|---|
Neo4j2Edge |
addEdge(Object id,
com.tinkerpop.blueprints.Vertex outVertex,
com.tinkerpop.blueprints.Vertex inVertex,
String label) |
Neo4j2Vertex |
addVertex(Object id) |
void |
autoStartTransaction(boolean forWrite) |
protected boolean |
checkElementsInTransaction() |
void |
commit() |
Neo4j2Edge |
getEdge(Object id) |
Iterable<com.tinkerpop.blueprints.Edge> |
getEdges() |
Iterable<com.tinkerpop.blueprints.Edge> |
getEdges(String key,
Object value) |
com.tinkerpop.blueprints.Features |
getFeatures() |
org.neo4j.graphdb.GraphDatabaseService |
getRawGraph() |
Neo4j2Vertex |
getVertex(Object id) |
Iterable<com.tinkerpop.blueprints.Vertex> |
getVertices() |
Iterable<com.tinkerpop.blueprints.Vertex> |
getVertices(String key,
Object value) |
com.tinkerpop.blueprints.CloseableIterable<com.tinkerpop.blueprints.Vertex> |
getVerticesByLabel(String label) |
com.tinkerpop.blueprints.CloseableIterable<com.tinkerpop.blueprints.Vertex> |
getVerticesByLabelKeyValue(String label,
String key,
Object value) |
com.tinkerpop.blueprints.CloseableIterable<com.tinkerpop.blueprints.Vertex> |
getVerticesByQuery(String query,
Map<String,Object> params,
String column)
Get an iterable of vertices via a Cypher query.
|
protected void |
init() |
com.tinkerpop.blueprints.GraphQuery |
query() |
com.tinkerpop.blueprints.CloseableIterable<Map<String,Object>> |
query(String query,
Map<String,Object> params) |
void |
removeEdge(com.tinkerpop.blueprints.Edge edge) |
void |
removeVertex(com.tinkerpop.blueprints.Vertex vertex) |
void |
rollback() |
void |
shutdown() |
void |
stopTransaction(com.tinkerpop.blueprints.TransactionalGraph.Conclusion conclusion) |
String |
toString() |
protected final ThreadLocal<org.neo4j.graphdb.Transaction> tx
protected final ThreadLocal<Boolean> checkElementsInTransaction
public Neo4j2Graph(String directory)
public Neo4j2Graph(org.neo4j.graphdb.GraphDatabaseService rawGraph)
public Neo4j2Graph(org.apache.commons.configuration.Configuration configuration)
protected boolean checkElementsInTransaction()
protected void init()
public Neo4j2Vertex addVertex(Object id)
addVertex
in interface com.tinkerpop.blueprints.Graph
public Neo4j2Vertex getVertex(Object id)
getVertex
in interface com.tinkerpop.blueprints.Graph
public Iterable<com.tinkerpop.blueprints.Vertex> getVertices()
The underlying Neo4j graph does not natively support this method within a transaction. If the graph is not currently in a transaction, then the operation runs efficiently and correctly. If the graph is currently in a transaction, please use setCheckElementsInTransaction() if it is necessary to ensure proper transactional semantics. Note that it is costly to check if an element is in the transaction.
getVertices
in interface com.tinkerpop.blueprints.Graph
public com.tinkerpop.blueprints.CloseableIterable<com.tinkerpop.blueprints.Vertex> getVerticesByLabel(String label)
public com.tinkerpop.blueprints.CloseableIterable<com.tinkerpop.blueprints.Vertex> getVerticesByLabelKeyValue(String label, String key, Object value)
public com.tinkerpop.blueprints.CloseableIterable<com.tinkerpop.blueprints.Vertex> getVerticesByQuery(String query, Map<String,Object> params, String column)
query
- the cypher queryparams
- a map of parameterscolumn
- the name of the column from which to extract the vertices. The column
must be a node or a class cast exception will be thrown when the
iterable is accessedpublic Iterable<com.tinkerpop.blueprints.Vertex> getVertices(String key, Object value)
getVertices
in interface com.tinkerpop.blueprints.Graph
public Iterable<com.tinkerpop.blueprints.Edge> getEdges()
The underlying Neo4j graph does not natively support this method within a transaction. If the graph is not currently in a transaction, then the operation runs efficiently and correctly. If the graph is currently in a transaction, please use setCheckElementsInTransaction() if it is necessary to ensure proper transactional semantics. Note that it is costly to check if an element is in the transaction.
getEdges
in interface com.tinkerpop.blueprints.Graph
public Iterable<com.tinkerpop.blueprints.Edge> getEdges(String key, Object value)
getEdges
in interface com.tinkerpop.blueprints.Graph
public void removeVertex(com.tinkerpop.blueprints.Vertex vertex)
removeVertex
in interface com.tinkerpop.blueprints.Graph
public Neo4j2Edge addEdge(Object id, com.tinkerpop.blueprints.Vertex outVertex, com.tinkerpop.blueprints.Vertex inVertex, String label)
addEdge
in interface com.tinkerpop.blueprints.Graph
public Neo4j2Edge getEdge(Object id)
getEdge
in interface com.tinkerpop.blueprints.Graph
public void removeEdge(com.tinkerpop.blueprints.Edge edge)
removeEdge
in interface com.tinkerpop.blueprints.Graph
public void stopTransaction(com.tinkerpop.blueprints.TransactionalGraph.Conclusion conclusion)
stopTransaction
in interface com.tinkerpop.blueprints.TransactionalGraph
public void commit()
commit
in interface com.tinkerpop.blueprints.TransactionalGraph
public void rollback()
rollback
in interface com.tinkerpop.blueprints.TransactionalGraph
public void shutdown()
shutdown
in interface com.tinkerpop.blueprints.Graph
public void autoStartTransaction(boolean forWrite)
public org.neo4j.graphdb.GraphDatabaseService getRawGraph()
getRawGraph
in interface com.tinkerpop.blueprints.MetaGraph<org.neo4j.graphdb.GraphDatabaseService>
public com.tinkerpop.blueprints.Features getFeatures()
getFeatures
in interface com.tinkerpop.blueprints.Graph
public com.tinkerpop.blueprints.GraphQuery query()
query
in interface com.tinkerpop.blueprints.Graph
Copyright © 2018 The European Holocaust Research Infrastructure (EHRI). All rights reserved.