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

ProjectMap: For the Love of Die Faterland

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Implemented
    • 3.1.1-incubating
    • 3.2.0-incubating
    • process
    • None

    Description

      gremlin> g.V(1).out("knows").
                 project("a","b").by("name").by(outE().count())
      ==>{a:josh, b:2}
      ==>{a:vadas, b:0}
      

      Its like select() by inverted – thus, project()! Moreover, its a generalization of valueMap() and propertyMap.

      public class ProjectStep<S,E> extends MapStep<S,Map<String,E>> {
        TraversalRing<S,E> ...
        String... keys;  
      
         public Map<String,E> map(final Traverser.Admin<S> traverser) {
            final Map<String,E> result = new HashMap<>(keys.length);
            for(final String key : keys) {
              result.put(key, TraversalUtil.apply(traverser, traversalRing.next());
            }
            traversalRing.reset();
            return result;
          }
      }
      

      cc/ Mein Obergruppenführer mbroecheler.

      Attachments

        Activity

          People

            okram Marko A. Rodriguez
            okram Marko A. Rodriguez
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: