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년 전660회 조회
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?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠