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 年前檢視次數 653 次
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?

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南