public interface Graph extends AutoCloseable
Graph
is a container object for a collection of Vertex
, Edge
, VertexProperty
,
and Property
objects.Modifier and Type | Interface and Description |
---|---|
static class |
Graph.Exceptions
Common exceptions to use with a graph.
|
static interface |
Graph.Features
An interface that represents the capabilities of a
Graph implementation. |
static interface |
Graph.Helper
Defines a method as a "helper method".
|
static class |
Graph.Hidden
This should only be used by vendors to create keys, labels, etc.
|
static interface |
Graph.Io
Provides access to functions related to reading and writing graph data.
|
static interface |
Graph.OptIn
Defines the test suite that the implementer has decided to support and represents publicly as "passing".
|
static interface |
Graph.OptIns
Holds a collection of
Graph.OptIn enabling multiple Graph.OptIn to be applied to a
single suite. |
static interface |
Graph.OptOut
Defines a test in the suite that the implementer does not want to run.
|
static interface |
Graph.OptOuts
Holds a collection of
Graph.OptOut enabling multiple Graph.OptOut to be applied to a
single suite. |
static interface |
Graph.Variables
Graph variables are a set of key/value pairs associated with the graph.The keys are String and the values
are Objects.
|
Modifier and Type | Method and Description |
---|---|
Vertex |
addVertex(Object... keyValues)
Add a
Vertex to the graph given an optional series of key/value pairs. |
default Vertex |
addVertex(String label)
Add a
Vertex to the graph with provided vertex label. |
GraphComputer |
compute() |
<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. |
Iterator<Edge> |
edges(Object... edgeIds)
Get the
Edge objects in this graph with the provided edge ids. |
static <G extends Graph> |
empty(Class<G> graphClass) |
default Graph.Features |
features()
Gets the
Graph.Features exposed by the underlying Graph implementation. |
default Graph.Io |
io()
Provide input/output methods for serializing graph data.
|
default GraphTraversalSource |
traversal() |
default <C extends TraversalSource> |
traversal(TraversalSource.Builder<C> contextBuilder) |
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)
Get the
Vertex objects in this graph with the provided vertex ids. |
close
static final String GRAPH
Vertex addVertex(Object... keyValues)
Vertex
to the graph given an optional series of key/value pairs. These key/values
must be provided in an even number where the odd numbered arguments are String
property keys and the
even numbered arguments are the related property values.keyValues
- The key/value pairs to turn into vertex propertiesdefault Vertex addVertex(String label)
Vertex
to the graph with provided vertex label.label
- the label of the vertex<C extends GraphComputer> C compute(Class<C> graphComputerClass) throws IllegalArgumentException
GraphComputer
to use for OLAP operations on the graph.
If the graph does not support graph computer then an UnsupportedOperationException
is thrown.graphComputerClass
- The graph computer class to use.IllegalArgumentException
- if the provided GraphComputer
class is not supported.GraphComputer compute() throws IllegalArgumentException
IllegalArgumentException
default <C extends TraversalSource> C traversal(TraversalSource.Builder<C> contextBuilder)
default GraphTraversalSource traversal()
Iterator<Vertex> vertices(Object... vertexIds)
Vertex
objects in this graph with the provided vertex ids. If no ids are provided, get all vertices.vertexIds
- the ids of the vertices to getIterator
of vertices that match the provided vertex idsIterator<Edge> edges(Object... edgeIds)
Edge
objects in this graph with the provided edge ids. If no ids are provided, get all edges.edgeIds
- the ids of the edges to getIterator
of edges that match the provided edge idsTransaction tx()
default Graph.Io io()
Graph.Variables variables()
Graph.Variables
associated with the graph.
Variables are used for storing metadata about the graph.Configuration configuration()
org.apache.commons.configuration.Configuration
associated with the construction of this graph.
Whatever configuration was passed to org.apache.tinkerpop.gremlin.structure.util.GraphFactory#open(org.apache.commons.configuration.Configuration)
is what should be returned by this method.default Graph.Features features()
Graph.Features
exposed by the underlying Graph
implementation.Copyright © 2013–2015 Apache Software Foundation. All rights reserved.