You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "stephen mallette (JIRA)" <ji...@apache.org> on 2018/03/21 15:47:00 UTC

[jira] [Commented] (TINKERPOP-1924) Make meta-properties accessible via values(...)-step

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

stephen mallette commented on TINKERPOP-1924:
---------------------------------------------

Any reason that these these options to include id/label in your output are not sufficient?

{code}
gremlin> g.V().valueMap(true,'name')
==>[id:1,name:[marko],label:person]
==>[id:2,name:[vadas],label:person]
==>[id:3,name:[lop],label:software]
==>[id:4,name:[josh],label:person]
==>[id:5,name:[ripple],label:software]
==>[id:6,name:[peter],label:person]
gremlin> g.V().project('name','id').by('name').by(id)
==>[name:marko,id:1]
==>[name:vadas,id:2]
==>[name:lop,id:3]
==>[name:josh,id:4]
==>[name:ripple,id:5]
==>[name:peter,id:6]
{code}



> Make meta-properties accessible via values(...)-step
> ----------------------------------------------------
>
>                 Key: TINKERPOP-1924
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1924
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: structure
>    Affects Versions: 3.3.1
>            Reporter: Daniel Weber
>            Priority: Minor
>
> I'm currently running into a situation where I'd like to access meta-properties through the values(...)-method. Unfortunately, the signature of values() only takes strings, so this is not possible:
> {code:java}
> g.V().values(T.id)
> {code}
> Of course, there's the trivial workaround:
> {code:java}
> g.V().id()
> {code}
> However, I'd like to get values for multiple properties, so the workaround becomes ugly:
> {code:java}
> g.V().union(__.id(), __.values('key'))
> {code}
> That there would be no overload of values(...) supporting T-accessors is a bit odd. has(...) has an extra overload for T-accessors, property(...) allows arbitrary objects to be passed in as key. The valueMap-method allows including T-accessors in the returned map.
> Would it be possible to relax the signature of values(...) to take an arbitrary list of objects instead of property keys of type string? If the discussion here turns out in favor of such a relaxation, I could try to implement the change.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)