0

I have a gremlin server in which data is pushed by some c# code (shown below) It basically iterates over the properties of a class and adds those properties to the graph.

I communicate with this gremlin server using gremlin in javascript. When I do g.V().ToList then I get all the vertices as an array of json objects with id and label. however property is undefined :

  Vertex { id: 50543, label: 'asdad', properties: undefined },
  Vertex { id: 51569, label: 'b', properties: undefined },
  Vertex { id: 50547, label: 'c', properties: undefined },
  Vertex { id: 50551, label: 'd', properties: undefined },
  Vertex { id: 50555, label: 'e', properties: undefined },
  Vertex { id: 50559, label: 'f', properties: undefined },
  Vertex { id: 50563, label: 'g', properties: undefined },
  Vertex { id: 50567, label: 'h', properties: undefined },
  ... 151 more items ]

However when I do g.V().properties() I see the properties listed as vertex properties:

 VertexProperty {
    id: 52349,
    label: 'E',
    value: 'P',
    key: 'E',
    properties: undefined },
  VertexProperty {
    id: 52351,
    label: 'id',
    value: '187516',
    key: 'id',
    properties: undefined },
  VertexProperty {
    id: 52350,
    label: 'Name',
    value: 'b',
    key: 'Name',
    properties: undefined },
  VertexProperty {
    id: 52353,
    label: 'E',
    value: 'P',
    key: 'E',
    properties: undefined },

The above shows that the properties are added but I need them in the first call i made.

 g.AddV(v1.Name).Next();


               PropertyInfo[] properties = v1.GetType().GetProperties();
               foreach (PropertyInfo property in properties)
               {

                   var v = g.V().HasLabel(v1.Name).Property(property.Name, property.GetValue(v1)).Next();
               }

Expected properties should show up but they are undefined.

Rohan Khanna
  • 109
  • 1
  • 2
  • 12

1 Answers1

1

I think it's the same issue as asked here.

you can just try:

g.V().valueMap(true).toList()
noam621
  • 2,766
  • 1
  • 16
  • 26