You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by "czesiu89 (via GitHub)" <gi...@apache.org> on 2023/04/27 08:21:12 UTC

[GitHub] [age] czesiu89 opened a new issue, #865: Support for PIPE operator for apache-age-python client

czesiu89 opened a new issue, #865:
URL: https://github.com/apache/age/issues/865

   Currently we are running queries that require several Relationship (age.models.Edge) types to be filtered out.
   We tried to approach it with OPTIONAL MATCH but it didn't suite as too well, since it requires first statement to have matches to process with the other. 
   Ended up with something like "MATCH ()-[r]-() WHERE r.type in ["type1", "type2"] RETURN r".
   In OpenCypher specs there is a mention about PIPE operator that facilitates such OR statements for relationship types and it goes like: "MATCH ()-[r:type1|type2]-() RETURN r.
   It feels a lot more natural to use. This one gives us "syntax error near |'.
   
   Are there any plans to implement such operator or is it somehow limited?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] farakh-shahid commented on issue #865: Support for PIPE operator for apache-age-python client

Posted by "farakh-shahid (via GitHub)" <gi...@apache.org>.
farakh-shahid commented on issue #865:
URL: https://github.com/apache/age/issues/865#issuecomment-1552576792

   Yes PIPE is cutoff. It is no more supported for specifying relationship types in single pattern.
   
   But after checking some doc have you tried using WHERE clause with IN
   I think this might WORK
   like
   WHERE r.type IN ['type1', 'type2']


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Support for PIPE operator for apache-age-python client [age]

Posted by "thjbdvlt (via GitHub)" <gi...@apache.org>.
thjbdvlt commented on issue #865:
URL: https://github.com/apache/age/issues/865#issuecomment-1931827329

   @rafsun42 thank you! i am currently on PG15 and cannot compile with it, but i'll try to upgrapde to PG16 soon so i can try it out, because it seems to be what i need! :)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Support for PIPE operator for apache-age-python client [age]

Posted by "cvanlabe (via GitHub)" <gi...@apache.org>.
cvanlabe commented on issue #865:
URL: https://github.com/apache/age/issues/865#issuecomment-1765290460

   @jrgemignani thanks for your response. As I mentioned, it’s visible in the grammar I linked to. 
   
   In the documentation, it’s described as early as page 10 in [the opencypher reference](https://s3.amazonaws.com/artifacts.opencypher.org/openCypher9.pdf):
   
   _” if we’d like to describe some data such that the relationship could have any one of a set of types, then they can all be listed in the pattern, separating them with the pipe symbol | like this:”_
   
    > (a)-[r:TYPE1|TYPE2]->(b)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Support for PIPE operator for apache-age-python client [age]

Posted by "thjbdvlt (via GitHub)" <gi...@apache.org>.
thjbdvlt commented on issue #865:
URL: https://github.com/apache/age/issues/865#issuecomment-1933914215

   @rafsun42 unfortunately: yes! but as i am really not a programmer, i have no doubts: it must be because of me not understing something. anyway, i post a comment directly on the [PR 1452 page](https://github.com/apache/age/pull/1452) with logs and description of what i have done, just in case it may help!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Support for PIPE operator for apache-age-python client [age]

Posted by "jrgemignani (via GitHub)" <gi...@apache.org>.
jrgemignani commented on issue #865:
URL: https://github.com/apache/age/issues/865#issuecomment-1765181544

   @cvanlabe -
   
   > @farakh-shahid That is exactly what @czesiu89 is saying he's using as workaround, indeed.
   > 
   > Is there any reason why PIPE is "_no more supported_"? Does it imply that Age is not implementing 100% OpenCypher? As I believe it's part of its [grammar](https://github.com/opencypher/openCypher/blob/master/grammar/basic-grammar.xml)?
   > 
   > Thanks a lot!
   
   Can you please show me where in the openCypher documentation it states the pipe operator was/is supported?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Support for PIPE operator for apache-age-python client [age]

Posted by "cvanlabe (via GitHub)" <gi...@apache.org>.
cvanlabe commented on issue #865:
URL: https://github.com/apache/age/issues/865#issuecomment-1775303395

   Thanks so much everyone! We can't immediately share our data model we use today. Assume it's a typical graph, which has several nodes connected to other nodes where each connection is a different relation type.
   Using the OR operator, we can decide which nodes we want to visualize given the used relationships.
   
   I hope this helps.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Support for PIPE operator for apache-age-python client [age]

Posted by "pawankukreja01 (via GitHub)" <gi...@apache.org>.
pawankukreja01 commented on issue #865:
URL: https://github.com/apache/age/issues/865#issuecomment-1763489346

   The PIPE operator is a feature of the Nebula Graph Query Language (nGQL) and is not part of OpenCypher. It allows multiple queries to be combined using pipe operators in nGQL. The PIPE operator applies to native nGQL only and is not compatible with OpenCypher


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Support for PIPE operator for apache-age-python client [age]

Posted by "jrgemignani (via GitHub)" <gi...@apache.org>.
jrgemignani commented on issue #865:
URL: https://github.com/apache/age/issues/865#issuecomment-1765310792

   I will bring this "oversight" up with the team and see if we can get it added. @rafsun42 @dehowef @muhammadshoaib 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] eyab commented on issue #865: Support for PIPE operator for apache-age-python client

Posted by "eyab (via GitHub)" <gi...@apache.org>.
eyab commented on issue #865:
URL: https://github.com/apache/age/issues/865#issuecomment-1688671768

   Hi @czesiu89 Any new updates on this? Can you share a bit more about your use-case? It'll help us prioritize.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Support for PIPE operator for apache-age-python client [age]

Posted by "thjbdvlt (via GitHub)" <gi...@apache.org>.
thjbdvlt commented on issue #865:
URL: https://github.com/apache/age/issues/865#issuecomment-1929027773

   hi, i face a situation where the pipe-OR operator would be usefull, so as my situation is pretty simple i describe here.
   
   this is the query i tried, in which i want to match synonyms or hyperonyms of a word, and synonym/hyperonyms of synonym/hyperonyms, and synonym/hyperonyms of synonym of synonym of this word (including synonym of hyperonym of synonym, and so on). so i need variable-length edges and the OR operator.
   
   ```sql
   select * from cypher('graph_dict', $$
       match (s:word {graphic_form: 'know'})-[r:has_synonym|has_hyperonym|has_holonym *1..3]->(t:word)
       return s, t
   $$) as (source agtype, target agtype);
   ```
   
   with the solution proposed in the beginning of this discussion, it produces an error. this is what i've tried:
   
   ```sql
   select * from cypher('graph_dict', $$
       match (s:word {graphic_form: 'know'})-[r]->(m:word)-[s *0..2]->(t:word)
       where label(r) in ['has_synonym', 'has_hyperonym', 'has_holonym']
       and label(s) in ['has_synonym', 'has_hyperonym', 'has_holonym']
       return l.id, t.graphie
   $$) as (source agtype, target agtype);
   ```
   
   the error is the following, and it seems that when the second edge is length 0, `label()` cannot be used (obviously).
   
   ```
   ERROR: label() argument must resolve to a vertex or an edge.
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Support for PIPE operator for apache-age-python client [age]

Posted by "rafsun42 (via GitHub)" <gi...@apache.org>.
rafsun42 commented on issue #865:
URL: https://github.com/apache/age/issues/865#issuecomment-1930777999

   @thjbdvlt PR #1452 implements multiple label support. It has not been approved yet, but you can try it out.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Support for PIPE operator for apache-age-python client [age]

Posted by "rafsun42 (via GitHub)" <gi...@apache.org>.
rafsun42 commented on issue #865:
URL: https://github.com/apache/age/issues/865#issuecomment-1932481935

   @thjbdvlt The PR 1452 is actually based on PG15. Do you get a compilation error?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Support for PIPE operator for apache-age-python client [age]

Posted by "jrgemignani (via GitHub)" <gi...@apache.org>.
jrgemignani commented on issue #865:
URL: https://github.com/apache/age/issues/865#issuecomment-1765316021

   Btw, the title for this issue is a bit misleading. This is for adding the **OR** operator `|` to the language.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Support for PIPE operator for apache-age-python client [age]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #865:
URL: https://github.com/apache/age/issues/865#issuecomment-2105397656

   This issue is stale because it has been open 45 days with no activity. Remove "Abondoned" label or comment or this will be closed in 7 days.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Support for PIPE operator for apache-age-python client [age]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #865:
URL: https://github.com/apache/age/issues/865#issuecomment-2227143950

   This issue is stale because it has been open 60 days with no activity. Remove "Abondoned" label or comment or this will be closed in 14 days.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Support for PIPE operator for apache-age-python client [age]

Posted by "rafsun42 (via GitHub)" <gi...@apache.org>.
rafsun42 commented on issue #865:
URL: https://github.com/apache/age/issues/865#issuecomment-1765319343

   @czesiu89 @cvanlabe The work on the this operator is currently in progress. It would be useful if you let us know your data model and queries.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [age] cvanlabe commented on issue #865: Support for PIPE operator for apache-age-python client

Posted by "cvanlabe (via GitHub)" <gi...@apache.org>.
cvanlabe commented on issue #865:
URL: https://github.com/apache/age/issues/865#issuecomment-1553738967

   @farakh-shahid That is exactly what @czesiu89 is saying he's using as workaround, indeed. 
   
   Is there any reason why PIPE is "_no more supported_"? Does it imply that Age is not implementing 100% OpenCypher? As I believe it's part of its [grammar](https://github.com/opencypher/openCypher/blob/master/grammar/basic-grammar.xml)?
   
   Thanks a lot!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org