Support for `CALL` in Amazon Neptune OpenCypher queries

0

I need a query which returns me a node with label TOPIC against a particular user. The conditions of the query are the following

  1. (u:USER { id: <user_id> })-[:follows]->(t:TOPIC) - follows relationship does not exist
  2. (u:USER { id: <user_id>})-[f:follows]->(t:TOPIC) - f.status is DELETED

I found a way to do this using the UNION keyword

MATCH (u:USER) WHERE id(u) = <user_id>
MATCH (t:TOPIC) WHERE t.status = 'ACTIVE'
WITH u, t
MATCH (t) WHERE (NOT (u)-[:follows]->(t))
RETURN t
UNION
MATCH (u:USER)-[f:follows]->(t:TOPIC) WHERE f.status = 'DELETED' AND id(u) = <user_id>
RETURN t

But, I need to perform pagination over this query and order them by an attribute. The only way to perform pagination over a UNION is to put the whole query inside the CALL {} construct(mentioned here). Currently, Amazon Neptune does not support CALL {} for OpenCypher(mentioned here).

Will the CALL {} construct be supported by Neptune OpenCypher soon enough? If not, is there an alternative query which will solve my use case without using UNION?

Any help would be highly appreciated.

  • @kanhaiagarwal Did you found any alternatives for CALL {} clause?

已提问 2 年前624 查看次数
1 回答
0

openCypher does not support post-UNION processing and, as you pointed out, Neptune does not currently support the CALL clause in either the procedural or subquery forms (the one you requested). Without this support I am not sure of a way to rewrite this into a single query to get the result you desire. Based on feedback from customers, we will be working backwards to prioritize adding support for new features into the openCypher query language such as the support for the CALL step.

AWS
已回答 2 年前
  • Any update on this? By any chance CALL clause is implementing in latest releases?

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容