W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > October to December 2005

SPARQL Protocol Test Suite Update

From: Elias Torres <eliast@us.ibm.com>
Date: Fri, 14 Oct 2005 11:02:35 -0400
To: public-rdf-dawg@w3.org
Message-ID: <OFB3E90CB0.BE57F84B-ON8525709A.004F5E0F-8525709A.0052A26C@us.ibm.com>





Hi all,

I wanted to update you on work I started to get a protocol test suite
going, any advice/direction is gladly welcomed. I mostly borrowed the work
that Andy/Steve had done on the QL test suite and followed that same
pattern.

The test suite can be found at:

cvs -d username@cvs.w3.org:/w3ccvs co WWW/2001/sw/DataAccess/proto-tests
or
http://www.w3.org/2001/sw/DataAccess/proto-tests/

There are two folders: data contains the tests and tools contains the test
suite code written in python. In the tools directory, I have two main
scripts: examples.py and test.py. Examples.py takes as input the protocol
spec and finds the examples by "pre" element's id and compares against the
test with the same id (not all tests are working). Test.py runs the tests
against a public service, I've only worked with Joseki3 (both locally and
http://www.sparql.org). If you type make, it will run both the examples.py
and test.py for you. At the moment, all examples in the spec exist as tests
in the suite.

The code requires Python 2.4.1 and Redland+Python bindings.

Here's an example test:

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ptest:
<http://www.w3.org/2001/sw/DataAccess/proto-tests/test-manifest#> .
@prefix select:
<http://www.w3.org/2001/sw/DataAccess/proto-tests/data/select/> .
@prefix example: <http://my.other.example/> .

<>  rdf:type ptest:Manifest ;
    rdfs:comment "SPARQL Protocol Examples" ;
    ptest:entries (

        [
            ptest:name "select-svcsupplied" ;
            ptest:comment "SELECT with service-supplied RDF dataset" ;
            ptest:serviceDataSet [
                ptest:defaultGraph [
                    ptest:graphName example:books;
                    ptest:graphData
<http://www.w3.org/2001/sw/DataAccess/proto-tests/data/select/svcsupplied-data.ttl>
                ]
            ] ;
            ptest:query <svcsupplied-query.rq> ;
            ptest:acceptType "application/sparql-results+xml" ;
            ptest:preferredResult [
                ptest:result <svcsupplied-results.xml> ;
                ptest:resultCode "200" ;
                ptest:resultContentType "application/sparql-results+xml"
            ]
        ]
    )
.

I'm not sure how about going on several things, but the first one of them
is graph locations. For example if you notice ptest:graphData in the
example test, I point to a publicly accessible URL because the test server
must have access to it in order to execute the query. I guess I could
parameterize the test suite to replace it, if you have your own local copy
of the test suite, for now I just point to the public copy.

Regards,

Elias Torres
Received on Friday, 14 October 2005 15:02:59 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:24 GMT