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?

posta 2 anni fa664 visualizzazioni
1 Risposta
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
con risposta 2 anni fa
  • Any update on this? By any chance CALL clause is implementing in latest releases?

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande