A Tinkerpop 3 APIs: Differences and Other Notes
This appendix describes differences between several Blueprints 2.3 graph, vertex, and edge APIs and the Tinkerpop 3 equivalents, along with other notes about Tinkerpop 3 APIs.
- TinkerPop 3 Graph APIs
The following table lists several Blueprints 3 graph methods and the equivalent Tinkerpop 3 methods. - TinkerPop 3 Vertex APIs
The following table lists several Blueprints 3 vertex methods and the equivalent TinkerPop 3 methods. - TinkerPop 3 Edge APIs
The following table lists several Blueprints 3 edge methods and the equivalent TinkerPop 3 methods.
Parent topic: Supplementary Information for Property Graph Support
A.1 TinkerPop 3 Graph APIs
The following table lists several Blueprints 3 graph methods and the equivalent Tinkerpop 3 methods.
Table A-1 Blueprints 2.3 Graph Methods and TinkerPop 3 Equivalents
Blueprints 2.3 Method | TinkerPop 3 Method |
---|---|
com.tinkerpop.blueprints.Edge addEdge(long id, com.tinkerpop.blueprints.Vertex v, com.tinkerpop.blueprints.Vertex anotherv, String label) | org.apache.tinkerpop.gremlin.structure.Edge addEdge(long id, org.apache.tinkerpop.gremlin.structure.Vertex v, org.apache.tinkerpop.gremlin.structure.Vertex anotherv, String label) |
com.tinkerpop.blueprints.Vertex addVertex(long id) | org.apache.tinkerpop.gremlin.structure.Vertex addVertex(Object[] keyValues) |
OracleEdgeIterableImpl<com.tinkerpop.blueprints.Ege> getEdges() | OracleTinkerpop30EdgeIteratorImpl<org.apache.tinkerpop.gremlin.structure.Edge> edges(Object[] edgeIds) |
com.tinkerpop.blueprints.Features getFeatures() | org.apache.tinkerpop.gremlin.structure.Graph.Features features() |
OracleVertexIterableImpl<com.tinkerpop.blueprints.Vertex> getVertices() | OracleTinkerpop30VertexIteratorImpl<org.apache.tinkerpop.gremlin.structure.Vertex> vertices(Object[] vertexIds) |
The following TinkerPop 3 graph APIs had no Blueprints 2.3 equivalent:
- org.apache.tinkerpop.gremlin.structure.Vertex addVertex(String label): Add a vertex with the given label.
The following TinkerPop 3 graph APIs are either not supported or are supported with qualification or explanation:
- compute(): Not supported
- configuration(): Not supported.
- io(): Supported using own implementation. Input for import/export of graphml and graphson formats.
- traversal(): Supported based on Gremlin for Blueprints 2.3, limited support for Gremlin on Tinkerpop 3 implementation. Generate a traversal source that provides methods for spawning traversal instances.
- tx(): Not supported.
- variables(): Not supported.
- OracleTinkerpop30VertexIteratorImpl<org.apache.tinkerpop.gremlin.structure.Vertex> vertices(Object[] vertexIds): Supported, using own implementation. Return vertices given by one of the following options: If vertexIds is null, return all vertices in the graph. If vertexIds is array of IDs (long ) return subset of vertices. If vertexIds is array of Vertices, return subset of vertices.
Parent topic: Tinkerpop 3 APIs: Differences and Other Notes
A.2 TinkerPop 3 Vertex APIs
The following table lists several Blueprints 3 vertex methods and the equivalent TinkerPop 3 methods.
Table A-2 Blueprints 2.3 Vertex Methods and TinkerPop 3 Equivalents
Blueprints 2.3 Method | TinkerPop 3 Method |
---|---|
com.tinkerpop.blueprints.Vertex addEdge(String label, com.tinkerpop.blueprints.Vertex inVertex) | org.apache.tinkerpop.gremlin.structure.Edge addEdge(String label, org.apache.tinkerpop.gremlin.structure.Vertex inVertex, Object[] keyValues) |
Iterable<com.tinkerpop.blueprints.Edge> getEdges(com.tinkerpop.blueprints.Direction direction, String[] labels) | Iterator<org.apache.tinkerpop.gremlin.structure.Edge> edges(org.apache.tinkerpop.gremlin.structure.Direction direction, String[] edgeLabels) |
Graph getPropertyGraph() | Graph graph() |
Set<String> getPropertyKeys() | org.apache.tinkerpop.gremlin.structure.Graph.Features features() |
setProperty(String key, V value) | VertexProperty property(String key, Object value) |
Object getProperty(String key) | Object value(String key) |
Iterable<com.tinkerpop.blueprints.Vertex> vertices(com.tinkerpop.blueprints.Direction direction, String[] edgeLabels) | Iterator<org.apache.tinkerpop.gremlin.structure.Vertex> vertices(org.apache.tinkerpop.gremlin.structure.Direction direction, String[] edgeLabels) |
The following TinkerPop 3 vertex APIs have no Blueprints 2.3 equivalent:
- String label() Return the label of the vertex.
- Iterator<VertexProperty> properties(String[] propertyKeys) Return an iterator of properties for the given propertyKeys. If propertyKeys is null, all the properties are returned.
- VertexProperty property(String key) Return the property for the given key.
- VertexProperty property(Cardinality cardinality, String key, V value, Object[] keyValues) Only Cardinality.single is supported. Meta-properties are not supported. Set the given value to the given key.
- setLabel(String label) Set the label of the vertex to the provided value.
- Iterator<Object> values(String[] propertyKeys) Return an iterator of property values for the given propertyKeys. If propertyKeys is null, all the property values are returned.
Parent topic: Tinkerpop 3 APIs: Differences and Other Notes
A.3 TinkerPop 3 Edge APIs
The following table lists several Blueprints 3 edge methods and the equivalent TinkerPop 3 methods.
Table A-3 Blueprints 2.3 Edge Methods and TinkerPop 3 Equivalents
Blueprints 2.3 Method | Tinkerpop 3 Method |
---|---|
Graph getPropertyGraph() | Graph graph() |
com.tinkerpop.blueprints.Vertex getVertex(com.tinkerpop.blueprints.Direction direction) | org.apache.tinkerpop.gremlin.structure.Vertex inVertex() |
Set<String> getPropertyKeys() | Set<String> keys() |
String getLabel() | String label() |
com.tinkerpop.blueprints.Vertex getVertex(com.tinkerpop.blueprints.Direction direction) | org.apache.tinkerpop.gremlin.structure.Vertex outVertex() |
setProperty(String key, V value) | OracleProperty property(String key, Object value) |
Object getProperty(String key) | Object value(String key) |
Iterable<com.tinkerpop.blueprints.Vertex> vertices(com.tinkerpop.blueprints.Direction direction) | Iterator<org.apache.tinkerpop.gremlin.structure.Vertex> vertices(org.apache.tinkerpop.gremlin.structure.Direction direction) |
The following TinkerPop 3 edge APIs have no Blueprints 2.3 equivalent:
- Iterator<org.apache.tinkerpop.gremlin.structure.Vertex> bothVertices() Get the incoming and outgoing vertices of the edge
- OracleProperty property(String key) Return the property for the given key.
- Iterator<Property> properties(String[] propertyKeys) Return an iterator of properties for the given propertyKeys. If propertyKeys is null, all the properties are returned.
- Iterator<Object> values(String[] propertyKeys) Return an iterator of property values for the given propertyKeys. If propertyKeys is null, all the property values are returned.
Parent topic: Tinkerpop 3 APIs: Differences and Other Notes