Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-728

Improve Remote Graph Object Treatment in Console

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Implemented
    • 3.0.0-incubating
    • 3.1.0-incubating
    • console, io, tinkergraph
    • None

    Description

      The current method of moving an entire Graph from server to console over :remote looks like this:

      gremlin> :import org.apache.tinkerpop.gremlin.structure.util.star.*
      ==>groovy.grape.Grape, org.apache.commons.configuration.*, .... , org.apache.tinkerpop.gremlin.structure.util.star.*
      gremlin> :remote connect tinkerpop.server conf/remote-objects.yaml
      ==>Connected - localhost/127.0.0.1:8182
      gremlin> :> g.V().map{StarGraph.of(it.get())}  // assume this is the "subgraph" - the key is to convert Vertex to StarGraph
      ==>stargraph[starOf:v[1]]
      ==>stargraph[starOf:v[2]]
      ==>stargraph[starOf:v[3]]
      ==>stargraph[starOf:v[4]]
      ==>stargraph[starOf:v[5]]
      ==>stargraph[starOf:v[6]]
      gremlin> graph = TinkerGraph.open()
      ==>tinkergraph[vertices:0 edges:0]
      gremlin> g = graph.traversal()
      ==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
      gremlin> result.each{it.get(StarGraph).getStarVertex().edges(OUT).each{e->e.attach(Attachable.Method.getOrCreate(graph))}}
      ==>result{object=stargraph[starOf:v[1]] class=org.apache.tinkerpop.gremlin.structure.util.star.StarGraph}
      ==>result{object=stargraph[starOf:v[2]] class=org.apache.tinkerpop.gremlin.structure.util.star.StarGraph}
      ==>result{object=stargraph[starOf:v[3]] class=org.apache.tinkerpop.gremlin.structure.util.star.StarGraph}
      ==>result{object=stargraph[starOf:v[4]] class=org.apache.tinkerpop.gremlin.structure.util.star.StarGraph}
      ==>result{object=stargraph[starOf:v[5]] class=org.apache.tinkerpop.gremlin.structure.util.star.StarGraph}
      ==>result{object=stargraph[starOf:v[6]] class=org.apache.tinkerpop.gremlin.structure.util.star.StarGraph}
      gremlin> graph
      ==>tinkergraph[vertices:6 edges:6]
      

      Would be nice if this was a bit more streamlined.

      Attachments

        Activity

          People

            spmallette Stephen Mallette
            spmallette Stephen Mallette
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: