Hi all,

I have two ARQ ElementPathBlocks (or Basic Graph Pattern, see SPARQL spec 
https://www.w3.org/TR/sparql11-query/#GraphPattern) and would like to know 
whether they are equal ignoring variable names and ordering of the triples. 
What is the best/easiest way to do that with the Apache Jena? I see there is an 
org.apache.jena.sparql.util.Iso class that provides methods for testing 
isomorphisms...but I'm unsure whether this is what I am looking for. I also 
tested two ElementPathBlocks and using their equalTo method (which uses the Iso 
class), but both variable names and order seems to matter judging them equal.

I'm guessing you mean not caring about the variable names but respecting the shape they create in the BGP.

IsoMatcher is a simple algorithm for matching unordered lists
(Iso.isomorphic is ordered lists.)

If you want to ignore variables names you'll need a "EqualityTest" that captures that


BNodeIso does this for bnodes. Modifying that for a Var->Var map loosk possible (or converting the input BGPs to have a bnode with label derived from the Variable name).

    Andy

Reply via email to