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年前659ビュー
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?

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ