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-unsubscr...@age.apache.org

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

Reply via email to