W3C

SPARQL Protocol

Copyright © 2010 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark, and document use rules apply.


Abstract

This manifest encodes tests for the SPARQL Protocol. Each test record has one or more ht:Requests that must be run in order to produce the expected results. Expected results are encoded in the ht:Response using one of four new terms: * `mf:expectedStatus` - Expected HTTP status code (pointing to values like `hts:StatusCode2xx`); * `mf:expectedBoolean` - Expected results for ASK queries. * `mf:expectedFormat` - Expected serialization format of the results; the range here is one of the literals: `"boolean"`, `"tabular"`, or `"RDF"` Each request has a ht:absolutePath value that starts with `/sparql/`. A program using this manifest data to run the tests must replace this value with whatever path prefix is appropriate for the endpoint being tested. Every ht:absolutePath value in this manifest starts with `/sparql/`, but and endpoint being tested may require different endpoints to be used for Query and Update requests.

This page describes W3C SPARQL Working Group's SPARQL 1.0 test suite.

Configuration

When accessed without any query parameters, the CGI provides an HTML form that may be used to validate a Protocol implementation. The parameters are:

The following parameters should also be accounted for (in a future version):

Requirements

It is assumed that the Protocol implementation provides support for all of SPARQL (1.0) and also SPARQL 1.1 Query/Update support for:

The following RDF files are loaded as appropriate to properly setup the graphstore/dataset for some tests:

Finally, it is assumed that implementations can produce application/rdf+xml and application/sparql-results+xml when requested using conneg.

Contributing Tests

The test manifests and entries are built automatically from manifest.ttl using a Rake task. Tests may be contributed via pull request to https://github.com/w3c/rdf-tests with suitable changes to the manifest.ttl and referenced files.

Distribution

Distributed under both the W3C Test Suite License and the W3C 3-clause BSD License. To contribute to a W3C Test Suite, see the policies and contribution forms.

Disclaimer

UNDER BOTH MUTUALLY EXCLUSIVE LICENSES, THIS DOCUMENT AND ALL DOCUMENTS, TESTS AND SOFTWARE THAT LINK THIS STATEMENT ARE PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.

Test Descriptions

query_post_form: query via URL-encoded POST
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
query_dataset_default_graphs_get: GET query with protocol-specified default graph
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
query_dataset_default_graphs_post: POST query with protocol-specified default graphs
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
query_dataset_named_graphs_post: POST query with protocol-specified named graphs
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
query_dataset_named_graphs_get: GET query with protocol-specified named graphs
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
query_dataset_full: query with protocol-specified dataset (both named and default graphs)
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
query_multiple_dataset: query specifying dataset in both query string and protocol; test for use of protocol-specified dataset
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
query_get: query via GET
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
query_content_type_select: query appropriate content type (expect one of: XML, JSON, CSV, TSV)
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
query_content_type_ask: query appropriate content type (expect one of: XML, JSON)
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
query_content_type_describe: query appropriate content type (expect one of: RDF/XML, Turtle, N-Triples, RDFa)
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
query_content_type_construct: query appropriate content type (expect one of: RDF/XML, Turtle, N-Triples, RDFa)
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
update_dataset_default_graph: update with protocol-specified default graph
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
update_dataset_default_graphs: update with protocol-specified default graphs
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
update_dataset_named_graphs: update with protocol-specified named graphs
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
update_dataset_full: update with protocol-specified dataset (both named and default graphs)
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
update_post_form: update via URL-encoded POST
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
update_post_direct: update via POST directly
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
update_base_uri: test for service-defined BASE URI ("which MAY be the service endpoint")
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
query_post_direct: query via POST directly
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
bad_query_method: invoke query operation with a method other than GET or POST
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
bad_multiple_queries: invoke query operation with more than one query string
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
bad_query_wrong_media_type: invoke query operation with a POST with media type that's not url-encoded or application/sparql-query
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
bad_query_missing_form_type: invoke query operation with url-encoded body, but without application/x-www-form-urlencoded media type
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
bad_query_missing_direct_type: invoke query operation with SPARQL body, but without application/sparql-query media type
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
bad_query_non_utf8: invoke query operation with direct POST, but with a non-UTF8 encoding (UTF-16)
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
bad_query_syntax: invoke query operation with invalid query syntax (4XX result)
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
bad_update_get: invoke update operation with GET
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
bad_multiple_updates: invoke update operation with more than one update string
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
bad_update_wrong_media_type: invoke update operation with a POST with media type that's not url-encoded or application/sparql-update
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
bad_update_missing_form_type: invoke update operation with url-encoded body, but without application/x-www-form-urlencoded media type
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
bad_update_non_utf8: invoke update operation with direct POST, but with a non-UTF8 encoding
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
bad_update_syntax: invoke update operation with invalid update syntax
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action
bad_update_dataset_conflict: invoke update with both using-graph-uri/using-named-graph-uri parameter and USING/WITH clause
type
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3
action