Hello community, How to check equivalence of two sparql queries ? We have tried the QueryCompare.equals(), Op.equalTo() methods. But they seem to be sensitive to the order of operands in joins, unions.
*Example: *The following queries are equivalent, because irrespective of the order of operands to the UNION operator, the query should give the same solution set. But, the QueryCompare.equals(query1, query2) operation returns 'false'. *query1:* PREFIX dc10: <http://purl.org/dc/elements/1.0/> PREFIX dc11: <http://purl.org/dc/elements/1.1/> SELECT ?title WHERE { { ?book dc10:title ?title } UNION { ?book dc11:title ?title } } *query2:* PREFIX dc10: <http://purl.org/dc/elements/1.0/> PREFIX dc11: <http://purl.org/dc/elements/1.1/> SELECT ?title WHERE { { ?book dc11:title ?title } UNION { ?book dc10:title ?title } } *Use Case:* Currently we are writing our own query transformer for domain specific optimisation. We want to check the equivalence of queries for Unit testing. The test should pass if the expected and actual queries are equivalent. Is there any existing way of checking query equivalence? Thanks in advance, Rushikesh
