public interface Graph extends AutoCloseable, Host
Graph is a container object for a collection of Vertex, Edge, VertexProperty,
 and Property objects.| Modifier and Type | Interface and Description | 
|---|---|
| static class  | Graph.ExceptionsCommon exceptions to use with a graph. | 
| static interface  | Graph.FeaturesAn interface that represents the capabilities of a  Graphimplementation. | 
| static class  | Graph.HiddenThis should only be used by providers to create keys, labels, etc. | 
| static interface  | Graph.OptInDefines the test suite that the implementer has decided to support and represents publicly as "passing". | 
| static interface  | Graph.OptInsHolds a collection of  Graph.OptInenabling multipleGraph.OptInto be applied to a
 single suite. | 
| static interface  | Graph.OptOutDefines a test in the suite that the implementer does not want to run. | 
| static interface  | Graph.OptOutsHolds a collection of  Graph.OptOutenabling multipleGraph.OptOutto be applied to a
 single suite. | 
| static interface  | Graph.VariablesGraph variables are a set of key/value pairs associated with the graph. | 
| Modifier and Type | Field and Description | 
|---|---|
| static String | GRAPHConfiguration key used by  GraphFactory} to determine which graph to instantiate. | 
| Modifier and Type | Method and Description | 
|---|---|
| Vertex | addVertex(Object... keyValues)Add a  Vertexto the graph given an optional series of key/value pairs. | 
| default Vertex | addVertex(String label)Add a  Vertexto the graph with provided vertex label. | 
| void | close()Closing a  Graphis equivalent to "shutdown" and implies that no further operations can be executed on
 the instance. | 
| GraphComputer | compute()Generate a  GraphComputerusing the default engine of the underlying graph system. | 
| <C extends GraphComputer> | compute(Class<C> graphComputerClass)Declare the  GraphComputerto use for OLAP operations on the graph. | 
| Configuration | configuration()Get the  org.apache.commons.configuration.Configurationassociated with the construction of this graph. | 
| Iterator<Edge> | edges(Object... edgeIds) | 
| default Graph.Features | features()Gets the  Graph.Featuresexposed by the underlyingGraphimplementation. | 
| default <I extends Io> | io(Io.Builder<I> builder)Deprecated. 
 As of release 3.4.0, replaced by  GraphTraversalSource.io(String). | 
| default GraphTraversalSource | traversal()Generate a reusable  GraphTraversalSourceinstance. | 
| default <C extends TraversalSource> | traversal(Class<C> traversalSourceClass)Generate a  TraversalSourceusing the specifiedTraversalSourceclass. | 
| Transaction | tx()Configure and control the transactions for those graphs that support this feature. | 
| Graph.Variables | variables()A collection of global  Graph.Variablesassociated with the graph. | 
| Iterator<Vertex> | vertices(Object... vertexIds) | 
getHostingVertexstatic final String GRAPH
GraphFactory} to determine which graph to instantiate.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
GraphComputer using the default engine of the underlying graph system.
 This is a shorthand method for the more involved method that uses compute(Class).IllegalArgumentException - if there is no default graph computerdefault <C extends TraversalSource> C traversal(Class<C> traversalSourceClass)
TraversalSource using the specified TraversalSource class.
 The reusable TraversalSource provides methods for spawning Traversal instances.C - The traversal source classtraversalSourceClass - The traversal source classdefault GraphTraversalSource traversal()
GraphTraversalSource instance.
 The GraphTraversalSource provides methods for creating
 GraphTraversal instances.Iterator<Vertex> vertices(Object... vertexIds)
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:
 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 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:
 edgeIds - the ids of the edges to getIterator of edges that match the provided edge idsTransaction tx()
Transaction in the TinkerPop context is a
 transaction "factory" or "controller" that helps manage transactions owned by the underlying graph database.void close()
    throws Exception
Graph is equivalent to "shutdown" and implies that no further operations can be executed on
 the instance.  Users should consult the documentation of the underlying graph database implementation for what
 this "shutdown" will mean in general and, if supported, how open transactions are handled.  It will typically
 be the end user's responsibility to synchronize the thread that calls close() with other threads that
 are accessing open transactions. In other words, be sure that all work performed on the Graph instance
 is complete prior to calling this method.
 
 TinkerPop does not enforce any particular semantics with respect to "shutdown". It is up to the graph provider
 to decide what this method will do.close in interface AutoCloseableException@Deprecated default <I extends Io> I io(Io.Builder<I> builder)
GraphTraversalSource.io(String).Io implementation for reading and writing the Graph and other data.
 End-users will "select" the Io implementation that they want to use by supplying the
 Io.Builder that constructs it.  In this way, Graph
 vendors can supply their IoRegistry to that builder thus allowing for custom serializers to be
 auto-configured into the Io instance.  Registering custom serializers is particularly useful for those
 graphs that have complex types for Element identifiers.
 
 For those graphs that do not need to register any custom serializers, the default implementation should suffice.
 If the default is overridden, take care to register the current graph via the
 Io.Builder.graph(Graph) method.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 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–2019 Apache Software Foundation. All rights reserved.