Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

sean.fennell_168661 avatar image
sean.fennell_168661 asked sean.fennell_168661 commented

Studio and .valueMap step can shadow property values

We have this issue in the classic graph and labs graph, but they manifest slightly differently

the label of the Element will override any properties name label on the element.


example:


given a vertex schema

schema.VertexLabel("Foo").primaryKey("ident", Text).property("label", Text)

and a vertex

g.addV("Foo").property("ident", "1@foo").property("label", "test").next()


using valueMap(true) //classic

or valueMap().with(WithOptions.tokens) // native

the label key in the resulting map is overridden from my property value, to the vertex label


g.V().has("Foo", "ident", "1@foo").valueMap().with(WithOptions.tokens).by(unfold()).next()

we get something like

{

"id": "Foo:1@foo#2",

"ident": "1@foo",

"label": "Foo"

}


If I omit the tokens I get the necessary data:

g.V().has("Foo", "ident", "1@foo").valueMap().by(unfold()).next()

{

"ident": "1@foo",

"label": "test"

}

Studio also does this when simply showing values. The label column is trumped by the Element label always.


Is there anything that can be done so that client properties do not get overridden by internal representations?

propertyshadowing
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

jlacefield avatar image
jlacefield answered sean.fennell_168661 commented

Sean, if you change the property name from label to something else, does this still occur?

2 comments Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Jonathan, Sorry for the late reply. I have not changed the label property name to something else because of time constraints. This would require a migration effort. Since we have to migrate to use new graph it may be a change worth making at that time.

0 Likes 0 ·

On a related note. I'm noticing different behavior with Labs than I previously saw, maybe I just overlooked it. The Vertex Label is NOT overriding the property label in Labs. It's actually the other way around. I get my label property value but lose access to the type of vertex.

0 Likes 0 ·
sean.fennell_168661 avatar image
sean.fennell_168661 answered Christine Arnould commented

No, it only impacts that field because they share the same name.

Is this a fundamental issue with tinkerpop or does it lie with datastax? We would have to treat this name as a restricted name and avoid it if it cannot be addressed.

We already have lots of data utilizing the "label" property name.

1 comment Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

@sean.fennell_168661 If in the answers provided, you have found the right answer - please mark it by clicking on "Accept" - see below

0 Likes 0 ·
jlacefield avatar image
jlacefield answered

Thanks for the confirmation ... let me check with an engineer on this and get back to you shortly

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

bryn.cooke_101029 avatar image
bryn.cooke_101029 answered bryn.cooke_101029 commented

Looks like you've discovered a bug. We've got an engineer looking at this now, and we'll get this in to the next labs release.

2 comments Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Thanks for sharing. How do you notify about new labs releases? Is there a thread I can follow or subscribe to?

1 Like 1 ·

I'll feed this back to the team that does the release and as you say perhaps we can have a single thread to follow.

0 Likes 0 ·