This question has an answer for how to find nodes which don't have outgoing edges on neo4j and cypher:
MATCH ()-[:A]->(n) WHERE NOT (n)-->() RETURN n
However, this does not work on Apache AGE:
select *
from cypher('graph_name', $$
MATCH ()-[:A]->(n) WHERE NOT (n)-->() RETURN n
$$) as (n agtype)
which gives:
ERROR: syntax error at or near ">"
LINE 3: MATCH ()-[:A]->(n) WHERE NOT (n)-->() RETURN n
^
SQL state: 42601
Character: 69
How can I accomplish the same query in Apache AGE?
I'm using the latest version of Apache AGE (1.5.0) at time of posting.
I've tried variations for the NOT clause such as
(n)-[]->()(n)-[r]->()(n)-[*]->()
but none have worked.
The equivalent query is:
The difference is that this part of the query:
is replaced with: