SPARQL Protocol Test Suite Update

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 UTC