1

How to find the top most hierarchy in redisgraph since NOT, IS keywords are not supported yet. In normal cypher query language we can do this as below.

MATCH (n:Child) WHERE NOT (n)-[:PARENT]->() RETURN (n);

But NOT keyword is not supported in redisgraph as of now.

Bhanu
  • 25
  • 9

1 Answers1

1

If I understand correctly, you're looking to find all nodes of type Child that do not have an outgoing edge of type :PARENT In which case, currently I don't see how you can achieve this with the subset of OpenCypher we have, a quick and easy solution might be introducing a new OUT_DEGREE function which will return the number of outgoing edges from a given node, then you'll be able to filter on OUT_DEGREE(n, "PARENT") = 0

SWilly22
  • 869
  • 4
  • 5
  • Thanks for the suggestion. Can you please provide the documentations for the creation of a function on the redisgraph database so I can implement and test out this scenario. – Bhanu Mar 13 '19 at 10:34
  • Currently users can't extend RedisGraph with user provided functions, I'll suggest opening an issue on RedisGraph github repository. – SWilly22 Mar 14 '19 at 12:21