SPARQL result comparison

Hi,

I'm switching my application from one semantic repository to another. The switch is from Jena+Pellet to Sesame+OWLIM.

I have to ensure that the results to my application's SPARQL queries are the same before and after the switch (or, at least, are "compatible").

Is there some tool or library that can compare SPARQL query results highlighting the differences?

Thanks

You might want to look at ARQ's ResultSetCompare class.

It can compare two result sets, including compare by value or by term, and respecting or ignoring order. It can do bNode isomorphism comparison as well for "same term".

Except it's in Jena.

I think what you're looking for is Sesame's QueryResultUtil class, which contains methods for checking that two query results are equal or a subset (keeping bnode isomorphism in mind).

Also, you could have a look at the Sesame SPARQL testsuite, specifically the class SPARQLQueryTest (not available in the standard Sesame download, but you can see the source in the webSVN or get it from the svn repo directly). I don't think it's directly applicable to your specific problem but it contains some bits of code you could probably reuse, including how to read in a query result from file, and how to execute a comparison involving ordered results.

Except it's in Sesame :)