Search code examples
oracle-graph

Find any (arbitrary) path between a pair of source-destination


We are trying to write PGQL query on PG View(version 21.4) to find any (arbitrary) path between a pair of source-destination.

We had being using the following link as our PGQL guideline. https://pgql-lang.org/spec/1.4/#any-path

Query: SELECT s.ID as s_id, d.ID AS d_id FROM MATCH ANY (s) -[e]->+ (d) on my_graph

Error: java.lang.UnsupportedOperationException: Only zero (0) or more path quantifier is supported

What would had cause the error since it was working on PGS. Any solution or workaround would be appreciated.


Solution

  • In version 21.4, only * is supported on PG Views. From 22.1, other quantifiers are also supported.

    Added PGQL support for more quantifiers when executing PGQL queries against property graph views.

    Syntax  Description
    ------  -----------
    *       zero or more
    +       one or more
    ?       zero or one
    {n}     exactly n
    {n,}    n or more
    {n,m}   between n and m (inclusive)
    {,m}    between zero and m (inclusive)