0

enter image description here

I would like to create a query which gets information from two vertices. I have Vertex A and Vertex B and I need from Vertex A the value of property label and of properties array the value schema. From Vertex B I only would like to get the value of property name. I tried multiple queries to get the result like:

[
  {
     "label" : "anySubTypeName",
     "schema": ".....",
     "name"  : "anyTypeName"
   },
   ...
]

I was able to get properties name of each vertex but not schema with following query:

g.V().hasLabel("subtype").as("subtype")
     .outE("typeof").inV().as("type")
     .select("subtype", "type").by("id")
____________________

Result:

[
  {
    "subtype": "anySubTypeName",
    "type"   :  "anyTypeName"
  }
]

Can anyone help me that I also can get schema as part of the result?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Michi-2142
  • 1,170
  • 3
  • 18
  • 39

1 Answers1

1

I found an answer to get the expected result with the following query:

g.V().haslabel("subtype").as("subtype")
     .outE("typeof").inV().as("type")
     .select("subtype", "type").by("id")
Michi-2142
  • 1,170
  • 3
  • 18
  • 39