public final class Neo4jGraph extends Object implements Graph, WrappedGraph<Neo4jGraphAPI>
Modifier and Type | Class and Description |
---|---|
class |
Neo4jGraph.Neo4jGraphFeatures |
Graph.Exceptions, Graph.Features, Graph.Hidden, Graph.OptIn, Graph.OptIns, Graph.OptOut, Graph.OptOuts, Graph.Variables
Modifier and Type | Field and Description |
---|---|
protected Neo4jGraphAPI |
baseGraph |
static String |
CONFIG_CONF |
static String |
CONFIG_DIRECTORY |
static String |
CONFIG_META_PROPERTIES |
static String |
CONFIG_MULTI_PROPERTIES |
protected BaseConfiguration |
configuration |
protected Graph.Features |
features |
static Logger |
LOGGER |
protected Neo4jTrait |
trait |
Modifier | Constructor and Description |
---|---|
protected |
Neo4jGraph(Configuration configuration) |
protected |
Neo4jGraph(Neo4jGraphAPI baseGraph,
Configuration configuration) |
Modifier and Type | Method and Description |
---|---|
Vertex |
addVertex(Object... keyValues)
Add a
Vertex to the graph given an optional series of key/value pairs. |
void |
close()
This implementation of
close will also close the current transaction on the thread, but it
is up to the caller to deal with dangling transactions in other threads prior to calling this method. |
GraphComputer |
compute()
Generate a
GraphComputer using the default engine of the underlying graph system. |
<C extends GraphComputer> |
compute(Class<C> graphComputerClass)
Declare the
GraphComputer to use for OLAP operations on the graph. |
Configuration |
configuration()
Get the
org.apache.commons.configuration.Configuration associated with the construction of this graph. |
<S,E> GraphTraversal<S,E> |
cypher(String query)
Execute the Cypher query and get the result set as a
GraphTraversal . |
<S,E> GraphTraversal<S,E> |
cypher(String query,
Map<String,Object> parameters)
Execute the Cypher query with provided parameters and get the result set as a
GraphTraversal . |
Iterator<Edge> |
edges(Object... edgeIds)
|
Graph.Features |
features()
Gets the
Graph.Features exposed by the underlying Graph implementation. |
Neo4jGraphAPI |
getBaseGraph() |
Neo4jTrait |
getTrait() |
static Neo4jGraph |
open(Configuration configuration)
Open a new
Neo4jGraph instance. |
static Neo4jGraph |
open(Neo4jGraphAPI baseGraph)
Construct a Neo4jGraph instance using an existing Neo4j raw instance.
|
String |
toString() |
Transaction |
tx()
Configure and control the transactions for those graphs that support this feature.
|
Graph.Variables |
variables()
A collection of global
Graph.Variables associated with the graph. |
Iterator<Vertex> |
vertices(Object... vertexIds)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addVertex, io, traversal, traversal
getHostingVertex
public static final Logger LOGGER
protected Graph.Features features
protected Neo4jGraphAPI baseGraph
protected BaseConfiguration configuration
public static final String CONFIG_DIRECTORY
public static final String CONFIG_CONF
public static final String CONFIG_META_PROPERTIES
public static final String CONFIG_MULTI_PROPERTIES
protected Neo4jTrait trait
protected Neo4jGraph(Neo4jGraphAPI baseGraph, Configuration configuration)
protected Neo4jGraph(Configuration configuration)
public static Neo4jGraph open(Configuration configuration)
Neo4jGraph
instance.configuration
- the configuration for the instanceGraph
public static Neo4jGraph open(Neo4jGraphAPI baseGraph)
public Iterator<Vertex> vertices(Object... vertexIds)
Graph
Vertex
objects in this graph with the provided vertex ids or Vertex
objects themselves.
If no ids are provided, get all vertices. Note that a vertex identifier does not need to correspond to the
actual id used in the graph. It needs to be a bit more flexible than that in that given the
Graph.Features
around id support, multiple arguments might be applicable here.
If the graph return true
for Graph.Features.ElementFeatures.supportsNumericIds()
then it should support
filters as with:
true
for Graph.Features.ElementFeatures.supportsCustomIds()
()} then it should support
filters as with:
true
for Graph.Features.ElementFeatures.supportsAnyIds()
()} then it should support
filters as with:
true
for Graph.Features.ElementFeatures.supportsStringIds()
()} then it should support
filters as with:
true
for Graph.Features.ElementFeatures.supportsStringIds()
()} then it should support
filters as with:
public Iterator<Edge> edges(Object... edgeIds)
Graph
Edge
objects in this graph with the provided edge ids or Edge
objects. If no ids are
provided, get all edges. Note that an edge identifier does not need to correspond to the actual id used in the
graph. It needs to be a bit more flexible than that in that given the Graph.Features
around id support,
multiple arguments might be applicable here.
If the graph return true
for Graph.Features.ElementFeatures.supportsNumericIds()
then it should support
filters as with:
true
for Graph.Features.ElementFeatures.supportsCustomIds()
()} then it should support
filters as with:
true
for Graph.Features.ElementFeatures.supportsAnyIds()
()} then it should support
filters as with:
true
for Graph.Features.ElementFeatures.supportsStringIds()
()} then it should support
filters as with:
public Neo4jTrait getTrait()
public <C extends GraphComputer> C compute(Class<C> graphComputerClass)
Graph
GraphComputer
to use for OLAP operations on the graph.
If the graph does not support graph computer then an UnsupportedOperationException
is thrown.public GraphComputer compute()
Graph
GraphComputer
using the default engine of the underlying graph system.
This is a shorthand method for the more involved method that uses Graph.compute(Class)
.public Transaction tx()
Graph
Transaction
in the TinkerPop context is a
transaction "factory" or "controller" that helps manage transactions owned by the underlying graph database.public Graph.Variables variables()
Graph
Graph.Variables
associated with the graph.
Variables are used for storing metadata about the graph.public Configuration configuration()
Graph
org.apache.commons.configuration.Configuration
associated with the construction of this graph.
Whatever configuration was passed to GraphFactory#open(org.apache.commons.configuration.Configuration)
is what should be returned by this method.configuration
in interface Graph
public void close() throws Exception
close
will also close the current transaction on the thread, but it
is up to the caller to deal with dangling transactions in other threads prior to calling this method.close
in interface AutoCloseable
close
in interface Graph
Exception
public Graph.Features features()
Graph
Graph.Features
exposed by the underlying Graph
implementation.public Neo4jGraphAPI getBaseGraph()
getBaseGraph
in interface WrappedGraph<Neo4jGraphAPI>
public <S,E> GraphTraversal<S,E> cypher(String query)
GraphTraversal
.query
- the Cypher query to executepublic <S,E> GraphTraversal<S,E> cypher(String query, Map<String,Object> parameters)
GraphTraversal
.query
- the Cypher query to executeparameters
- the parameters of the Cypher queryCopyright © 2013–2018 Apache Software Foundation. All rights reserved.