Search in sources :

Example 1 with GraphSONIo

use of org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONIo in project sqlg by pietermartin.

the class BaseTest method loadGratefulDead.

protected void loadGratefulDead(SqlgGraph sqlgGraph) {
    Io.Builder<GraphSONIo> builder = GraphSONIo.build(GraphSONVersion.V3_0);
    final GraphReader reader = sqlgGraph.io(builder).reader().create();
    try (final InputStream stream = AbstractGremlinTest.class.getResourceAsStream("/grateful-dead-v3d0.json")) {
        reader.readGraph(stream, sqlgGraph);
    } catch (IOException e) {
        Assert.fail(e.getMessage());
    }
}
Also used : GraphReader(org.apache.tinkerpop.gremlin.structure.io.GraphReader) Io(org.apache.tinkerpop.gremlin.structure.io.Io) GraphSONIo(org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONIo) InputStream(java.io.InputStream) GraphSONIo(org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONIo) IOException(java.io.IOException)

Example 2 with GraphSONIo

use of org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONIo in project sqlg by pietermartin.

the class BaseTest method loadModern.

protected void loadModern(SqlgGraph sqlgGraph) {
    Io.Builder<GraphSONIo> builder = GraphSONIo.build(GraphSONVersion.V3_0);
    final GraphReader reader = sqlgGraph.io(builder).reader().create();
    try (final InputStream stream = AbstractGremlinTest.class.getResourceAsStream("/tinkerpop-modern-v3d0.json")) {
        reader.readGraph(stream, sqlgGraph);
    } catch (IOException e) {
        Assert.fail(e.getMessage());
    }
}
Also used : GraphReader(org.apache.tinkerpop.gremlin.structure.io.GraphReader) Io(org.apache.tinkerpop.gremlin.structure.io.Io) GraphSONIo(org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONIo) InputStream(java.io.InputStream) GraphSONIo(org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONIo) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 GraphReader (org.apache.tinkerpop.gremlin.structure.io.GraphReader)2 Io (org.apache.tinkerpop.gremlin.structure.io.Io)2 GraphSONIo (org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONIo)2