0

One of my vertex property got his properties (meta properties). But when i return all vertex properties i only get value of that property but not his properties also. Is that possible to do?

This is what i've tried:

g.V(rootID).Out()
.Has("name", splitedPath[0]).Repeat(Out().SimplePath()).Until(Has("name", splitedPath[splitedPath.Length - 1])).Out()
                   .Repeat(Out().SimplePath()).Until(Label().Is("Recording")).Has("name", Between(partialPropertyName, partialPropertyName + "a"))
                   .Project<object>("id", "label", "properties")
                         .By(Id())
                         .By(Label())
                         .By(ValueMap<string, object>())
                   .Dedup().ToList();
Hazaaa
  • 144
  • 2
  • 14

1 Answers1

2

You would need to Project() again in they "properties" By() (in some way) because ValueMap() does not return metaproperties. Here's an example in Java which does that via properties():

gremlin> g.V(1).project('id','label','properties').
......1>          by(id).
......2>          by(label).
......3>          by(properties().group().by(key).by(union(value(),valueMap()).fold()).fold())
==>[id:1,label:person,properties:[[name:[marko,[]],location:[san diego,[startTime:1997,endTime:2001],santa cruz,[startTime:2001,endTime:2004],brussels,[startTime:2004,endTime:2005],santa fe,[startTime:2005]]]]]
stephen mallette
  • 45,298
  • 5
  • 67
  • 135
  • Yap this works. But do you know why result of query is different in C# and in JS? I know because of types but still in C# i get a lot of IDictionary as result. – Hazaaa Apr 02 '19 at 09:20
  • i'm not sure i follow your question - perhaps you should ask a new question with some examples of the differences you're seeing. – stephen mallette Apr 02 '19 at 10:36
  • I think it's not worth it to ask new question because I don't know how to ask :) But is there any difference between returning results in gremlin 2.6 and 3.4? Maybe that's what i don't understand. – Hazaaa Apr 02 '19 at 11:27
  • 2.6? i'm not sure what version you're referring to. TinkerPop 2.x doesn't work with CosmosDB. there could be subtle differences between versions but again, without examples of what you're referring to, i'm not sure what you are seeing. – stephen mallette Apr 02 '19 at 12:27