You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/09/09 18:27:00 UTC

[jira] [Commented] (TINKERPOP-2284) Make it easier to return more structure of graph elements

    [ https://issues.apache.org/jira/browse/TINKERPOP-2284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16925982#comment-16925982 ] 

ASF GitHub Bot commented on TINKERPOP-2284:
-------------------------------------------

spmallette commented on pull request #1189: TINKERPOP-2284 Added elementMap() step
URL: https://github.com/apache/tinkerpop/pull/1189
 
 
   https://issues.apache.org/jira/browse/TINKERPOP-2284
   
   Given that we only return reference objects for graph elements now, there is a lot of extra `project()`/`valueMap()` work to do for the simple and common need to return all the structure of a graph element. `elementMap()` simplifies all that to a single step without a ton of options and added features.
   
   All tests pass with `docker/build.sh -t -i`
   
   VOTE +1
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Make it easier to return more structure of graph elements
> ---------------------------------------------------------
>
>                 Key: TINKERPOP-2284
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2284
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.3.8
>            Reporter: stephen mallette
>            Priority: Major
>
> There are times where you want the structural elements of an {{Edge}} beyond {{id}} and {{label}} when you {{valueMap(true)}}, which forces something like:
> {code}
> 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]
> {code}
> 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:
> {code}
> g.E(12).elementMap()
> {code}
> 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.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)