You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by "dehowef (via GitHub)" <gi...@apache.org> on 2023/03/03 17:07:28 UTC

[GitHub] [age] dehowef opened a new issue, #724: MATCH property constraints fail when a variable is referenced more tha once.

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

   **Describe the bug**
   Property Constraints throw an error when they are applied to a variable mentioned more than once.
   
   **How are you accessing AGE (Command line, driver, etc.)?**
   Commandline through postgresql.
   
   **What data setup do we need to do?**
   None
   
   **What is the necessary configuration info needed?**
   - Install Postgresql
   - Install AGE
   
   **What is the command that caused the error?**
   ```pgsql
   SELECT * from cypher('my_graph_name', $$
     MATCH (a {prop: “val”})-[]- (a {prop2: “val2”})
   $$) as (a agtype);
   ```
   ```
   postgres=# SELECT * FROM cypher('pilots', $$ MATCH(a{prop:"val"})-[]-(a{prop2:"val2"}) RETURN a $$ ) AS (a agtype);
   2023-03-03 09:05:16.444 PST [145400] ERROR:  variable a already exists at character 59
   2023-03-03 09:05:16.444 PST [145400] STATEMENT:  SELECT * FROM cypher('pilots', $$ MATCH(a{prop:"val"})-[]-(a{prop2:"val2"}) RETURN a $$ ) AS (a agtype);
   ERROR:  variable a already exists
   LINE 1: ... FROM cypher('pilots', $$ MATCH(a{prop:"val"})-[]-(a{prop2:"...
   ```
   
   **Expected behavior**
   The property constraint must be evaluated.
   
   **Environment (please complete the following information):**
   - Version: 1.2.0
   


-- 
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] Zainab-Saad commented on issue #724: MATCH property constraints fail when a variable is referenced more than once.

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

   This probably is not the bug rather the MATCH clause using same variable for the two vertices should be used to match _self-loop_ on a vertex. `MATCH(a)-[]-(a)` and `MATCH(a {prop: "value"})-[]-(a)` would work fine as they are used for matching the _self-loop_ but `MATCH(a {prop :"value1")-[]-(a {prop : "value2"})` or `MATCH(a {prop1 : "value1"})-[]-(a {prop2 : "value2"})` would through an error below as they are not matching any self-loop (because the properties are different for two vertices)
   
   > ERROR: variable a already exists
   


-- 
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] dehowef closed issue #724: MATCH property constraints fail when a variable is referenced more than once.

Posted by "dehowef (via GitHub)" <gi...@apache.org>.
dehowef closed issue #724: MATCH property constraints fail when a variable is referenced more than once.
URL: https://github.com/apache/age/issues/724


-- 
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] dehowef commented on issue #724: MATCH property constraints fail when a variable is referenced more than once.

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

   > This probably is not the bug rather the MATCH clause using same variable for the two vertices should be used to match _self-loop_ on a vertex. `MATCH(a)-[]-(a)` and `MATCH(a {prop: "value"})-[]-(a)` would work fine as they are used for matching the _self-loop_ but `MATCH(a {prop :"value1")-[]-(a {prop : "value2"})` or `MATCH(a {prop1 : "value1"})-[]-(a {prop2 : "value2"})` would through an error below as they are not matching any self-loop (because the properties are different for two vertices)
   > 
   > > ERROR: variable a already exists
   
   Respectfully, you are incorrect and it's a bug. Thank you


-- 
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] dehowef commented on issue #724: MATCH property constraints fail when a variable is referenced more than once.

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

   > This probably is not the bug rather the MATCH clause using same variable for the two vertices should be used to match _self-loop_ on a vertex. `MATCH(a)-[]-(a)` and `MATCH(a {prop: "value"})-[]-(a)` would work fine as they are used for matching the _self-loop_ but `MATCH(a {prop :"value1")-[]-(a {prop : "value2"})` or `MATCH(a {prop1 : "value1"})-[]-(a {prop2 : "value2"})` would through an error below as they are not matching any self-loop (because the properties are different for two vertices)
   > 
   > > ERROR: variable a already exists
   
   When a property constraint is placed on a variable, it is applied to the variable at hand.  `MATCH(a {prop :"value1")-[]-(a {prop : "value2"})` and  `MATCH(a {prop :"value1", prop2 : "value2"})-[]-(a )` are functionally equivalent and valid queries, what changes is the position with which the property constraint is being declared. A node can have many properties stored within them, and the variable declaration, in this case 'a', denotes that they should be the same vertex within this pattern.
   
   


-- 
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