[ 
https://issues.apache.org/jira/browse/TINKERPOP-2280?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

stephen mallette updated TINKERPOP-2280:
----------------------------------------
    Description: 
It's not a great practice but we often see folks overloading "label" and "id" 
as property keys on elements. The problem here is that `valueMap()` will tend 
to end up looking like this:

{code}
gremlin> g.V().has('label').valueMap(true)
==>[id:13,label:[thing],label:person]
{code}

There was an idea to alter the {{toString()}} representation of {{T}} values 
but that didn't seem right after it was done and it's hard to say what 
implications that would have to users. Who knows how {{T}} was used at this 
point. 

[~dkuppitz] suggested that this issue was akin to 
{{EdgeLabelVerificationStrategy}} which is a much less intrusive way to deal 
with the problem, especially going back to 3.3.x. For 3.5.0 we could even 
install this strategy by default as we expected to do with 
{{EdgeLabelVerificationStrategy}}

  was:
It's not a great practice but we often see folks overloading "label" and "id" 
as property keys on elements. The problem here is that `valueMap()` will tend 
to end up looking like this:

{code}
gremlin> g.V().has('label').valueMap(true)
==>[id:13,label:[thing],label:person]
{code}

The {{toString()}} representation is confusing as you can't really tell what's 
an {{T}} instance in the keys and what is not. If we alter {{toString()}} to 
include the {{T}} we get:

{code}
gremlin> g.V().has('label').valueMap(true)
==>[T.id:13,label:[thing],T.label:person]
{code}

It's not as pretty as before (assuming no overloading) but at least we 
eliminate confusions folks used to have with this. I don't think this is a 
breaking change really because most folks won't be operating on the 
{{toString()}} value of a {{Map}}. They will be accessing this {{Map}} with a 
{{T}} instance.


> Make toString() of T less susceptible to confusion with property overloads
> --------------------------------------------------------------------------
>
>                 Key: TINKERPOP-2280
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2280
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: structure
>    Affects Versions: 3.3.8
>            Reporter: stephen mallette
>            Assignee: stephen mallette
>            Priority: Major
>
> It's not a great practice but we often see folks overloading "label" and "id" 
> as property keys on elements. The problem here is that `valueMap()` will tend 
> to end up looking like this:
> {code}
> gremlin> g.V().has('label').valueMap(true)
> ==>[id:13,label:[thing],label:person]
> {code}
> There was an idea to alter the {{toString()}} representation of {{T}} values 
> but that didn't seem right after it was done and it's hard to say what 
> implications that would have to users. Who knows how {{T}} was used at this 
> point. 
> [~dkuppitz] suggested that this issue was akin to 
> {{EdgeLabelVerificationStrategy}} which is a much less intrusive way to deal 
> with the problem, especially going back to 3.3.x. For 3.5.0 we could even 
> install this strategy by default as we expected to do with 
> {{EdgeLabelVerificationStrategy}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to