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

Make it easier to return more structure of graph elements

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Done
    • 3.3.8
    • 3.4.4, 3.5.0
    • process
    • None

    Description

      There are times where you want the structural elements of an Edge beyond id and label when you valueMap(true), which forces something like:

      gremlin> g.E(12).union(valueMap(true),
      ......1>               project('inV','outV','inVLabel','outVLabel').
      ......2>                 by(inV().id()).
      ......3>                 by(outV().id()).
      ......4>                 by(inV().label()).
      ......5>                 by(outV().label())).unfold().
      ......6>               group().
      ......7>                 by(keys).
      ......8>                 by(select(values))
      ==>[inV:3,id:12,inVLabel:software,weight:0.2,outVLabel:person,label:created,outV:6]
      

      We could continue to overload valueMap() and do stuff like with(adjacents) or other such things, but perhaps we should just leave that step alone since it is so widely used. Maybe we just need a new step? How about elementMap() which preserves the structure of any graph element, meaning:

      • Vertex - include id and label plus properties as single cardinality - multiproperties could be included using with()??)
      • Edge - include id, label, inVId, outVId, outVLabel, inVLabel (basically full reference elements for vertices plus properties
      • VertexProperty - include id and label plus properties

      If we had a step like that then the above would become:

      g.E(12).elementMap()
      

      other ways?

      I think the key thing here is that prior to "reference elements" users relied on the full Vertex or Edge to get all data and given that we don't have that anymore we need a way to allow users to easily convert the entire structure of a graph element to its Map counterpart.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: