Hi,
let's say I have two SPARQL query strings:

---- Q1 ----
PREFIX : <http://example/>

SELECT ?v
{ :x :p ?v . FILTER(?v = 1) }
------------

---- Q2 ----
PREFIX : <http://example/>

SELECT ?v
{
    :x :p ?v .
    FILTER ( ?v = 1 )
}
------------

Once the queries are parsed into two Query objects (say, q1 and q2),
I can use q1.equals(q2) to check if two queries are equal (i.e. exactly
the same, modulo extra spaces/formatting). Great.

However, let's look at another query string:

---- Q3 ----
PREFIX : <http://example/>

SELECT ?y
{
    :x :p ?y .
    FILTER ( ?y = 1 )
}
------------

The only difference between Q3 and Q1|Q2 is that we have a different
variable name (i.e. ?y instead of ?v). The queries are different, but
they are "equivalent": they are structurally the same, only variable
names are different.

Is there already in ARQ a way to compare queries to see if they are
equivalent or not?

I found the equiv method in BasicPattern, is there something similar
for entire queries?

Thanks,
Paolo

Reply via email to