Class OGraphSONUtility
java.lang.Object
com.orientechnologies.orient.graph.graphml.OGraphSONUtility
Helps write individual graph elements to TinkerPop JSON format known as GraphSON.
- Author:
- Stephen Mallette (http://stephen.genoprime.com), Luca Garulli (l.garulli--(at)--orientdb.com)
-
Constructor Summary
ConstructorsConstructorDescriptionOGraphSONUtility(com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory) A GraphSONUtiltiy that includes all properties of vertices and edges.OGraphSONUtility(com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, com.tinkerpop.blueprints.util.io.graphson.ElementPropertyConfig config) OGraphSONUtility(com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, Set<String> vertexPropertyKeys, Set<String> edgePropertyKeys) A GraphSONUtility that includes the specified properties. -
Method Summary
Modifier and TypeMethodDescriptioncom.tinkerpop.blueprints.EdgeedgeFromJson(com.fasterxml.jackson.databind.JsonNode json, com.tinkerpop.blueprints.Vertex out, com.tinkerpop.blueprints.Vertex in) Creates an edge from GraphSON using settings supplied in the constructor.static com.tinkerpop.blueprints.EdgeedgeFromJson(com.fasterxml.jackson.databind.JsonNode json, com.tinkerpop.blueprints.Vertex out, com.tinkerpop.blueprints.Vertex in, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, Set<String> propertyKeys) Reads an individual Edge from JSON.com.tinkerpop.blueprints.EdgeedgeFromJson(InputStream json, com.tinkerpop.blueprints.Vertex out, com.tinkerpop.blueprints.Vertex in) Creates an edge from GraphSON using settings supplied in the constructor.static com.tinkerpop.blueprints.EdgeedgeFromJson(InputStream json, com.tinkerpop.blueprints.Vertex out, com.tinkerpop.blueprints.Vertex in, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, Set<String> propertyKeys) Reads an individual Edge from JSON.com.tinkerpop.blueprints.EdgeedgeFromJson(String json, com.tinkerpop.blueprints.Vertex out, com.tinkerpop.blueprints.Vertex in) Creates an edge from GraphSON using settings supplied in the constructor.static com.tinkerpop.blueprints.EdgeedgeFromJson(String json, com.tinkerpop.blueprints.Vertex out, com.tinkerpop.blueprints.Vertex in, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, Set<String> propertyKeys) Reads an individual Edge from JSON.com.tinkerpop.blueprints.EdgeedgeFromJson(org.codehaus.jettison.json.JSONObject json, com.tinkerpop.blueprints.Vertex out, com.tinkerpop.blueprints.Vertex in) Creates an edge from GraphSON using settings supplied in the constructor.static com.tinkerpop.blueprints.EdgeedgeFromJson(org.codehaus.jettison.json.JSONObject json, com.tinkerpop.blueprints.Vertex out, com.tinkerpop.blueprints.Vertex in, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, Set<String> propertyKeys) Reads an individual Edge from JSON.org.codehaus.jettison.json.JSONObjectjsonFromElement(com.tinkerpop.blueprints.Element element) Creates GraphSON for a single graph element.com.fasterxml.jackson.databind.node.ObjectNodeobjectNodeFromElement(com.tinkerpop.blueprints.Element element) Creates GraphSON for a single graph element.com.tinkerpop.blueprints.VertexvertexFromJson(com.fasterxml.jackson.databind.JsonNode json) Creates a vertex from GraphSON using settings supplied in the constructor.static com.tinkerpop.blueprints.VertexvertexFromJson(com.fasterxml.jackson.databind.JsonNode json, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, Set<String> propertyKeys) Reads an individual Vertex from JSON.com.tinkerpop.blueprints.VertexvertexFromJson(InputStream json) Creates a vertex from GraphSON using settings supplied in the constructor.static com.tinkerpop.blueprints.VertexvertexFromJson(InputStream json, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, Set<String> propertyKeys) Reads an individual Vertex from JSON.com.tinkerpop.blueprints.VertexvertexFromJson(String json) Creates a vertex from GraphSON using settings supplied in the constructor.static com.tinkerpop.blueprints.VertexvertexFromJson(String json, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, Set<String> propertyKeys) Reads an individual Vertex from JSON.com.tinkerpop.blueprints.VertexvertexFromJson(org.codehaus.jettison.json.JSONObject json) Creates a vertex from GraphSON using settings supplied in the constructor.static com.tinkerpop.blueprints.VertexvertexFromJson(org.codehaus.jettison.json.JSONObject json, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, Set<String> propertyKeys) Reads an individual Vertex from JSON.
-
Constructor Details
-
OGraphSONUtility
public OGraphSONUtility(com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory) A GraphSONUtiltiy that includes all properties of vertices and edges. -
OGraphSONUtility
public OGraphSONUtility(com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, Set<String> vertexPropertyKeys, Set<String> edgePropertyKeys) A GraphSONUtility that includes the specified properties. -
OGraphSONUtility
public OGraphSONUtility(com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, com.tinkerpop.blueprints.util.io.graphson.ElementPropertyConfig config)
-
-
Method Details
-
vertexFromJson
public com.tinkerpop.blueprints.Vertex vertexFromJson(org.codehaus.jettison.json.JSONObject json) throws IOException Creates a vertex from GraphSON using settings supplied in the constructor.- Throws:
IOException
-
vertexFromJson
Creates a vertex from GraphSON using settings supplied in the constructor.- Throws:
IOException
-
vertexFromJson
Creates a vertex from GraphSON using settings supplied in the constructor.- Throws:
IOException
-
vertexFromJson
public com.tinkerpop.blueprints.Vertex vertexFromJson(com.fasterxml.jackson.databind.JsonNode json) throws IOException Creates a vertex from GraphSON using settings supplied in the constructor.- Throws:
IOException
-
edgeFromJson
public com.tinkerpop.blueprints.Edge edgeFromJson(org.codehaus.jettison.json.JSONObject json, com.tinkerpop.blueprints.Vertex out, com.tinkerpop.blueprints.Vertex in) throws IOException Creates an edge from GraphSON using settings supplied in the constructor.- Throws:
IOException
-
edgeFromJson
public com.tinkerpop.blueprints.Edge edgeFromJson(String json, com.tinkerpop.blueprints.Vertex out, com.tinkerpop.blueprints.Vertex in) throws IOException Creates an edge from GraphSON using settings supplied in the constructor.- Throws:
IOException
-
edgeFromJson
public com.tinkerpop.blueprints.Edge edgeFromJson(InputStream json, com.tinkerpop.blueprints.Vertex out, com.tinkerpop.blueprints.Vertex in) throws IOException Creates an edge from GraphSON using settings supplied in the constructor.- Throws:
IOException
-
edgeFromJson
public com.tinkerpop.blueprints.Edge edgeFromJson(com.fasterxml.jackson.databind.JsonNode json, com.tinkerpop.blueprints.Vertex out, com.tinkerpop.blueprints.Vertex in) throws IOException Creates an edge from GraphSON using settings supplied in the constructor.- Throws:
IOException
-
jsonFromElement
public org.codehaus.jettison.json.JSONObject jsonFromElement(com.tinkerpop.blueprints.Element element) throws org.codehaus.jettison.json.JSONException Creates GraphSON for a single graph element.- Throws:
org.codehaus.jettison.json.JSONException
-
objectNodeFromElement
public com.fasterxml.jackson.databind.node.ObjectNode objectNodeFromElement(com.tinkerpop.blueprints.Element element) Creates GraphSON for a single graph element. -
vertexFromJson
public static com.tinkerpop.blueprints.Vertex vertexFromJson(org.codehaus.jettison.json.JSONObject json, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, Set<String> propertyKeys) throws IOException Reads an individual Vertex from JSON. The vertex must match the accepted GraphSON format.- Parameters:
json- a single vertex in GraphSON format as Jettison JSONObjectfactory- the factory responsible for constructing graph elementsmode- the mode of the GraphSONpropertyKeys- a list of keys to include on reading of element properties- Throws:
IOException
-
vertexFromJson
public static com.tinkerpop.blueprints.Vertex vertexFromJson(String json, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, Set<String> propertyKeys) throws IOException Reads an individual Vertex from JSON. The vertex must match the accepted GraphSON format.- Parameters:
json- a single vertex in GraphSON format as a String.factory- the factory responsible for constructing graph elementsmode- the mode of the GraphSONpropertyKeys- a list of keys to include on reading of element properties- Throws:
IOException
-
vertexFromJson
public static com.tinkerpop.blueprints.Vertex vertexFromJson(InputStream json, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, Set<String> propertyKeys) throws IOException Reads an individual Vertex from JSON. The vertex must match the accepted GraphSON format.- Parameters:
json- a single vertex in GraphSON format as an InputStream.factory- the factory responsible for constructing graph elementsmode- the mode of the GraphSONpropertyKeys- a list of keys to include on reading of element properties- Throws:
IOException
-
vertexFromJson
public static com.tinkerpop.blueprints.Vertex vertexFromJson(com.fasterxml.jackson.databind.JsonNode json, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, Set<String> propertyKeys) throws IOException Reads an individual Vertex from JSON. The vertex must match the accepted GraphSON format.- Parameters:
json- a single vertex in GraphSON format as Jackson JsonNodefactory- the factory responsible for constructing graph elementsmode- the mode of the GraphSONpropertyKeys- a list of keys to include on reading of element properties- Throws:
IOException
-
edgeFromJson
public static com.tinkerpop.blueprints.Edge edgeFromJson(org.codehaus.jettison.json.JSONObject json, com.tinkerpop.blueprints.Vertex out, com.tinkerpop.blueprints.Vertex in, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, Set<String> propertyKeys) throws IOException Reads an individual Edge from JSON. The edge must match the accepted GraphSON format.- Parameters:
json- a single edge in GraphSON format as a Jettison JSONObjectfactory- the factory responsible for constructing graph elementsmode- the mode of the GraphSONpropertyKeys- a list of keys to include when reading of element properties- Throws:
IOException
-
edgeFromJson
public static com.tinkerpop.blueprints.Edge edgeFromJson(String json, com.tinkerpop.blueprints.Vertex out, com.tinkerpop.blueprints.Vertex in, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, Set<String> propertyKeys) throws IOException Reads an individual Edge from JSON. The edge must match the accepted GraphSON format.- Parameters:
json- a single edge in GraphSON format as a Stringfactory- the factory responsible for constructing graph elementsmode- the mode of the GraphSONpropertyKeys- a list of keys to include when reading of element properties- Throws:
IOException
-
edgeFromJson
public static com.tinkerpop.blueprints.Edge edgeFromJson(InputStream json, com.tinkerpop.blueprints.Vertex out, com.tinkerpop.blueprints.Vertex in, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, Set<String> propertyKeys) throws IOException Reads an individual Edge from JSON. The edge must match the accepted GraphSON format.- Parameters:
json- a single edge in GraphSON format as an InputStreamfactory- the factory responsible for constructing graph elementsmode- the mode of the GraphSONpropertyKeys- a list of keys to include when reading of element properties- Throws:
IOException
-
edgeFromJson
public static com.tinkerpop.blueprints.Edge edgeFromJson(com.fasterxml.jackson.databind.JsonNode json, com.tinkerpop.blueprints.Vertex out, com.tinkerpop.blueprints.Vertex in, com.tinkerpop.blueprints.util.io.graphson.ElementFactory factory, com.tinkerpop.blueprints.util.io.graphson.GraphSONMode mode, Set<String> propertyKeys) throws IOException Reads an individual Edge from JSON. The edge must match the accepted GraphSON format.- Parameters:
json- a single edge in GraphSON format as a Jackson JsonNodefactory- the factory responsible for constructing graph elementsmode- the mode of the GraphSONpropertyKeys- a list of keys to include when reading of element properties- Throws:
IOException
-