I am trying to query the graph, which gives all the connected nodes with their one hop away neighbors.
All the Edges present in the graph are DIRECTED, but I want to get all the connected nodes irrespective of their direction(all the incoming and outgoing edges).
Query -
one_hop = select b from allVertices:a - (ANY:rel) - ANY:b
WHERE a.type != “Gender” AND b.type != “Gender”;
which throws the following error -
unsatisfiable FROM pattern, query result always empty
Warning: unsatisfiable pattern allVertices:a - (ANY:rel) - ANY:b
And when direction is specified -
It throws the above error.
So the questions are -
- If we have all the directed edges in the graph, can we query without specifying the direction.
- Do the source and target should only be those which are present as source and target respectively in the schema. If yes, how to filter them. (Refer Image - Gender is not source for any edge type in the graph).
=================================================================
More explanation for question 2 -
Consider schema as -
(Employee, Student) - (Reside>:r)-(City:c)
now I want to query-
s = {ANY.*}
p = select s from s-(Reside>:r)-City:c where s.type != Contractor
Contractor is not the source vertex for city.