You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Rurik Thomas Greenall <ru...@gmail.com> on 2012/04/11 11:42:55 UTC

Testing SPARQL query results XML

Hi all,

Is it possible to test isomorphy of two SPARQL query results XML using Jena?

What is the best way of doing this?

Regards,

Rurik

Re: Testing SPARQL query results XML

Posted by Rurik Thomas Greenall <ru...@gmail.com>.
Thanks Paolo, Andy. This is precisely what I am looking for.

R.

On Wed, Apr 11, 2012 at 12:45 PM, Andy Seaborne <an...@apache.org> wrote:

> On 11/04/12 11:03, Paolo Castagna wrote:
>
>> Hi Rurik,
>> you can use ResultSetFormatter.asRDF(...):
>>
>>   ResultSet results = qexec.execSelect();
>>   ResultSetFormatter.asRDF(**result, results);
>>
>> A complete example is here:
>> https://github.com/castagna/**jena-examples/blob/**
>> b517dd955f87ab439b1be36f89d172**0c6a6b9418/src/main/java/org/**
>> apache/jena/examples/**ExampleARQ_07.java<https://github.com/castagna/jena-examples/blob/b517dd955f87ab439b1be36f89d1720c6a6b9418/src/main/java/org/apache/jena/examples/ExampleARQ_07.java>
>>
>> I think this should solve your problem.
>>
>> Paolo
>>
>> Rurik Thomas Greenall wrote:
>>
>>> Hi all,
>>>
>>> Is it possible to test isomorphy of two SPARQL query results XML using
>>> Jena?
>>>
>>> What is the best way of doing this?
>>>
>>> Regards,
>>>
>>> Rurik
>>>
>>>
>>
> The code used by the test suite has been collected together into:
>
> com.hp.hpl.jena.sparql.**resultset.ResultSetCompare
>
> and you get to choose between term and value based equality.
>
>        Andy
>

Re: Testing SPARQL query results XML

Posted by Andy Seaborne <an...@apache.org>.
On 11/04/12 11:03, Paolo Castagna wrote:
> Hi Rurik,
> you can use ResultSetFormatter.asRDF(...):
>
>    ResultSet results = qexec.execSelect();
>    ResultSetFormatter.asRDF(result, results);
>
> A complete example is here:
> https://github.com/castagna/jena-examples/blob/b517dd955f87ab439b1be36f89d1720c6a6b9418/src/main/java/org/apache/jena/examples/ExampleARQ_07.java
>
> I think this should solve your problem.
>
> Paolo
>
> Rurik Thomas Greenall wrote:
>> Hi all,
>>
>> Is it possible to test isomorphy of two SPARQL query results XML using Jena?
>>
>> What is the best way of doing this?
>>
>> Regards,
>>
>> Rurik
>>
>

The code used by the test suite has been collected together into:

com.hp.hpl.jena.sparql.resultset.ResultSetCompare

and you get to choose between term and value based equality.

	Andy

Re: Testing SPARQL query results XML

Posted by Paolo Castagna <ca...@googlemail.com>.
Hi Rurik,
you can use ResultSetFormatter.asRDF(...):

  ResultSet results = qexec.execSelect();
  ResultSetFormatter.asRDF(result, results);

A complete example is here:
https://github.com/castagna/jena-examples/blob/b517dd955f87ab439b1be36f89d1720c6a6b9418/src/main/java/org/apache/jena/examples/ExampleARQ_07.java

I think this should solve your problem.

Paolo

Rurik Thomas Greenall wrote:
> Hi all,
> 
> Is it possible to test isomorphy of two SPARQL query results XML using Jena?
> 
> What is the best way of doing this?
> 
> Regards,
> 
> Rurik
>