From 7db1dc829dacf5e614e06f8ddfd78de8e02cce08 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 4 Apr 2022 17:26:24 -0700 Subject: [PATCH 1/8] application/x-www-url-form-urlencoded => application/x-www-form-urlencoded. --- sparql11/data-sparql11/protocol/index.html | 14 +++++++------- sparql11/data-sparql11/protocol/manifest.ttl | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sparql11/data-sparql11/protocol/index.html b/sparql11/data-sparql11/protocol/index.html index 5289012a..463cddf1 100644 --- a/sparql11/data-sparql11/protocol/index.html +++ b/sparql11/data-sparql11/protocol/index.html @@ -136,7 +136,7 @@

Request

-
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/x-www-url-form-urlencoded
Content-Length: XXX

query=ASK%20%7B%7D
+
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/x-www-form-urlencoded
Content-Length: XXX

query=ASK%20%7B%7D

Response

@@ -608,7 +608,7 @@

Response

Request

-
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/x-www-url-form-urlencoded
Content-Length: XXX

update=CLEAR%20ALL
+
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/x-www-form-urlencoded
Content-Length: XXX

update=CLEAR%20ALL

Response

@@ -799,7 +799,7 @@

Response

http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#bad_query_missing_form_type: - invoke query operation with url-encoded body, but without application/x-www-url-form-urlencoded media type + invoke query operation with url-encoded body, but without application/x-www-form-urlencoded media type
@@ -942,7 +942,7 @@

Response

Request

-
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/x-www-url-form-urlencoded
Content-Length: XXX

update=CLEAR%20NAMED&update=CLEAR%20DEFAULT
+
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/x-www-form-urlencoded
Content-Length: XXX

update=CLEAR%20NAMED&update=CLEAR%20DEFAULT

Response

@@ -990,7 +990,7 @@

Response

http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#bad_update_missing_form_type: - invoke update operation with url-encoded body, but without application/x-www-url-form-urlencoded media type + invoke update operation with url-encoded body, but without application/x-www-form-urlencoded media type
@@ -1052,7 +1052,7 @@

Response

Request

-
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/x-www-url-form-urlencoded
Content-Length: XXX

update=CLEAR%20XYZ
+
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/x-www-form-urlencoded
Content-Length: XXX

update=CLEAR%20XYZ

Response

@@ -1079,7 +1079,7 @@

Response

Request

-
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/x-www-url-form-urlencoded
Content-Length: XXX

using-named-graph-uri=http%3A%2F%2Fexample%2Fpeople&update=%09%09PREFIX%20foaf%3A%20%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0A%09%09WITH%20%3Chttp%3A%2F%2Fexample%2Faddresses%3E%0A%09%09DELETE%20%7B%20%3Fperson%20foaf%3AgivenName%20%27Bill%27%20%7D%0A%09%09INSERT%20%7B%20%3Fperson%20foaf%3AgivenName%20%27William%27%20%7D%0A%09%09WHERE%20%7B%0A%09%09%09%3Fperson%20foaf%3AgivenName%20%27Bill%27%0A%09%09%7D%0A
+
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/x-www-form-urlencoded
Content-Length: XXX

using-named-graph-uri=http%3A%2F%2Fexample%2Fpeople&update=%09%09PREFIX%20foaf%3A%20%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0A%09%09WITH%20%3Chttp%3A%2F%2Fexample%2Faddresses%3E%0A%09%09DELETE%20%7B%20%3Fperson%20foaf%3AgivenName%20%27Bill%27%20%7D%0A%09%09INSERT%20%7B%20%3Fperson%20foaf%3AgivenName%20%27William%27%20%7D%0A%09%09WHERE%20%7B%0A%09%09%09%3Fperson%20foaf%3AgivenName%20%27Bill%27%0A%09%09%7D%0A

Response

diff --git a/sparql11/data-sparql11/protocol/manifest.ttl b/sparql11/data-sparql11/protocol/manifest.ttl index 407ecece..a13cb34b 100644 --- a/sparql11/data-sparql11/protocol/manifest.ttl +++ b/sparql11/data-sparql11/protocol/manifest.ttl @@ -53,7 +53,7 @@ POST /sparql/ HTTP/1.1 Host: www.example User-agent: sparql-client/0.1 - Content-Type: application/x-www-url-form-urlencoded + Content-Type: application/x-www-form-urlencoded Content-Length: XXX query=ASK%20%7B%7D @@ -587,7 +587,7 @@ followed by POST /sparql/ HTTP/1.1 Host: www.example User-agent: sparql-client/0.1 - Content-Type: application/x-www-url-form-urlencoded + Content-Type: application/x-www-form-urlencoded Content-Length: XXX update=CLEAR%20ALL @@ -741,7 +741,7 @@ followed by . :bad_query_missing_form_type rdf:type mf:ProtocolTest ; - mf:name "invoke query operation with url-encoded body, but without application/x-www-url-form-urlencoded media type" ; + mf:name "invoke query operation with url-encoded body, but without application/x-www-form-urlencoded media type" ; rdfs:comment """ #### Request @@ -841,7 +841,7 @@ followed by POST /sparql/ HTTP/1.1 Host: www.example User-agent: sparql-client/0.1 - Content-Type: application/x-www-url-form-urlencoded + Content-Type: application/x-www-form-urlencoded Content-Length: XXX update=CLEAR%20NAMED&update=CLEAR%20DEFAULT @@ -876,7 +876,7 @@ followed by . :bad_update_missing_form_type rdf:type mf:ProtocolTest ; - mf:name "invoke update operation with url-encoded body, but without application/x-www-url-form-urlencoded media type" ; + mf:name "invoke update operation with url-encoded body, but without application/x-www-form-urlencoded media type" ; rdfs:comment """ #### Request @@ -926,7 +926,7 @@ followed by POST /sparql/ HTTP/1.1 Host: www.example User-agent: sparql-client/0.1 - Content-Type: application/x-www-url-form-urlencoded + Content-Type: application/x-www-form-urlencoded Content-Length: XXX update=CLEAR%20XYZ @@ -947,7 +947,7 @@ followed by POST /sparql/ HTTP/1.1 Host: www.example User-agent: sparql-client/0.1 - Content-Type: application/x-www-url-form-urlencoded + Content-Type: application/x-www-form-urlencoded Content-Length: XXX using-named-graph-uri=http%3A%2F%2Fexample%2Fpeople&update=%09%09PREFIX%20foaf%3A%20%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0A%09%09WITH%20%3Chttp%3A%2F%2Fexample%2Faddresses%3E%0A%09%09DELETE%20%7B%20%3Fperson%20foaf%3AgivenName%20%27Bill%27%20%7D%0A%09%09INSERT%20%7B%20%3Fperson%20foaf%3AgivenName%20%27William%27%20%7D%0A%09%09WHERE%20%7B%0A%09%09%09%3Fperson%20foaf%3AgivenName%20%27Bill%27%0A%09%09%7D%0A From 2b511623dacd1eb88914d60ac92de5478a067539 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 4 Apr 2022 17:31:38 -0700 Subject: [PATCH 2/8] Minor changes to templates. --- trig/reports/template.md | 2 +- turtle/reports/template.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/trig/reports/template.md b/trig/reports/template.md index 63987773..6bfa81a9 100644 --- a/trig/reports/template.md +++ b/trig/reports/template.md @@ -211,7 +211,7 @@ a doap:Project, earl:TestSubject, earl:Software ; doap:name "RDF::TriG" ; - doap:homepage ; + doap:homepage ; doap:license ; doap:description "RDF::TriG is an TriG reader/writer for the RDF.rb library suite."@en ; doap:created "2011-08-29"^^xsd:date ; diff --git a/turtle/reports/template.md b/turtle/reports/template.md index ae56a5cc..f969644b 100644 --- a/turtle/reports/template.md +++ b/turtle/reports/template.md @@ -213,7 +213,7 @@ a doap:Project, earl:TestSubject, earl:Software ; doap:name "RDF::Turtle" ; - doap:homepage ; + doap:homepage ; doap:license ; doap:description "RDF::Turtle is an Turtle reader/writer for the RDF.rb library suite."@en ; doap:created "2011-08-29"^^xsd:date ; From 85341312168598134053e974d89879aac40ea93f Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 25 Apr 2022 13:53:31 -0700 Subject: [PATCH 3/8] Extract information from protocol_validator.cgi in to Ruby script used to generate manifest variations. Uses HTTP and CNT ontologies to encode server interactions. --- sparql11/data-sparql11/protocol/Rakefile | 14 + .../data-sparql11/protocol/gen_manifest.rb | 919 +++++ sparql11/data-sparql11/protocol/index.html | 3342 +++++++++++------ .../data-sparql11/protocol/manifest.jsonld | 2071 ++++++++++ sparql11/data-sparql11/protocol/manifest.ttl | 2562 ++++++++----- .../protocol/protocol_validator.cgi | 1438 +++++++ sparql11/data-sparql11/protocol/template.haml | 186 +- 7 files changed, 8368 insertions(+), 2164 deletions(-) create mode 100644 sparql11/data-sparql11/protocol/Rakefile create mode 100644 sparql11/data-sparql11/protocol/gen_manifest.rb create mode 100644 sparql11/data-sparql11/protocol/manifest.jsonld create mode 100755 sparql11/data-sparql11/protocol/protocol_validator.cgi diff --git a/sparql11/data-sparql11/protocol/Rakefile b/sparql11/data-sparql11/protocol/Rakefile new file mode 100644 index 00000000..c3c62b82 --- /dev/null +++ b/sparql11/data-sparql11/protocol/Rakefile @@ -0,0 +1,14 @@ +# Builds manifests +task default: [:jsonld, :ttl, :html] + +task jsonld: "gen_manifest.rb" do + %x(ruby gen_manifest.rb -o manifest.jsonld) +end + +task ttl: "gen_manifest.rb" do + %x(ruby gen_manifest.rb --format ttl -o manifest.ttl) +end + +task html: "gen_manifest.rb" do + %x(ruby gen_manifest.rb --format html -o index.html) +end diff --git a/sparql11/data-sparql11/protocol/gen_manifest.rb b/sparql11/data-sparql11/protocol/gen_manifest.rb new file mode 100644 index 00000000..74d8ab39 --- /dev/null +++ b/sparql11/data-sparql11/protocol/gen_manifest.rb @@ -0,0 +1,919 @@ +require 'cgi' +require 'getoptlong' +require 'json/ld' +require 'rdf/reasoner' +require 'rdf/turtle' +require 'haml' +require 'byebug' +require 'amazing_print' + +# Test descriptions used for generating Manifest and HTML renderings. +# +# ### Request (`req`): +# * `method`: HTTP request method +# * `content`: HTTP request content. If an object/hash, used to create application/x-www-form-urlencoded content. If the request `Content-Type` header indicates a text encoding this MUST be used for encoding any POST content. +# * `Accept`: HTTP request accept header +# * `Content-Type`: HTTP request content-type (defaults to `application/x-www-form-urlencoded` for POST). +# * Other entries are encoded as request query parameters. +# +# If `req` has more than one entry, the intermediate response is expected to be a success with the following `resp` description used to match the final response. +# +# ### Response (`resp`): +# `status`: HTTP response status to match. +# `Content-Type`: response content-type expected to match one of these. +POSITIVE_TESTS = { + query_get: { + name: "query via GET", + req: [{ + method: :GET, + query: "ASK {}", + "default-graph-uri": "http://kasei.us/2009/09/sparql/data/data0.rdf", + resp: { + status: %w(2XX 3XX), + "Content-Type": %w(application/sparql-results+xml application/sparql-results+json), + content: true + } + }], + }, + query_post_form: { + name: "query via URL-encoded POST", + req: [{ + method: :POST, + query: "ASK {}", + "default-graph-uri": "http://kasei.us/2009/09/sparql/data/data0.rdf", + resp: { + status: %w(2XX 3XX), + "Content-Type": %w(application/sparql-results+xml application/sparql-results+json), + content: true + } + }], + }, + query_post_direct: { + name: "query via POST directly", + req: [{ + method: :POST, + content: "ASK {}", + "default-graph-uri": "http://kasei.us/2009/09/sparql/data/data0.rdf", + "Content-Type": "application/sparql-query", + resp: { + status: %w(2XX 3XX), + "Content-Type": %w(application/sparql-results+xml application/sparql-results+json), + content: true + } + }], + }, + query_dataset_default_graph: { + name: "query with protocol-specified default graph", + req: [{ + method: :POST, + content: { + query: 'ASK { ?p ?o }', + "default-graph-uri": "http://kasei.us/2009/09/sparql/data/data1.rdf", + }, + resp: { + status: %w(2XX 3XX), + "Content-Type": %w(application/sparql-results+xml application/sparql-results+json), + content: true + } + }], + }, + query_dataset_default_graphs_get: { + name: "GET query with protocol-specified default graphs", + req: [{ + method: :GET, + query: 'ASK { a ?type . a ?type . }', + "default-graph-uri": %w(http://kasei.us/2009/09/sparql/data/data1.rdf http://kasei.us/2009/09/sparql/data/data2.rdf), + resp: { + status: %w(2XX 3XX), + "Content-Type": %w(application/sparql-results+xml application/sparql-results+json), + content: true + } + }], + }, + query_dataset_default_graphs_post: { + name: "POST query with protocol-specified default graphs", + req: [{ + method: :POST, + content: { + query: 'ASK { a ?type . a ?type . }', + "default-graph-uri": %w(http://kasei.us/2009/09/sparql/data/data1.rdf http://kasei.us/2009/09/sparql/data/data2.rdf), + }, + resp: { + status: %w(2XX 3XX), + "Content-Type": %w(application/sparql-results+xml application/sparql-results+json), + content: true + } + }], + }, + query_dataset_named_graphs_post: { + name: "POST query with protocol-specified named graphs", + req: [{ + method: :POST, + content: { + query: 'ASK { GRAPH ?g1 { a ?type } GRAPH ?g2 { a ?type } }', + "named-graph-uri": %w(http://kasei.us/2009/09/sparql/data/data1.rdf http://kasei.us/2009/09/sparql/data/data2.rdf), + }, + resp: { + status: %w(2XX 3XX), + "Content-Type": %w(application/sparql-results+xml application/sparql-results+json), + content: true + } + }], + }, + query_dataset_named_graphs_get: { + name: "GET query with protocol-specified named graphs", + req: [{ + method: :GET, + query: 'ASK { GRAPH ?g1 { a ?type } GRAPH ?g2 { a ?type } }', + "named-graph-uri": %w(http://kasei.us/2009/09/sparql/data/data1.rdf http://kasei.us/2009/09/sparql/data/data2.rdf), + resp: { + status: %w(2XX 3XX), + "Content-Type": %w(application/sparql-results+xml application/sparql-results+json), + content: true + } + }], + }, + query_dataset_full: { + name: "query with protocol-specified dataset (both named and default graphs)", + req: [{ + method: :POST, + content: { + query: %( +ASK { + a ?type + GRAPH ?g1 { a ?type } + GRAPH ?g2 { a ?type } +} +), + 'default-graph-uri': 'http://kasei.us/2009/09/sparql/data/data3.rdf', + 'named-graph-uri': %w(http://kasei.us/2009/09/sparql/data/data1.rdf http://kasei.us/2009/09/sparql/data/data2.rdf), + }, + resp: { + status: %w(2XX 3XX), + "Content-Type": %w(application/sparql-results+xml application/sparql-results+json), + content: true + } + }], + }, + query_multiple_dataset: { + name: "query specifying dataset in both query string and protocol; test for use of protocol-specified dataset", + req: [{ + method: :POST, + content: { + query: 'ASK FROM { GRAPH ?g1 { a ?type } GRAPH ?g2 { a ?type } }', + 'named-graph-uri': %w(http://kasei.us/2009/09/sparql/data/data1.rdf http://kasei.us/2009/09/sparql/data/data2.rdf), + }, + resp: { + status: %w(2XX 3XX), + "Content-Type": %w(application/sparql-results+xml application/sparql-results+json), + content: true + } + }], + }, + query_content_type_select: { + name: "SELECT query appropriate content type (expect one of: XML, JSON, CSV, TSV)", + req: [{ + method: :POST, + content: { + query: 'SELECT (1 AS ?value) {}', + 'default-graph-uri': 'http://kasei.us/2009/09/sparql/data/data0.rdf', + }, + resp: { + status: %w(2XX 3XX), + "Content-Type": %w(application/sparql-results+xml application/sparql-results+json text/tab-separated-values text/csv) + } + }], + }, + query_content_type_ask: { + name: "ASK query appropriate content type (expect one of: XML, JSON)", + req: [{ + method: :POST, + content: { + query: 'ASK {}', + 'default-graph-uri': 'http://kasei.us/2009/09/sparql/data/data0.rdf', + }, + resp: { + status: %w(2XX 3XX), + "Content-Type": %w(application/sparql-results+xml application/sparql-results+json) + } + }], + }, + query_content_type_describe: { + name: "DESCRIBE query appropriate content type (expect one of: RDF/XML, Turtle, N-Triples, RDFa, JSON-LD)", + req: [{ + method: :POST, + content: { + query: 'DESCRIBE ', + 'default-graph-uri': 'http://kasei.us/2009/09/sparql/data/data0.rdf', + }, + resp: { + status: %w(2XX 3XX), + "Content-Type": %w(application/rdf+xml text/turtle application/n-triples text/html application/ld+json) + } + }], + }, + query_content_type_construct: { + name: "CONSTRUCT query appropriate content type (expect one of: RDF/XML, Turtle, N-Triples, RDFa, JSON-LD))", + req: [{ + method: :POST, + content: { + query: 'CONSTRUCT {

1 } WHERE {}', + 'default-graph-uri': 'http://kasei.us/2009/09/sparql/data/data0.rdf', + }, + resp: { + status: %w(2XX 3XX), + "Content-Type": %w(application/rdf+xml text/turtle application/n-triples text/html application/ld+json) + } + }], + }, + update_dataset_default_graph: { + name: "update with protocol-specified default graph", + req: [{ + method: :POST, + content: { + update: %( +PREFIX dc: +PREFIX foaf: +CLEAR ALL ; +INSERT DATA { + GRAPH { + a foaf:Document + } +} ; +INSERT { + GRAPH { + ?s a dc:BibliographicResource + } +} +WHERE { + ?s a foaf:Document +} +) +}, + 'using-graph-uri': 'http://kasei.us/2009/09/sparql/data/data1.rdf', + resp: { + status: %w(2XX 3XX) + } + }, { + method: :POST, + content: %( +ASK { + GRAPH { + a + } +} +), + 'Content-Type': 'application/sparql-query', + 'Accept': 'application/sparql-results+xml', + resp: { + status: %w(2XX 3XX), + 'Content-Type': 'application/sparql-results+xml' + } + }], + }, + update_dataset_default_graphs: { + name: "update with protocol-specified default graphs", + req: [{ + method: :POST, + content: { + update: %( +PREFIX dc: +PREFIX foaf: +DROP ALL ; +INSERT DATA { + GRAPH { a foaf:Document } + GRAPH { a foaf:Document } + GRAPH { a foaf:Document } +} ; +INSERT { + GRAPH { + ?s a dc:BibliographicResource + } +} +WHERE { + ?s a foaf:Document +} +) +}, + 'using-graph-uri': %w(http://kasei.us/2009/09/sparql/data/data1.rdf http://kasei.us/2009/09/sparql/data/data2.rdf), + resp: { + status: %w(2XX 3XX) + } + }, { + method: :POST, + content: %( +ASK { + GRAPH { + a . + a . + } + FILTER NOT EXISTS { + GRAPH { + a . + } + } +} +), + 'Content-Type': 'application/sparql-query', + 'Accept': 'application/sparql-results+xml', + resp: { + status: %w(2XX 3XX), + 'Content-Type': 'application/sparql-results+xml' + } + }], + }, + update_dataset_named_graphs: { + name: "update with protocol-specified named graphs", + req: [{ + method: :POST, + content: { + update: %( +PREFIX dc: +PREFIX foaf: +DROP ALL ; +INSERT DATA { + GRAPH { a foaf:Document } + GRAPH { a foaf:Document } + GRAPH { a foaf:Document } +} ; +INSERT { + GRAPH { + ?s a dc:BibliographicResource + } +} +WHERE { + GRAPH ?g { + ?s a foaf:Document + } +} +) +}, + 'using-graph-uri': %w(http://kasei.us/2009/09/sparql/data/data1.rdf http://kasei.us/2009/09/sparql/data/data2.rdf), + resp: { + status: %w(2XX 3XX) + } + }, { + method: :POST, + content: %( +ASK { + GRAPH { + a . + a . + } + FILTER NOT EXISTS { + GRAPH { + a . + } + } +} +), + 'Content-Type': 'application/sparql-query', + 'Accept': 'application/sparql-results+xml', + resp: { + status: %w(2XX 3XX), + 'Content-Type': 'application/sparql-results+xml' + } + }], + }, + update_dataset_full: { + name: "update with protocol-specified dataset (both named and default graphs)", + req: [{ + method: :POST, + update: %( +PREFIX dc: +PREFIX foaf: +DROP ALL ; +INSERT DATA { + GRAPH { a foaf:Document } + GRAPH { a foaf:Document } + GRAPH { a foaf:Document } +} ; +INSERT { + GRAPH { + ?s ?in + } +} +WHERE { + { + GRAPH ?g { ?s a foaf:Document } + BIND(?g AS ?in) + } + UNION + { + ?s a foaf:Document . + BIND("default" AS ?in) + } +} +), + 'using-graph-uri': %w(http://kasei.us/2009/09/sparql/data/data1.rdf http://kasei.us/2009/09/sparql/data/data2.rdf), + resp: { + status: %w(2XX 3XX) + } + }, { + method: :POST, + content: %( +ASK { + GRAPH { + "default" . + . + } + FILTER NOT EXISTS { + GRAPH { + ?p ?o + } + } +} +END +), + 'Content-Type': 'application/sparql-query', + 'Accept': 'application/sparql-results+xml', + resp: { + status: %w(2XX 3XX), + 'Content-Type': 'application/sparql-results+xml' + } + }], + }, + update_post_form: { + name: "update via URL-encoded POST", + req: [{ + method: :POST, + content: { + update: 'CLEAR ALL' + }, + resp: { + status: %w(2XX 3XX) + } + }] + }, + update_post_direct: { + name: "update via POST directly", + req: [{ + method: :POST, + content: 'CLEAR ALL', + 'Content-Type': 'application/sparql-update', + resp: { + status: %w(2XX 3XX) + } + }] + }, + update_base_uri: { + name: "test for service-defined BASE URI (\"which MAY be the service endpoint\")", + req: [{ + method: :POST, + content: { + update: 'CLEAR SILENT GRAPH ; INSERT DATA { GRAPH { } }' + }, + resp: { + status: %w(2XX 3XX) + } + }, { + method: :POST, + content: { + query: 'SELECT ?o WHERE { GRAPH { ?o } }' + }, + 'Accept': 'application/sparql-results+xml', + resp: { + status: %w(2XX 3XX), + 'Content-Type': 'application/sparql-results+xml', + content: "one result with `?o` bound to an IRI that is _not_ ``" + } + }] + }, +} + +NEGATIVE_TESTS = { + bad_query_method: { + name: "invoke query operation with a method other than GET or POST", + req: [{ + method: :PUT, + query: "ASK {}", + "default-graph-uri": "http://kasei.us/2009/09/sparql/data/data0.rdf", + resp: { + status: "4XX" + } + }], + }, + bad_multiple_queries: { + name: "invoke query operation with more than one query string", + req: [{ + method: :GET, + query: ["ASK {}", "SELECT * {}"], + "default-graph-uri": "http://kasei.us/2009/09/sparql/data/data0.rdf", + resp: { + status: "4XX" + } + }], + }, + bad_query_wrong_media_type: { + name: "invoke query operation with a POST with media type that's not url-encoded or application/sparql-query", + req: [{ + method: :POST, + "default-graph-uri": "http://kasei.us/2009/09/sparql/data/data0.rdf", + 'Content-Type': 'text/plain', + content: 'ASK {}', + resp: { + status: "4XX" + } + }], + }, + bad_query_missing_form_type: { + name: "invoke query operation with url-encoded body, but without application/x-www-form-urlencoded media type", + req: [{ + method: :POST, + content: { + query: "ASK {}", + "default-graph-uri": "http://kasei.us/2009/09/sparql/data/data0.rdf" + }, + 'Content-Type': nil, + resp: { + status: "4XX" + } + }], + }, + bad_query_missing_direct_type: { + name: "invoke query operation with SPARQL body, but without application/sparql-query media type", + req: [{ + method: :POST, + "default-graph-uri": "http://kasei.us/2009/09/sparql/data/data0.rdf", + content: "ASK {}", + resp: { + status: "4XX" + } + }], + }, + bad_query_non_utf8: { + name: "invoke query operation with direct POST, but with a non-UTF8 encoding (UTF-16)", + req: [{ + method: :POST, + "default-graph-uri": "http://kasei.us/2009/09/sparql/data/data0.rdf", + 'Content-Type': 'application/sparql-query; charset=UTF-16', + content: 'ASK {}', + resp: { + status: "4XX" + } + }], + }, + bad_query_syntax: { + name: "invoke query operation with invalid query syntax (4XX result)", + req: [{ + method: :GET, + query: 'ASK {}', + "default-graph-uri": "http://kasei.us/2009/09/sparql/data/data0.rdf", + resp: { + status: "4XX" + } + }], + }, + bad_update_get: { + name: "invoke update operation with GET", + req: [{ + method: :GET, + update: 'CLEAR ALL', + "using-graph-uri": "http://kasei.us/2009/09/sparql/data/data0.rdf", + resp: { + status: "4XX" + } + }], + }, + bad_multiple_updates: { + name: "invoke update operation with more than one update string", + req: [{ + method: :POST, + content: { + update: ['CLEAR ALL', 'CLEAR DEFAULT'] + }, + "using-graph-uri": "http://kasei.us/2009/09/sparql/data/data0.rdf", + resp: { + status: "4XX" + } + }], + }, + bad_update_wrong_media_type: { + name: "invoke update operation with a POST with media type that's not url-encoded or application/sparql-update", + req: [{ + method: :POST, + content: 'CLEAR NAMED', + "using-graph-uri": "http://kasei.us/2009/09/sparql/data/data0.rdf", + 'Content-Type': 'text/plain', + resp: { + status: "4XX" + } + }], + }, + bad_update_missing_form_type: { + name: "invoke update operation with url-encoded body, but without application/x-www-form-urlencoded media type", + req: [{ + method: :POST, + content: 'CLEAR NAMED', + "using-graph-uri": "http://kasei.us/2009/09/sparql/data/data0.rdf", + 'Content-Type': nil, + resp: { + status: "4XX" + } + }], + }, + bad_update_non_utf8: { + name: "invoke update operation with direct POST, but with a non-UTF8 encoding", + req: [{ + method: :POST, + content: 'CLEAR NAMED', + "using-graph-uri": "http://kasei.us/2009/09/sparql/data/data0.rdf", + 'Content-Type': 'application/sparql-update; charset=UTF-16', + resp: { + status: "4XX" + } + }], + }, + bad_update_syntax: { + name: "invoke update operation with invalid update syntax (4XX result)", + req: [{ + method: :POST, + content: { + update: 'CLEAR XYZ' + }, + "using-graph-uri": "http://kasei.us/2009/09/sparql/data/data0.rdf", + resp: { + status: "4XX" + } + }], + }, + bad_update_dataset_conflict: { + name: "invoke update with both using-graph-uri/using-named-graph-uri parameter and USING/WITH clause", + req: [{ + method: :POST, + content: { + "using-named-graph-uri": "http://example/people", + update: %( +PREFIX foaf: +WITH +DELETE { ?person foaf:givenName 'Bill' } +INSERT { ?person foaf:givenName 'William' } +WHERE { + ?person foaf:givenName 'Bill' +} +), + }, + "Content-Type": "application/x-www-form-urlencoded", + resp: { + status: "4XX" + } + }], + }, +} + +def req_uri(params) + params.map do |key, values| + unless %i(method name content resp Content-Type Accept).include?(key) + Array(values).map do |value| + "#{key}=#{CGI.escape(value.to_s).gsub('+', '%20')}" + end.join('&') + end + end.compact.join('&') +end + +def encode_header(params, field) + values = Array(params[field]).map(&:to_s) + h_field = { + "@type": "ht:RequestHeader", + "ht:fieldName": field, + "ht:fieldValue": Array(values).join(', ') + } + + values.each do |value| + value, *params = value.split(';').map(&:strip) + element = { + "@type": "ht:HeaderElement", + "ht:elementName": value + } + params.each do |param| + p, v = param.split('=') + pv = v.sub(/^["']?([^"']*)["']?$/, '\1') + # Remember charset for body encoding + $charset = pv if p.downcase == 'charset' + param = { + "@type": "ht:Parameter", + "ht:paramName": p, + "ht:paramValue": pv + } + + (element[:params] ||= []) << param + end + + (h_field[:headerElements] ||= []) << element + end + + h_field +end + +def encode_body(content) + content = req_uri(content) if content.is_a?(Hash) + { + "@type": "cnt:ContentAsText", + "cnt:chars": content, + "cnt:characterEncoding": $charset + } +end + +def gen_entry(frag, params) + $charset = "UTF-8" + entry = { + '@id': "##{frag}", + "@type": "mf:ProtocolTest", + "name": params.delete(:name), + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [] + } + } + requests = entry[:action][:requests] + params[:req].each do |req| + uri_query = req_uri(req) + path = uri_query.to_s.empty? ? "/sparql" : "/sparql?#{uri_query}" + request = { + "@type": "ht:Request", + "ht:methodName": req[:method], + "ht:httpVersion": "1.1", + "ht:absolutePath": path, + } + + # Headers + (request[:headers] ||= []) << encode_header(req, :Accept) if + req[:Accept] + + # Default Content-Type on POST + req[:'Content-Type'] = "application/x-www-form-urlencoded" if + req[:method] == :POST && !req.key?(:'Content-Type') + + (request[:headers] ||= []) << encode_header(req, :'Content-Type') if + req[:'Content-Type'] + + request[:"ht:body"] = encode_body(req[:content]) if req[:content] + + if resp = req.delete(:resp) + response = { + "@type": "ht:Response", + "ht:statusCodeValue": Array(resp[:status]) + } + + (response[:headers] ||= []) << encode_header(resp, :'Content-Type') if + resp[:'Content-Type'] + + response[:"ht:body"] = encode_body(resp[:content]) if resp[:content] + + request[:"ht:resp"] = response + end + + requests << request + end + entry +end + +def validate(reader) + RDF::Reasoner.apply(:rdfs, :owl) + graph = RDF::Graph.new {|g| g << reader} + graph.entail! + messages = graph.lint + messages.each do |kind, term_messages| + term_messages.each do |term, messages| + STDERR.puts "#{kind} #{term}" + messages.each {|m| options[:output].puts " #{m}"} + end + end + exit 1 unless messages.empty? +end + +# Generate JSON-LD describing the test manifest +man = { + "@context": { + "@base": "http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest", + "cnt": "http://www.w3.org/2011/content#", + "dawgt": "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#", + "ht": "http://www.w3.org/2011/http#", + "mf": "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#", + "mq": "http://www.w3.org/2001/sw/DataAccess/tests/test-query#", + "rdfs": "http://www.w3.org/2000/01/rdf-schema#", + "xsd": "http://www.w3.org/2001/XMLSchema#", + + "action": {"@id": "mf:action", "@type": "@id"}, + "approval": {"@id": "dawgt:approval", "@type": "@id"}, + "approvedBy": {"@id": "dawgt:approvedBy", "@type": "@id"}, + "comment": {"@id": "rdfs:comment"}, + "data": {"@id": "mq:data", "@type": "@id"}, + "entries": {"@id": "mf:entries", "@container": "@list", "@type": "@id"}, + "feature": {"@id": "mf:feature", "@type": "@vocab"}, + "graphData": {"@id": "mq:graphData", "@type": "@id"}, + "label": {"@id": "rdfs:label"}, + "name": {"@id": "mf:name"}, + "notable": {"@id": "mf:notable", "@type": "@vocab"}, + "query": {"@id": "mq:query", "@type": "@id"}, + "queryForm": {"@id": "mq:queryForm", "@type": "@vocab"}, + "requires": {"@id": "mf:requires", "@type": "@vocab", "@container": "@set"}, + "result": {"@id": "mf:result", "@type": "@id"}, + + "headerElements": {"@id": "ht:headerElements", "@container": "@list"}, + "headers": {"@id": "ht:headers", "@container": "@list"}, + "params": {"@id": "ht:params", "@container": "@list"}, + "requests": {"@id": "ht:requests", "@container": "@list"}, + }, + "@id": "", + "@type": "mf:Manifest", + "label": "SPARQL Protocol", + "comment": %( +Test descriptions used for generating Manifest and HTML renderings. +Test HTTP connection described using HTTP and CNT vocabularies. +In responses, status values such as "2XX", "3XX" are used to match the actual response status. +Multiple values for Content-Type mean that the response MUST include one or more of these types. +Responses for ASK match any specified boolean content. +Some tests require special result processing. + ), + "entries": [] +} + +POSITIVE_TESTS.merge(NEGATIVE_TESTS).each do |frag, params| + entry = gen_entry(frag, params) + man[:entries] << entry +end + +OPT_ARGS = [ + ["--help", "-?", GetoptLong::NO_ARGUMENT, "print this message"], + ["--format", "-f", GetoptLong::REQUIRED_ARGUMENT, "Output format (jsonld, ttl or html)"], + ["--output", "-o", GetoptLong::REQUIRED_ARGUMENT, "Output to specified file"], + ["--validate", GetoptLong::NO_ARGUMENT, "Validate the resulting graph"], +] + +def usage(**options) + STDERR.puts %{ + generate protocol manifests + + Usage: #{$0} [options] + }.gsub(/^ /, '') + width = OPT_ARGS.map do |o| + l = o.first.length + l += o[1].length + 2 if o[1].is_a?(String) + l + end.max + OPT_ARGS.each do |o| + s = " %-*s " % [width, (o[1].is_a?(String) ? "#{o[0,2].join(', ')}" : o[0])] + s += o.last + STDERR.puts s + end + exit(1) +end + +opts = GetoptLong.new(*OPT_ARGS.map {|o| o[0..-2]}) + +format = :jsonld +output = $stdout +validate = false + +opts.each do |opt, arg| + case opt + when '--help' then usage + when '--format' then format = arg.to_sym + when '--output' then output = File.open(arg, "w") + when '--validate' then validate = true + end +end + +case format +when :html + template = File.read(File.expand_path('../template.haml', __FILE__)) + engine = Haml::Engine.new(template, format: :html5) + html = engine.render(self, man: JSON.parse(man.to_json)) + output.write(html) +when :jsonld + validate(JSON::LD::Reader.new(man.to_json)) if validate + output.puts man.to_json(JSON::LD::JSON_STATE) +when :ttl + JSON::LD::Reader.new(man.to_json) do |reader| + ttl = RDF::Turtle::Writer.buffer( + prefixes: { + "": "http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#", + cnt: "http://www.w3.org/2011/content#", + dawgt: "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#", + ht: "http://www.w3.org/2011/http#", + mf: "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#", + qt: "http://www.w3.org/2001/sw/DataAccess/tests/test-query#", + rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + rdfs: "http://www.w3.org/2000/01/rdf-schema#", + } + ) {|writer| writer << reader} + + validate(RDF::Turtle::Reader.new(ttl)) if validate + + # Do some result hacking + ttl.sub!('', '<>') + ttl.sub!(/mf:entries \((.*)\) \.$/) do |matched| + matched.sub('(:', '( :').gsub(' :', "\n :") + end + + output.write(ttl) + end +else + STDERR.puts "unknown output format #{format}" + usage +end + diff --git a/sparql11/data-sparql11/protocol/index.html b/sparql11/data-sparql11/protocol/index.html index 463cddf1..96b88fe0 100644 --- a/sparql11/data-sparql11/protocol/index.html +++ b/sparql11/data-sparql11/protocol/index.html @@ -1,1105 +1,2241 @@ - - - - - - - - SPARQL Protocol - - - - -

- - W3C - -

-

SPARQL Protocol

-

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

-
-
-

Abstract

-

- -

-

This page describes W3C SPARQL Working Group's SPARQL1.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:

- -
    -
  • "query_url" -- query endpoint URL
  • -
  • "update_url" -- update endpoint URL
  • -
  • "software" -- The Protocol implementation IRI that will be used if conneg is used and requests RDF
  • -
- -

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

- -
    -
  • does the default graph change based on other graphs (e.g. acts as the union of named graphs)?
  • -
- -

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:

- -
    -
  • Select expressions
  • -
  • CLEAR
  • -
  • DROP
  • -
  • LOAD
  • -
- -

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

- -
    -
  • http://kasei.us/2009/09/sparql/data/data0.rdf
  • -
  • http://kasei.us/2009/09/sparql/data/data1.rdf
  • -
  • http://kasei.us/2009/09/sparql/data/data2.rdf
  • -
  • http://kasei.us/2009/09/sparql/data/data3.rdf
  • -
- -

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 -

-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#query_post_form: - - query via URL-encoded POST -
-
-
-

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/x-www-form-urlencoded
Content-Length: XXX

query=ASK%20%7B%7D
- -

Response

- -
2xx or 3xx response
Content-Type: application/sparql-results+xml or application/sparql-results+json

true
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#query_dataset_default_graphs_get: - - GET query with protocol-specified default graph -
-
-
-

Request

- -
GET /sparql?query=ASK%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20.%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20.%20%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf
Host: www.example
User-agent: sparql-client/0.1
- -

Response

- -
2xx or 3xx response
Content-Type: application/sparql-results+xml or application/sparql-results+json

true
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#query_dataset_default_graphs_post: - - POST query with protocol-specified default graphs -
-
-
-

Request

- -
POST /sparql/?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/sparql-query
Content-Length: XXX

ASK { <http://kasei.us/2009/09/sparql/data/data1.rdf> ?p ?o . <http://kasei.us/2009/09/sparql/data/data2.rdf> ?p ?o }
- -

Response

- -
2xx or 3xx response
Content-Type: application/sparql-results+xml or application/sparql-results+json

true
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#query_dataset_named_graphs_post: - - POST query with protocol-specified named graphs -
-
-
-

Request

- -
POST /sparql/?named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/sparql-query
Content-Length: XXX

ASK { GRAPH ?g { ?s ?p ?o } }
- -

Response

- -
2xx or 3xx response
Content-Type: application/sparql-results+xml or application/sparql-results+json

true
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#query_dataset_named_graphs_get: - - GET query with protocol-specified named graphs -
-
-
-

Request

- -
GET /sparql/?named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf&query=ASK%20%7B%20GRAPH%20%3Fg%20%7B%20%3Fs%20%3Fp%20%3Fo%20%7D%20%7D HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
- -

Response

- -
2xx or 3xx response
Content-Type: application/sparql-results+xml or application/sparql-results+json

true
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#query_dataset_full: - - query with protocol-specified dataset (both named and default graphs) -
-
-
-

Request

- -
POST /sparql/?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/sparql-query
Content-Length: XXX

SELECT ?g ?x ?s { ?x ?y ?o  GRAPH ?g { ?s ?p ?o } }
- -

Response

- -
2xx or 3xx response
Content-Type: application/sparql-results+xml or application/sparql-results+json

true
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#query_multiple_dataset: - - query specifying dataset in both query string and protocol; test for use of protocol-specified dataset -
-
-
-

Request

- -
POST /sparql/?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/sparql-query
Content-Length: XXX

ASK FROM <http://kasei.us/2009/09/sparql/data/data1.rdf> { <data1.rdf> ?p ?o }
- -

Response

- -
2xx or 3xx response
Content-Type: application/sparql-results+xml or application/sparql-results+json

true
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#query_get: - - query via GET -
-
-
-

Request

- -
GET /sparql?query=ASK%20%7B%7D
- -

Response

- -
2xx or 3xx response
Content-Type: application/sparql-results+xml or application/sparql-results+json

true
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#query_content_type_select: - - query appropriate content type (expect one of: XML, JSON, CSV, TSV) -
-
-
-

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/sparql-query
Content-Length: XXX

SELECT (1 AS ?value) {}
- -

Response

- -
2xx or 3xx response
Content-Type: application/sparql-results+xml, application/sparql-results+json, text/tab-separated-values, or text/csv
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#query_content_type_ask: - - query appropriate content type (expect one of: XML, JSON) -
-
-
-

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/sparql-query
Content-Length: XXX

ASK {}
- -

Response

- -
2xx or 3xx response
Content-Type: application/sparql-results+xml or application/sparql-results+json
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#query_content_type_describe: - - query appropriate content type (expect one of: RDF/XML, Turtle, N-Triples, RDFa) -
-
-
-

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/sparql-query
Content-Length: XXX

DESCRIBE <http://example.org/>
- -

Response

- -
2xx or 3xx response
Content-Type: application/rdf+xml, application/rdf+json or text/turtle
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#query_content_type_construct: - - query appropriate content type (expect one of: RDF/XML, Turtle, N-Triples, RDFa) -
-
-
-

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/sparql-query
Content-Length: XXX

CONSTRUCT { <s> <p> 1 } WHERE {}
- -

Response

- -
2xx or 3xx response
Content-Type: application/rdf+xml, application/rdf+json or text/turtle
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#update_dataset_default_graph: - - update with protocol-specified default graph -
-
-
-

Request

- -
POST /sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/sparql-update
Content-Length: XXX

PREFIX dc: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
CLEAR ALL ;
INSERT DATA {
    GRAPH <http://kasei.us/2009/09/sparql/data/data1.rdf> {
        <http://kasei.us/2009/09/sparql/data/data1.rdf> a foaf:Document
    }
} ;
INSERT {
    GRAPH <http://example.org/protocol-update-dataset-test/> {
        ?s a dc:BibliographicResource
    }
}
WHERE {
    ?s a foaf:Document
}
- -

Response

- -
2xx or 3xx response
- -

followed by

- -

Request

- -
POST /sparql HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Accept: application/sparql-results+xml
Content-Type: application/sparql-query
Content-Length: XXX

ASK {
    GRAPH <http://example.org/protocol-update-dataset-test/> {
        <http://kasei.us/2009/09/sparql/data/data1.rdf> a <http://purl.org/dc/terms/BibliographicResource>
    }
}
- -

Response

- -
2xx or 3xx response
Content-Type: application/sparql-results+xml

true
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#update_dataset_default_graphs: - - update with protocol-specified default graphs -
-
-
-

Request

- -
POST /sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/sparql-update
Content-Length: XXX

PREFIX dc: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
CLEAR ALL ;
INSERT DATA {
    GRAPH <http://kasei.us/2009/09/sparql/data/data1.rdf> { <http://kasei.us/2009/09/sparql/data/data1.rdf> a foaf:Document }
    GRAPH <http://kasei.us/2009/09/sparql/data/data2.rdf> { <http://kasei.us/2009/09/sparql/data/data2.rdf> a foaf:Document }
    GRAPH <http://kasei.us/2009/09/sparql/data/data3.rdf> { <http://kasei.us/2009/09/sparql/data/data3.rdf> a foaf:Document }
} ;
INSERT {
    GRAPH <http://example.org/protocol-update-dataset-graphs-test/> {
        ?s a dc:BibliographicResource
    }
}
WHERE {
    ?s a foaf:Document
}
- -

Response

- -
2xx or 3xx response
- -

followed by

- -

Request

- -
POST /sparql HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Accept: application/sparql-results+xml
Content-Type: application/sparql-query
Content-Length: XXX

ASK {
    GRAPH <http://example.org/protocol-update-dataset-graphs-test/> {
        <http://kasei.us/2009/09/sparql/data/data1.rdf> a <http://purl.org/dc/terms/BibliographicResource> .
        <http://kasei.us/2009/09/sparql/data/data2.rdf> a <http://purl.org/dc/terms/BibliographicResource> .
    }
    FILTER NOT EXISTS {
        GRAPH <http://example.org/protocol-update-dataset-graphs-test/> {
            <http://kasei.us/2009/09/sparql/data/data3.rdf> a <http://purl.org/dc/terms/BibliographicResource> .
        }
    }
}
- -

Response

- -
2xx or 3xx response
Content-Type: application/sparql-results+xml

true
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#update_dataset_named_graphs: - - update with protocol-specified named graphs -
-
-
-

Request

- -
POST /sparql?using-named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/sparql-update
Content-Length: XXX

PREFIX dc: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
CLEAR ALL ;
INSERT DATA {
    GRAPH <http://kasei.us/2009/09/sparql/data/data1.rdf> { <http://kasei.us/2009/09/sparql/data/data1.rdf> a foaf:Document }
    GRAPH <http://kasei.us/2009/09/sparql/data/data2.rdf> { <http://kasei.us/2009/09/sparql/data/data2.rdf> a foaf:Document }
    GRAPH <http://kasei.us/2009/09/sparql/data/data3.rdf> { <http://kasei.us/2009/09/sparql/data/data3.rdf> a foaf:Document }
} ;
INSERT {
    GRAPH <http://example.org/protocol-update-dataset-named-graphs-test/> {
        ?s a dc:BibliographicResource
    }
}
WHERE {
    GRAPH ?g {
        ?s a foaf:Document
    }
}
- -

Response

- -
2xx or 3xx response
- -

followed by

- -

Request

- -
POST /sparql HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Accept: application/sparql-results+xml
Content-Type: application/sparql-query
Content-Length: XXX

ASK {
    GRAPH <http://example.org/protocol-update-dataset-named-graphs-test/> {
        <http://kasei.us/2009/09/sparql/data/data1.rdf> a <http://purl.org/dc/terms/BibliographicResource> .
        <http://kasei.us/2009/09/sparql/data/data2.rdf> a <http://purl.org/dc/terms/BibliographicResource> .
    }
    FILTER NOT EXISTS {
        GRAPH <http://example.org/protocol-update-dataset-named-graphs-test/> {
            <http://kasei.us/2009/09/sparql/data/data3.rdf> a <http://purl.org/dc/terms/BibliographicResource> .
        }
    }
}
- -

Response

- -
2xx or 3xx response
Content-Type: application/sparql-results+xml

true
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#update_dataset_full: - - update with protocol-specified dataset (both named and default graphs) -
-
-
-

Request

- -
POST /sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/sparql-update
Content-Length: XXX

PREFIX dc: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
CLEAR ALL ;
INSERT DATA {
    GRAPH <http://kasei.us/2009/09/sparql/data/data1.rdf> { <http://kasei.us/2009/09/sparql/data/data1.rdf> a foaf:Document }
    GRAPH <http://kasei.us/2009/09/sparql/data/data2.rdf> { <http://kasei.us/2009/09/sparql/data/data2.rdf> a foaf:Document }
    GRAPH <http://kasei.us/2009/09/sparql/data/data3.rdf> { <http://kasei.us/2009/09/sparql/data/data3.rdf> a foaf:Document }
} ;
INSERT {
    GRAPH <http://example.org/protocol-update-dataset-full-test/> {
        ?s <http://example.org/in> ?in
    }
}
WHERE {
    {
        GRAPH ?g { ?s a foaf:Document }
        BIND(?g AS ?in)
    }
    UNION
    {
        ?s a foaf:Document .
        BIND("default" AS ?in)
    }
}
- -

Response

- -
2xx or 3xx response
- -

followed by

- -

Request

- -
POST /sparql HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Accept: application/sparql-results+xml
Content-Type: application/sparql-query
Content-Length: XXX

ASK {
    GRAPH <http://example.org/protocol-update-dataset-full-test/> {
        <http://kasei.us/2009/09/sparql/data/data1.rdf> <http://example.org/in> "default" .
        <http://kasei.us/2009/09/sparql/data/data2.rdf> <http://example.org/in> <http://kasei.us/2009/09/sparql/data/data2.rdf> .
    }
    FILTER NOT EXISTS {
        GRAPH <http://example.org/protocol-update-dataset-full-test/> {
            <http://kasei.us/2009/09/sparql/data/data3.rdf> ?p ?o
        }
    }
}
- -

Response

- -
2xx or 3xx response
Content-Type: application/sparql-results+xml

true
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#update_post_form: - - update via URL-encoded POST -
-
-
-

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/x-www-form-urlencoded
Content-Length: XXX

update=CLEAR%20ALL
- -

Response

- -
2xx or 3xx response
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#update_post_direct: - - update via POST directly -
-
-
-

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/sparql-update
Content-Length: XXX

CLEAR ALL
- -

Response

- -
2xx or 3xx response
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#update_base_uri: - - test for service-defined BASE URI ("which MAY be the service endpoint") -
-
-
-

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/sparql-update
Content-Length: XXX

CLEAR GRAPH <http://example.org/protocol-base-test/> ;
INSERT DATA { GRAPH <http://example.org/protocol-base-test/> { <http://example.org/s> <http://example.org/p> <test> } }
- -

Response

- -
2xx or 3xx response
- -

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/sparql-query
Accept: application/sparql-results+xml
Content-Length: XXX

SELECT ?o WHERE {
    GRAPH <http://example.org/protocol-base-test/> {
        <http://example.org/s> <http://example.org/p> ?o
    }
}
- -

Response

- -
2xx or 3xx response
Content-Type: application/sparql-results+xml

one result with `?o` bound to an IRI that is _not_ `<test>`
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#query_post_direct: - - query via POST directly -
-
-
-

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/sparql-query
Content-Length: XXX

ASK {}
- -

Response

- -
2xx or 3xx response
Content-Type: application/sparql-results+xml or application/sparql-results+json

true
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#bad_query_method: - - invoke query operation with a method other than GET or POST -
-
-
-

Request

- -
PUT /sparql?query=ASK%20%7B%7D            
- -

Response

- -
4xx
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#bad_multiple_queries: - - invoke query operation with more than one query string -
-
-
-

Request

- -
GET /sparql?query=ASK%20%7B%7D&query=SELECT%20%2A%20%7B%7D
- -

Response

- -
4xx
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#bad_query_wrong_media_type: - - invoke query operation with a POST with media type that's not url-encoded or application/sparql-query -
-
-
-

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: text/plain
Content-Length: XXX

ASK {}
- -

Response

- -
4xx
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#bad_query_missing_form_type: - - invoke query operation with url-encoded body, but without application/x-www-form-urlencoded media type -
-
-
-

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Length: XXX

query=ASK%20%7B%7D
- -

Response

- -
4xx
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#bad_query_missing_direct_type: - - invoke query operation with SPARQL body, but without application/sparql-query media type -
-
-
-

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Length: XXX

ASK {}
- -

Response

- -
4xx
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#bad_query_non_utf8: - - invoke query operation with direct POST, but with a non-UTF8 encoding (UTF-16) -
-
-
-

(content body encoded in utf-16)

- -

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/sparql-query; charset=UTF-16
Content-Length: XXX

ASK {}
- -

Response

- -
4xx
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#bad_query_syntax: - - invoke query operation with invalid query syntax (4XX result) -
-
-
-

Request

- -
GET /sparql?query=ASK%20%7B
- -

Response

- -
4xx
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#bad_update_get: - - invoke update operation with GET -
-
-
-

Request

- -
GET /sparql?update=CLEAR%20ALL
- -

Response

- -
4xx
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#bad_multiple_updates: - - invoke update operation with more than one update string -
-
-
-

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/x-www-form-urlencoded
Content-Length: XXX

update=CLEAR%20NAMED&update=CLEAR%20DEFAULT
- -

Response

- -
4xx
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#bad_update_wrong_media_type: - - invoke update operation with a POST with media type that's not url-encoded or application/sparql-update -
-
-
-

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: text/plain
Content-Length: XXX

CLEAR NAMED
- -

Response

- -
4xx
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#bad_update_missing_form_type: - - invoke update operation with url-encoded body, but without application/x-www-form-urlencoded media type -
-
-
-

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Length: XXX

update=CLEAR%20NAMED
- -

Response

- -
4xx
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#bad_update_non_utf8: - - invoke update operation with direct POST, but with a non-UTF8 encoding -
-
-
-

(content body encoded in utf-16)

- -

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/sparql-update; charset=UTF-16
Content-Length: XXX

CLEAR NAMED
- -

Response

- -
4xx
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#bad_update_syntax: - - invoke update operation with invalid update syntax -
-
-
-

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/x-www-form-urlencoded
Content-Length: XXX

update=CLEAR%20XYZ
- -

Response

- -
4xx
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#bad_update_dataset_conflict: - - invoke update with both using-graph-uri/using-named-graph-uri parameter and USING/WITH clause -
-
-
-

Request

- -
POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/x-www-form-urlencoded
Content-Length: XXX

using-named-graph-uri=http%3A%2F%2Fexample%2Fpeople&update=%09%09PREFIX%20foaf%3A%20%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0A%09%09WITH%20%3Chttp%3A%2F%2Fexample%2Faddresses%3E%0A%09%09DELETE%20%7B%20%3Fperson%20foaf%3AgivenName%20%27Bill%27%20%7D%0A%09%09INSERT%20%7B%20%3Fperson%20foaf%3AgivenName%20%27William%27%20%7D%0A%09%09WHERE%20%7B%0A%09%09%09%3Fperson%20foaf%3AgivenName%20%27Bill%27%0A%09%09%7D%0A
- -

Response

- -
4xx
-
-
-
type
-
mf:ProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 -
-
-
-
-
- - + + + + + + + +SPARQL Protocol + + + + +

+ +W3C + +

+

SPARQL Protocol

+

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

+
+
+

Abstract

+

+Test descriptions used for generating Manifest and HTML renderings. Test HTTP connection described using HTTP and CNT vocabularies. In responses, status values such as "2XX", "3XX" are used to match the actual response status. Multiple values for Content-Type mean that the response MUST include one or more of these types. Responses for ASK match any specified boolean content. Some tests require special result processing. +

+

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

+ +

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

+ +
    +
  • Select expressions
  • +
  • CLEAR
  • +
  • DROP
  • +
  • LOAD
  • +
+ +

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

+ +
    +
  • http://kasei.us/2009/09/sparql/data/data0.rdf
  • +
  • http://kasei.us/2009/09/sparql/data/data1.rdf
  • +
  • http://kasei.us/2009/09/sparql/data/data2.rdf
  • +
  • http://kasei.us/2009/09/sparql/data/data3.rdf
  • +
+ +

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_get: + +query via GET +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+GET +/sparql?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +HTTP/1.1
+Host: www.example +
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/sparql-results+xml +or +application/sparql-results+json + +
+
+
+
+ +true +
+
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/sparql-results+xml +or +application/sparql-results+json + +
+
+
+
+ +true +
+
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/sparql-query + +
+
+
+
+ +ASK {} +
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/sparql-results+xml +or +application/sparql-results+json + +
+
+
+
+ +true +
+
+
+
+
+
+ +#query_dataset_default_graph: + +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 +
+
+
+ +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +query=ASK%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%3Fp%20%3Fo%20%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf +
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/sparql-results+xml +or +application/sparql-results+json + +
+
+
+
+ +true +
+
+
+
+
+
+ +#query_dataset_default_graphs_get: + +GET 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 +
+
+
+ +
+
+

Request

+GET +/sparql?query=ASK%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20.%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20.%20%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf +HTTP/1.1
+Host: www.example +
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/sparql-results+xml +or +application/sparql-results+json + +
+
+
+
+ +true +
+
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +query=ASK%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20.%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20.%20%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf +
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/sparql-results+xml +or +application/sparql-results+json + +
+
+
+
+ +true +
+
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +query=ASK%20%7B%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%20%7D&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf +
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/sparql-results+xml +or +application/sparql-results+json + +
+
+
+
+ +true +
+
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+GET +/sparql?query=ASK%20%7B%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%20%7D&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf +HTTP/1.1
+Host: www.example +
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/sparql-results+xml +or +application/sparql-results+json + +
+
+
+
+ +true +
+
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +query=%0AASK%20%7B%0A%20%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20%3Ftype%0A%20%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%0A%20%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%0A%7D%0A&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf +
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/sparql-results+xml +or +application/sparql-results+json + +
+
+
+
+ +true +
+
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +query=ASK%20FROM%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%20%7D&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf +
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/sparql-results+xml +or +application/sparql-results+json + +
+
+
+
+ +true +
+
+
+
+
+
+ +#query_content_type_select: + +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 +
+
+
+ +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +query=SELECT%20%281%20AS%20%3Fvalue%29%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/sparql-results+xml +or +application/sparql-results+json +or +text/tab-separated-values +or +text/csv + +
+
+
+
+
+
+
+ +#query_content_type_ask: + +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 +
+
+
+ +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/sparql-results+xml +or +application/sparql-results+json + +
+
+
+
+
+
+
+ +#query_content_type_describe: + +DESCRIBE query appropriate content type (expect one of: RDF/XML, Turtle, N-Triples, RDFa, JSON-LD) +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +query=DESCRIBE%20%3Chttp%3A%2F%2Fexample.org%2F%3E&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/rdf+xml +or +text/turtle +or +application/n-triples +or +text/html +or +application/ld+json + +
+
+
+
+
+
+
+ +#query_content_type_construct: + +CONSTRUCT query appropriate content type (expect one of: RDF/XML, Turtle, N-Triples, RDFa, JSON-LD)) +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +query=CONSTRUCT%20%7B%20%3Cs%3E%20%3Cp%3E%201%20%7D%20WHERE%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/rdf+xml +or +text/turtle +or +application/n-triples +or +text/html +or +application/ld+json + +
+
+
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ACLEAR%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%0A%20%20%20%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%0A%20%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20a%20dc%3ABibliographicResource%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20%3Fs%20a%20foaf%3ADocument%0A%7D%0A +
+
+
+

Response

+2XX +or3XX + +response + +
+
+
+followed by +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+ +
+Accept: +application/sparql-results+xml + +
+
+Content-Type: +application/sparql-query + +
+
+
+
+ + +ASK { + GRAPH <http://example.org/protocol-update-dataset-test/> { + <http://kasei.us/2009/09/sparql/data/data1.rdf> a <http://purl.org/dc/terms/BibliographicResource> + } +} + +
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/sparql-results+xml + +
+
+
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ADROP%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-graphs-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20a%20dc%3ABibliographicResource%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20%3Fs%20a%20foaf%3ADocument%0A%7D%0A +
+
+
+

Response

+2XX +or3XX + +response + +
+
+
+followed by +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+ +
+Accept: +application/sparql-results+xml + +
+
+Content-Type: +application/sparql-query + +
+
+
+
+ + +ASK { + GRAPH <http://example.org/protocol-update-dataset-graphs-test/> { + <http://kasei.us/2009/09/sparql/data/data1.rdf> a <http://purl.org/dc/terms/BibliographicResource> . + <http://kasei.us/2009/09/sparql/data/data2.rdf> a <http://purl.org/dc/terms/BibliographicResource> . + } + FILTER NOT EXISTS { + GRAPH <http://example.org/protocol-update-dataset-graphs-test/> { + <http://kasei.us/2009/09/sparql/data/data3.rdf> a <http://purl.org/dc/terms/BibliographicResource> . + } + } +} + +
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/sparql-results+xml + +
+
+
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ADROP%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-named-graphs-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20a%20dc%3ABibliographicResource%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20GRAPH%20%3Fg%20%7B%0A%20%20%20%20%3Fs%20a%20foaf%3ADocument%0A%20%20%7D%0A%7D%0A +
+
+
+

Response

+2XX +or3XX + +response + +
+
+
+followed by +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+ +
+Accept: +application/sparql-results+xml + +
+
+Content-Type: +application/sparql-query + +
+
+
+
+ + +ASK { + GRAPH <http://example.org/protocol-update-dataset-named-graphs-test/> { + <http://kasei.us/2009/09/sparql/data/data1.rdf> a <http://purl.org/dc/terms/BibliographicResource> . + <http://kasei.us/2009/09/sparql/data/data2.rdf> a <http://purl.org/dc/terms/BibliographicResource> . + } + FILTER NOT EXISTS { + GRAPH <http://example.org/protocol-update-dataset-named-graphs-test/> { + <http://kasei.us/2009/09/sparql/data/data3.rdf> a <http://purl.org/dc/terms/BibliographicResource> . + } + } +} + +
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/sparql-results+xml + +
+
+
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql?update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ADROP%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-full-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20%3Chttp%3A%2F%2Fexample.org%2Fin%3E%20%3Fin%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20%7B%0A%20%20%20%20GRAPH%20%3Fg%20%7B%20%3Fs%20a%20foaf%3ADocument%20%7D%0A%20%20%20%20BIND%28%3Fg%20AS%20%3Fin%29%0A%20%20%7D%0A%20%20UNION%0A%20%20%7B%0A%20%20%20%20%3Fs%20a%20foaf%3ADocument%20.%0A%20%20%20%20BIND%28%22default%22%20AS%20%3Fin%29%0A%20%20%7D%0A%7D%0A&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+

Response

+2XX +or3XX + +response + +
+
+
+followed by +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+ +
+Accept: +application/sparql-results+xml + +
+
+Content-Type: +application/sparql-query + +
+
+
+
+ + +ASK { + GRAPH <http://example.org/protocol-update-dataset-full-test/> { + <http://kasei.us/2009/09/sparql/data/data1.rdf> <http://example.org/in> "default" . + <http://kasei.us/2009/09/sparql/data/data2.rdf> <http://example.org/in> <http://kasei.us/2009/09/sparql/data/data2.rdf> . + } + FILTER NOT EXISTS { + GRAPH <http://example.org/protocol-update-dataset-full-test/> { + <http://kasei.us/2009/09/sparql/data/data3.rdf> ?p ?o + } + } +} +END + +
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/sparql-results+xml + +
+
+
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +update=CLEAR%20ALL +
+
+
+

Response

+2XX +or3XX + +response + +
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/sparql-update + +
+
+
+
+ +CLEAR ALL +
+
+
+

Response

+2XX +or3XX + +response + +
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +update=CLEAR%20SILENT%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-base-test%2F%3E%20%3B%20INSERT%20DATA%20%7B%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-base-test%2F%3E%20%7B%20%3Chttp%3A%2F%2Fexample.org%2Fs%3E%20%3Chttp%3A%2F%2Fexample.org%2Fp%3E%20%3Ctest%3E%20%7D%20%7D +
+
+
+

Response

+2XX +or3XX + +response + +
+
+
+followed by +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+ +
+Accept: +application/sparql-results+xml + +
+
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +query=SELECT%20%3Fo%20WHERE%20%7B%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-base-test%2F%3E%20%7B%20%3Chttp%3A%2F%2Fexample.org%2Fs%3E%20%3Chttp%3A%2F%2Fexample.org%2Fp%3E%20%3Fo%20%7D%20%7D +
+
+
+

Response

+2XX +or3XX + +response + + +
+Content-Type: +application/sparql-results+xml + +
+
+
+
+ +one result with `?o` bound to an IRI that is _not_ `<test>` +
+
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+PUT +/sparql?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +HTTP/1.1
+Host: www.example +
+
+
+

Response

+4XX + +response + +
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+GET +/sparql?query=ASK%20%7B%7D&query=SELECT%20%2A%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +HTTP/1.1
+Host: www.example +
+
+
+

Response

+4XX + +response + +
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +text/plain + +
+
+
+
+ +ASK {} +
+
+
+

Response

+4XX + +response + +
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+
+
+ +query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +
+
+
+

Response

+4XX + +response + +
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +ASK {} +
+
+
+

Response

+4XX + +response + +
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/sparql-query; charset=UTF-16 + + +
+
+
+
+ +ASK {} +
+
+
+

Response

+4XX + +response + +
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+GET +/sparql?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +HTTP/1.1
+Host: www.example +
+
+
+

Response

+4XX + +response + +
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+GET +/sparql?update=CLEAR%20ALL&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +HTTP/1.1
+Host: www.example +
+
+
+

Response

+4XX + +response + +
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +update=CLEAR%20ALL&update=CLEAR%20DEFAULT +
+
+
+

Response

+4XX + +response + +
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +text/plain + +
+
+
+
+ +CLEAR NAMED +
+
+
+

Response

+4XX + +response + +
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +HTTP/1.1
+Host: www.example +
+
+
+ +CLEAR NAMED +
+
+
+

Response

+4XX + +response + +
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/sparql-update; charset=UTF-16 + + +
+
+
+
+ +CLEAR NAMED +
+
+
+

Response

+4XX + +response + +
+
+
+
+
+ +#bad_update_syntax: + +invoke update operation with invalid update syntax (4XX result) +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+POST +/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +update=CLEAR%20XYZ +
+
+
+

Response

+4XX + +response + +
+
+
+
+
+ +#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 +
+
+
+ +
+
+

Request

+POST +/sparql +HTTP/1.1
+Host: www.example +
+ +
+Content-Type: +application/x-www-form-urlencoded + +
+
+
+
+ +using-named-graph-uri=http%3A%2F%2Fexample%2Fpeople&update=%0APREFIX%20foaf%3A%20%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0AWITH%20%3Chttp%3A%2F%2Fexample%2Faddresses%3E%0ADELETE%20%7B%20%3Fperson%20foaf%3AgivenName%20%27Bill%27%20%7D%0AINSERT%20%7B%20%3Fperson%20foaf%3AgivenName%20%27William%27%20%7D%0AWHERE%20%7B%0A%20%20%3Fperson%20foaf%3AgivenName%20%27Bill%27%0A%7D%0A +
+
+
+

Response

+4XX + +response + +
+
+
+
+
+
+ + diff --git a/sparql11/data-sparql11/protocol/manifest.jsonld b/sparql11/data-sparql11/protocol/manifest.jsonld new file mode 100644 index 00000000..43cf2454 --- /dev/null +++ b/sparql11/data-sparql11/protocol/manifest.jsonld @@ -0,0 +1,2071 @@ +{ + "@context": { + "@base": "http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest", + "cnt": "http://www.w3.org/2011/content#", + "dawgt": "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#", + "ht": "http://www.w3.org/2011/http#", + "mf": "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#", + "mq": "http://www.w3.org/2001/sw/DataAccess/tests/test-query#", + "rdfs": "http://www.w3.org/2000/01/rdf-schema#", + "xsd": "http://www.w3.org/2001/XMLSchema#", + "action": { + "@id": "mf:action", + "@type": "@id" + }, + "approval": { + "@id": "dawgt:approval", + "@type": "@id" + }, + "approvedBy": { + "@id": "dawgt:approvedBy", + "@type": "@id" + }, + "comment": { + "@id": "rdfs:comment" + }, + "data": { + "@id": "mq:data", + "@type": "@id" + }, + "entries": { + "@id": "mf:entries", + "@container": "@list", + "@type": "@id" + }, + "feature": { + "@id": "mf:feature", + "@type": "@vocab" + }, + "graphData": { + "@id": "mq:graphData", + "@type": "@id" + }, + "label": { + "@id": "rdfs:label" + }, + "name": { + "@id": "mf:name" + }, + "notable": { + "@id": "mf:notable", + "@type": "@vocab" + }, + "query": { + "@id": "mq:query", + "@type": "@id" + }, + "queryForm": { + "@id": "mq:queryForm", + "@type": "@vocab" + }, + "requires": { + "@id": "mf:requires", + "@type": "@vocab", + "@container": "@set" + }, + "result": { + "@id": "mf:result", + "@type": "@id" + }, + "headerElements": { + "@id": "ht:headerElements", + "@container": "@list" + }, + "headers": { + "@id": "ht:headers", + "@container": "@list" + }, + "params": { + "@id": "ht:params", + "@container": "@list" + }, + "requests": { + "@id": "ht:requests", + "@container": "@list" + } + }, + "@id": "", + "@type": "mf:Manifest", + "label": "SPARQL Protocol", + "comment": "\nTest descriptions used for generating Manifest and HTML renderings.\nTest HTTP connection described using HTTP and CNT vocabularies.\nIn responses, status values such as \"2XX\", \"3XX\" are used to match the actual response status.\nMultiple values for Content-Type mean that the response MUST include one or more of these types.\nResponses for ASK match any specified boolean content.\nSome tests require special result processing.\n ", + "entries": [ + { + "@id": "#query_get", + "@type": "mf:ProtocolTest", + "name": "query via GET", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "GET", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-results+xml, application/sparql-results+json", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+json" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": true, + "cnt:characterEncoding": "UTF-8" + } + } + } + ] + } + }, + { + "@id": "#query_post_form", + "@type": "mf:ProtocolTest", + "name": "query via URL-encoded POST", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-results+xml, application/sparql-results+json", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+json" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": true, + "cnt:characterEncoding": "UTF-8" + } + } + } + ] + } + }, + { + "@id": "#query_post_direct", + "@type": "mf:ProtocolTest", + "name": "query via POST directly", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-query", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-query" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "ASK {}", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-results+xml, application/sparql-results+json", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+json" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": true, + "cnt:characterEncoding": "UTF-8" + } + } + } + ] + } + }, + { + "@id": "#query_dataset_default_graph", + "@type": "mf:ProtocolTest", + "name": "query with protocol-specified default graph", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "query=ASK%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%3Fp%20%3Fo%20%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-results+xml, application/sparql-results+json", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+json" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": true, + "cnt:characterEncoding": "UTF-8" + } + } + } + ] + } + }, + { + "@id": "#query_dataset_default_graphs_get", + "@type": "mf:ProtocolTest", + "name": "GET query with protocol-specified default graphs", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "GET", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?query=ASK%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20.%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20.%20%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-results+xml, application/sparql-results+json", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+json" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": true, + "cnt:characterEncoding": "UTF-8" + } + } + } + ] + } + }, + { + "@id": "#query_dataset_default_graphs_post", + "@type": "mf:ProtocolTest", + "name": "POST query with protocol-specified default graphs", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "query=ASK%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20.%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20.%20%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-results+xml, application/sparql-results+json", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+json" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": true, + "cnt:characterEncoding": "UTF-8" + } + } + } + ] + } + }, + { + "@id": "#query_dataset_named_graphs_post", + "@type": "mf:ProtocolTest", + "name": "POST query with protocol-specified named graphs", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "query=ASK%20%7B%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%20%7D&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-results+xml, application/sparql-results+json", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+json" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": true, + "cnt:characterEncoding": "UTF-8" + } + } + } + ] + } + }, + { + "@id": "#query_dataset_named_graphs_get", + "@type": "mf:ProtocolTest", + "name": "GET query with protocol-specified named graphs", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "GET", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?query=ASK%20%7B%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%20%7D&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-results+xml, application/sparql-results+json", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+json" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": true, + "cnt:characterEncoding": "UTF-8" + } + } + } + ] + } + }, + { + "@id": "#query_dataset_full", + "@type": "mf:ProtocolTest", + "name": "query with protocol-specified dataset (both named and default graphs)", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "query=%0AASK%20%7B%0A%20%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20%3Ftype%0A%20%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%0A%20%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%0A%7D%0A&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-results+xml, application/sparql-results+json", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+json" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": true, + "cnt:characterEncoding": "UTF-8" + } + } + } + ] + } + }, + { + "@id": "#query_multiple_dataset", + "@type": "mf:ProtocolTest", + "name": "query specifying dataset in both query string and protocol; test for use of protocol-specified dataset", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "query=ASK%20FROM%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%20%7D&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-results+xml, application/sparql-results+json", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+json" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": true, + "cnt:characterEncoding": "UTF-8" + } + } + } + ] + } + }, + { + "@id": "#query_content_type_select", + "@type": "mf:ProtocolTest", + "name": "SELECT query appropriate content type (expect one of: XML, JSON, CSV, TSV)", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "query=SELECT%20%281%20AS%20%3Fvalue%29%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-results+xml, application/sparql-results+json, text/tab-separated-values, text/csv", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+json" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/tab-separated-values" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/csv" + } + ] + } + ] + } + } + ] + } + }, + { + "@id": "#query_content_type_ask", + "@type": "mf:ProtocolTest", + "name": "ASK query appropriate content type (expect one of: XML, JSON)", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-results+xml, application/sparql-results+json", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+json" + } + ] + } + ] + } + } + ] + } + }, + { + "@id": "#query_content_type_describe", + "@type": "mf:ProtocolTest", + "name": "DESCRIBE query appropriate content type (expect one of: RDF/XML, Turtle, N-Triples, RDFa, JSON-LD)", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "query=DESCRIBE%20%3Chttp%3A%2F%2Fexample.org%2F%3E&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/rdf+xml, text/turtle, application/n-triples, text/html, application/ld+json", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/rdf+xml" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/n-triples" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/html" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/ld+json" + } + ] + } + ] + } + } + ] + } + }, + { + "@id": "#query_content_type_construct", + "@type": "mf:ProtocolTest", + "name": "CONSTRUCT query appropriate content type (expect one of: RDF/XML, Turtle, N-Triples, RDFa, JSON-LD))", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "query=CONSTRUCT%20%7B%20%3Cs%3E%20%3Cp%3E%201%20%7D%20WHERE%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/rdf+xml, text/turtle, application/n-triples, text/html, application/ld+json", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/rdf+xml" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/n-triples" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/html" + }, + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/ld+json" + } + ] + } + ] + } + } + ] + } + }, + { + "@id": "#update_dataset_default_graph", + "@type": "mf:ProtocolTest", + "name": "update with protocol-specified default graph", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ACLEAR%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%0A%20%20%20%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%0A%20%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20a%20dc%3ABibliographicResource%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20%3Fs%20a%20foaf%3ADocument%0A%7D%0A", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ] + } + }, + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Accept", + "ht:fieldValue": "application/sparql-results+xml", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-query", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-query" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "\nASK {\n GRAPH {\n a \n }\n}\n", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-results+xml", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + } + ] + } + ] + } + } + ] + } + }, + { + "@id": "#update_dataset_default_graphs", + "@type": "mf:ProtocolTest", + "name": "update with protocol-specified default graphs", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ADROP%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-graphs-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20a%20dc%3ABibliographicResource%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20%3Fs%20a%20foaf%3ADocument%0A%7D%0A", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ] + } + }, + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Accept", + "ht:fieldValue": "application/sparql-results+xml", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-query", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-query" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "\nASK {\n GRAPH {\n a .\n a .\n }\n FILTER NOT EXISTS {\n GRAPH {\n a .\n }\n }\n}\n", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-results+xml", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + } + ] + } + ] + } + } + ] + } + }, + { + "@id": "#update_dataset_named_graphs", + "@type": "mf:ProtocolTest", + "name": "update with protocol-specified named graphs", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ADROP%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-named-graphs-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20a%20dc%3ABibliographicResource%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20GRAPH%20%3Fg%20%7B%0A%20%20%20%20%3Fs%20a%20foaf%3ADocument%0A%20%20%7D%0A%7D%0A", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ] + } + }, + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Accept", + "ht:fieldValue": "application/sparql-results+xml", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-query", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-query" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "\nASK {\n GRAPH {\n a .\n a .\n }\n FILTER NOT EXISTS {\n GRAPH {\n a .\n }\n }\n}\n", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-results+xml", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + } + ] + } + ] + } + } + ] + } + }, + { + "@id": "#update_dataset_full", + "@type": "mf:ProtocolTest", + "name": "update with protocol-specified dataset (both named and default graphs)", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ADROP%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-full-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20%3Chttp%3A%2F%2Fexample.org%2Fin%3E%20%3Fin%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20%7B%0A%20%20%20%20GRAPH%20%3Fg%20%7B%20%3Fs%20a%20foaf%3ADocument%20%7D%0A%20%20%20%20BIND%28%3Fg%20AS%20%3Fin%29%0A%20%20%7D%0A%20%20UNION%0A%20%20%7B%0A%20%20%20%20%3Fs%20a%20foaf%3ADocument%20.%0A%20%20%20%20BIND%28%22default%22%20AS%20%3Fin%29%0A%20%20%7D%0A%7D%0A&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ] + } + }, + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Accept", + "ht:fieldValue": "application/sparql-results+xml", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-query", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-query" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "\nASK {\n GRAPH {\n \"default\" .\n .\n }\n FILTER NOT EXISTS {\n GRAPH {\n ?p ?o\n }\n }\n}\nEND\n", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-results+xml", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + } + ] + } + ] + } + } + ] + } + }, + { + "@id": "#update_post_form", + "@type": "mf:ProtocolTest", + "name": "update via URL-encoded POST", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "update=CLEAR%20ALL", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ] + } + } + ] + } + }, + { + "@id": "#update_post_direct", + "@type": "mf:ProtocolTest", + "name": "update via POST directly", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-update", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-update" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "CLEAR ALL", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ] + } + } + ] + } + }, + { + "@id": "#update_base_uri", + "@type": "mf:ProtocolTest", + "name": "test for service-defined BASE URI (\"which MAY be the service endpoint\")", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "update=CLEAR%20SILENT%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-base-test%2F%3E%20%3B%20INSERT%20DATA%20%7B%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-base-test%2F%3E%20%7B%20%3Chttp%3A%2F%2Fexample.org%2Fs%3E%20%3Chttp%3A%2F%2Fexample.org%2Fp%3E%20%3Ctest%3E%20%7D%20%7D", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ] + } + }, + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Accept", + "ht:fieldValue": "application/sparql-results+xml", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "query=SELECT%20%3Fo%20WHERE%20%7B%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-base-test%2F%3E%20%7B%20%3Chttp%3A%2F%2Fexample.org%2Fs%3E%20%3Chttp%3A%2F%2Fexample.org%2Fp%3E%20%3Fo%20%7D%20%7D", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "2XX", + "3XX" + ], + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-results+xml", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-results+xml" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "one result with `?o` bound to an IRI that is _not_ ``", + "cnt:characterEncoding": "UTF-8" + } + } + } + ] + } + }, + { + "@id": "#bad_query_method", + "@type": "mf:ProtocolTest", + "name": "invoke query operation with a method other than GET or POST", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "PUT", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "4XX" + ] + } + } + ] + } + }, + { + "@id": "#bad_multiple_queries", + "@type": "mf:ProtocolTest", + "name": "invoke query operation with more than one query string", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "GET", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?query=ASK%20%7B%7D&query=SELECT%20%2A%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "4XX" + ] + } + } + ] + } + }, + { + "@id": "#bad_query_wrong_media_type", + "@type": "mf:ProtocolTest", + "name": "invoke query operation with a POST with media type that's not url-encoded or application/sparql-query", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "text/plain", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/plain" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "ASK {}", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "4XX" + ] + } + } + ] + } + }, + { + "@id": "#bad_query_missing_form_type", + "@type": "mf:ProtocolTest", + "name": "invoke query operation with url-encoded body, but without application/x-www-form-urlencoded media type", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "4XX" + ] + } + } + ] + } + }, + { + "@id": "#bad_query_missing_direct_type", + "@type": "mf:ProtocolTest", + "name": "invoke query operation with SPARQL body, but without application/sparql-query media type", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "ASK {}", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "4XX" + ] + } + } + ] + } + }, + { + "@id": "#bad_query_non_utf8", + "@type": "mf:ProtocolTest", + "name": "invoke query operation with direct POST, but with a non-UTF8 encoding (UTF-16)", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-query; charset=UTF-16", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-query", + "params": [ + { + "@type": "ht:Parameter", + "ht:paramName": "charset", + "ht:paramValue": "UTF-16" + } + ] + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "ASK {}", + "cnt:characterEncoding": "UTF-16" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "4XX" + ] + } + } + ] + } + }, + { + "@id": "#bad_query_syntax", + "@type": "mf:ProtocolTest", + "name": "invoke query operation with invalid query syntax (4XX result)", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "GET", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "4XX" + ] + } + } + ] + } + }, + { + "@id": "#bad_update_get", + "@type": "mf:ProtocolTest", + "name": "invoke update operation with GET", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "GET", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?update=CLEAR%20ALL&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "4XX" + ] + } + } + ] + } + }, + { + "@id": "#bad_multiple_updates", + "@type": "mf:ProtocolTest", + "name": "invoke update operation with more than one update string", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "update=CLEAR%20ALL&update=CLEAR%20DEFAULT", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "4XX" + ] + } + } + ] + } + }, + { + "@id": "#bad_update_wrong_media_type", + "@type": "mf:ProtocolTest", + "name": "invoke update operation with a POST with media type that's not url-encoded or application/sparql-update", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "text/plain", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/plain" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "CLEAR NAMED", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "4XX" + ] + } + } + ] + } + }, + { + "@id": "#bad_update_missing_form_type", + "@type": "mf:ProtocolTest", + "name": "invoke update operation with url-encoded body, but without application/x-www-form-urlencoded media type", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "CLEAR NAMED", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "4XX" + ] + } + } + ] + } + }, + { + "@id": "#bad_update_non_utf8", + "@type": "mf:ProtocolTest", + "name": "invoke update operation with direct POST, but with a non-UTF8 encoding", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/sparql-update; charset=UTF-16", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/sparql-update", + "params": [ + { + "@type": "ht:Parameter", + "ht:paramName": "charset", + "ht:paramValue": "UTF-16" + } + ] + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "CLEAR NAMED", + "cnt:characterEncoding": "UTF-16" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "4XX" + ] + } + } + ] + } + }, + { + "@id": "#bad_update_syntax", + "@type": "mf:ProtocolTest", + "name": "invoke update operation with invalid update syntax (4XX result)", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "update=CLEAR%20XYZ", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "4XX" + ] + } + } + ] + } + }, + { + "@id": "#bad_update_dataset_conflict", + "@type": "mf:ProtocolTest", + "name": "invoke update with both using-graph-uri/using-named-graph-uri parameter and USING/WITH clause", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "/sparql", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "application/x-www-form-urlencoded", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "application/x-www-form-urlencoded" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "using-named-graph-uri=http%3A%2F%2Fexample%2Fpeople&update=%0APREFIX%20foaf%3A%20%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0AWITH%20%3Chttp%3A%2F%2Fexample%2Faddresses%3E%0ADELETE%20%7B%20%3Fperson%20foaf%3AgivenName%20%27Bill%27%20%7D%0AINSERT%20%7B%20%3Fperson%20foaf%3AgivenName%20%27William%27%20%7D%0AWHERE%20%7B%0A%20%20%3Fperson%20foaf%3AgivenName%20%27Bill%27%0A%7D%0A", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "4XX" + ] + } + } + ] + } + } + ] +} diff --git a/sparql11/data-sparql11/protocol/manifest.ttl b/sparql11/data-sparql11/protocol/manifest.ttl index a13cb34b..8d3b7a22 100644 --- a/sparql11/data-sparql11/protocol/manifest.ttl +++ b/sparql11/data-sparql11/protocol/manifest.ttl @@ -1,961 +1,1609 @@ @prefix : . -@prefix rdf: . -@prefix rdfs: . -@prefix mf: . -@prefix qt: . -@prefix dawgt: . - -<> rdf:type mf:Manifest ; - rdfs:label "SPARQL Protocol" ; - mf:entries - ( - :query_post_form - :query_dataset_default_graphs_get - :query_dataset_default_graphs_post - :query_dataset_named_graphs_post - :query_dataset_named_graphs_get - :query_dataset_full - :query_multiple_dataset - :query_get - :query_content_type_select - :query_content_type_ask - :query_content_type_describe - :query_content_type_construct - :update_dataset_default_graph - :update_dataset_default_graphs - :update_dataset_named_graphs - :update_dataset_full - :update_post_form - :update_post_direct - :update_base_uri - :query_post_direct - :bad_query_method - :bad_multiple_queries - :bad_query_wrong_media_type - :bad_query_missing_form_type - :bad_query_missing_direct_type - :bad_query_non_utf8 - :bad_query_syntax - :bad_update_get - :bad_multiple_updates - :bad_update_wrong_media_type - :bad_update_missing_form_type - :bad_update_non_utf8 - :bad_update_syntax - :bad_update_dataset_conflict - ) . - -:query_post_form rdf:type mf:ProtocolTest ; - mf:name "query via URL-encoded POST" ; - rdfs:comment """ -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/x-www-form-urlencoded - Content-Length: XXX - - query=ASK%20%7B%7D - -#### Response - - 2xx or 3xx response - Content-Type: application/sparql-results+xml or application/sparql-results+json - - true - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:query_dataset_default_graphs_get rdf:type mf:ProtocolTest ; - mf:name "GET query with protocol-specified default graph" ; - rdfs:comment """ -#### Request - - GET /sparql?query=ASK%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20.%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20.%20%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf - Host: www.example - User-agent: sparql-client/0.1 - -#### Response - - 2xx or 3xx response - Content-Type: application/sparql-results+xml or application/sparql-results+json - - true - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:query_dataset_default_graphs_post rdf:type mf:ProtocolTest ; - mf:name "POST query with protocol-specified default graphs" ; - rdfs:comment """ -#### Request - - POST /sparql/?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/sparql-query - Content-Length: XXX - - ASK { ?p ?o . ?p ?o } - -#### Response - - 2xx or 3xx response - Content-Type: application/sparql-results+xml or application/sparql-results+json - - true - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:query_dataset_named_graphs_post rdf:type mf:ProtocolTest ; - mf:name "POST query with protocol-specified named graphs" ; - rdfs:comment """ -#### Request - - POST /sparql/?named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/sparql-query - Content-Length: XXX - - ASK { GRAPH ?g { ?s ?p ?o } } - -#### Response - - 2xx or 3xx response - Content-Type: application/sparql-results+xml or application/sparql-results+json - - true - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:query_dataset_named_graphs_get rdf:type mf:ProtocolTest ; - mf:name "GET query with protocol-specified named graphs" ; - rdfs:comment """ -#### Request - - GET /sparql/?named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf&query=ASK%20%7B%20GRAPH%20%3Fg%20%7B%20%3Fs%20%3Fp%20%3Fo%20%7D%20%7D HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - -#### Response - - 2xx or 3xx response - Content-Type: application/sparql-results+xml or application/sparql-results+json - - true - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:query_dataset_full rdf:type mf:ProtocolTest ; - mf:name "query with protocol-specified dataset (both named and default graphs)" ; - rdfs:comment """ -#### Request - - POST /sparql/?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/sparql-query - Content-Length: XXX - - SELECT ?g ?x ?s { ?x ?y ?o GRAPH ?g { ?s ?p ?o } } - -#### Response - - 2xx or 3xx response - Content-Type: application/sparql-results+xml or application/sparql-results+json - - true - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:query_multiple_dataset rdf:type mf:ProtocolTest ; - mf:name "query specifying dataset in both query string and protocol; test for use of protocol-specified dataset" ; - rdfs:comment """ -#### Request - - POST /sparql/?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/sparql-query - Content-Length: XXX - - ASK FROM { ?p ?o } - -#### Response - - 2xx or 3xx response - Content-Type: application/sparql-results+xml or application/sparql-results+json - - true - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:query_get rdf:type mf:ProtocolTest ; - mf:name "query via GET" ; - rdfs:comment """ -#### Request - - GET /sparql?query=ASK%20%7B%7D - -#### Response - - 2xx or 3xx response - Content-Type: application/sparql-results+xml or application/sparql-results+json - - true - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:query_content_type_select rdf:type mf:ProtocolTest ; - mf:name "query appropriate content type (expect one of: XML, JSON, CSV, TSV)" ; - rdfs:comment """ -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/sparql-query - Content-Length: XXX - - SELECT (1 AS ?value) {} - -#### Response - - 2xx or 3xx response - Content-Type: application/sparql-results+xml, application/sparql-results+json, text/tab-separated-values, or text/csv - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:query_content_type_ask rdf:type mf:ProtocolTest ; - mf:name "query appropriate content type (expect one of: XML, JSON)" ; - rdfs:comment """ -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/sparql-query - Content-Length: XXX - - ASK {} - -#### Response - - 2xx or 3xx response - Content-Type: application/sparql-results+xml or application/sparql-results+json - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:query_content_type_describe rdf:type mf:ProtocolTest ; - mf:name "query appropriate content type (expect one of: RDF/XML, Turtle, N-Triples, RDFa)" ; - rdfs:comment """ -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/sparql-query - Content-Length: XXX - - DESCRIBE - -#### Response - - 2xx or 3xx response - Content-Type: application/rdf+xml, application/rdf+json or text/turtle - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:query_content_type_construct rdf:type mf:ProtocolTest ; - mf:name "query appropriate content type (expect one of: RDF/XML, Turtle, N-Triples, RDFa)" ; - rdfs:comment """ -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/sparql-query - Content-Length: XXX - - CONSTRUCT {

1 } WHERE {} - -#### Response - - 2xx or 3xx response - Content-Type: application/rdf+xml, application/rdf+json or text/turtle - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:update_dataset_default_graph rdf:type mf:ProtocolTest ; - mf:name "update with protocol-specified default graph" ; - rdfs:comment """ -#### Request - - POST /sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/sparql-update - Content-Length: XXX - - PREFIX dc: - PREFIX foaf: - CLEAR ALL ; - INSERT DATA { - GRAPH { - a foaf:Document - } - } ; - INSERT { - GRAPH { - ?s a dc:BibliographicResource - } +@prefix cnt: . +@prefix dawgt: . +@prefix ht: . +@prefix mf: . +@prefix rdf: . +@prefix rdfs: . + +<> a mf:Manifest; + rdfs:label "SPARQL Protocol"; + rdfs:comment """ +Test descriptions used for generating Manifest and HTML renderings. +Test HTTP connection described using HTTP and CNT vocabularies. +In responses, status values such as \"2XX\", \"3XX\" are used to match the actual response status. +Multiple values for Content-Type mean that the response MUST include one or more of these types. +Responses for ASK match any specified boolean content. +Some tests require special result processing. + """; + mf:entries ( + :query_get + :query_post_form + :query_post_direct + :query_dataset_default_graph + :query_dataset_default_graphs_get + :query_dataset_default_graphs_post + :query_dataset_named_graphs_post + :query_dataset_named_graphs_get + :query_dataset_full + :query_multiple_dataset + :query_content_type_select + :query_content_type_ask + :query_content_type_describe + :query_content_type_construct + :update_dataset_default_graph + :update_dataset_default_graphs + :update_dataset_named_graphs + :update_dataset_full + :update_post_form + :update_post_direct + :update_base_uri + :bad_query_method + :bad_multiple_queries + :bad_query_wrong_media_type + :bad_query_missing_form_type + :bad_query_missing_direct_type + :bad_query_non_utf8 + :bad_query_syntax + :bad_update_get + :bad_multiple_updates + :bad_update_wrong_media_type + :bad_update_missing_form_type + :bad_update_non_utf8 + :bad_update_syntax + :bad_update_dataset_conflict) . + +:bad_multiple_queries a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?query=ASK%20%7B%7D&query=SELECT%20%2A%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; + ht:httpVersion "1.1"; + ht:methodName "GET"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "4XX" + ] + ]) + ]; + mf:name "invoke query operation with more than one query string" . + +:bad_multiple_updates a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "update=CLEAR%20ALL&update=CLEAR%20DEFAULT" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "4XX" + ] + ]) + ]; + mf:name "invoke update operation with more than one update string" . + +:bad_query_method a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; + ht:httpVersion "1.1"; + ht:methodName "PUT"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "4XX" + ] + ]) + ]; + mf:name "invoke query operation with a method other than GET or POST" . + +:bad_query_missing_direct_type a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "ASK {}" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "4XX" + ] + ]) + ]; + mf:name "invoke query operation with SPARQL body, but without application/sparql-query media type" . + +:bad_query_missing_form_type a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf" + ]; + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "4XX" + ] + ]) + ]; + mf:name "invoke query operation with url-encoded body, but without application/x-www-form-urlencoded media type" . + +:bad_query_non_utf8 a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-16"; + cnt:chars "ASK {}" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-query; charset=UTF-16"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-query"; + ht:params ([ + a ht:Parameter; + ht:paramName "charset"; + ht:paramValue "UTF-16" + ]) + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "4XX" + ] + ]) + ]; + mf:name "invoke query operation with direct POST, but with a non-UTF8 encoding (UTF-16)" . + +:bad_query_syntax a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; + ht:httpVersion "1.1"; + ht:methodName "GET"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "4XX" + ] + ]) + ]; + mf:name "invoke query operation with invalid query syntax (4XX result)" . + +:bad_query_wrong_media_type a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "ASK {}" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "text/plain"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/plain" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "4XX" + ] + ]) + ]; + mf:name "invoke query operation with a POST with media type that's not url-encoded or application/sparql-query" . + +:bad_update_dataset_conflict a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "using-named-graph-uri=http%3A%2F%2Fexample%2Fpeople&update=%0APREFIX%20foaf%3A%20%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0AWITH%20%3Chttp%3A%2F%2Fexample%2Faddresses%3E%0ADELETE%20%7B%20%3Fperson%20foaf%3AgivenName%20%27Bill%27%20%7D%0AINSERT%20%7B%20%3Fperson%20foaf%3AgivenName%20%27William%27%20%7D%0AWHERE%20%7B%0A%20%20%3Fperson%20foaf%3AgivenName%20%27Bill%27%0A%7D%0A" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "4XX" + ] + ]) + ]; + mf:name "invoke update with both using-graph-uri/using-named-graph-uri parameter and USING/WITH clause" . + +:bad_update_get a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?update=CLEAR%20ALL&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; + ht:httpVersion "1.1"; + ht:methodName "GET"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "4XX" + ] + ]) + ]; + mf:name "invoke update operation with GET" . + +:bad_update_missing_form_type a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "CLEAR NAMED" + ]; + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "4XX" + ] + ]) + ]; + mf:name "invoke update operation with url-encoded body, but without application/x-www-form-urlencoded media type" . + +:bad_update_non_utf8 a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-16"; + cnt:chars "CLEAR NAMED" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-update; charset=UTF-16"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-update"; + ht:params ([ + a ht:Parameter; + ht:paramName "charset"; + ht:paramValue "UTF-16" + ]) + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "4XX" + ] + ]) + ]; + mf:name "invoke update operation with direct POST, but with a non-UTF8 encoding" . + +:bad_update_syntax a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "update=CLEAR%20XYZ" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "4XX" + ] + ]) + ]; + mf:name "invoke update operation with invalid update syntax (4XX result)" . + +:bad_update_wrong_media_type a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "CLEAR NAMED" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "text/plain"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/plain" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "4XX" + ] + ]) + ]; + mf:name "invoke update operation with a POST with media type that's not url-encoded or application/sparql-update" . + +:query_content_type_ask a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-results+xml, application/sparql-results+json"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ] [ + a ht:HeaderElement; + ht:elementName "application/sparql-results+json" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "ASK query appropriate content type (expect one of: XML, JSON)" . + +:query_content_type_construct a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "query=CONSTRUCT%20%7B%20%3Cs%3E%20%3Cp%3E%201%20%7D%20WHERE%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/rdf+xml, text/turtle, application/n-triples, text/html, application/ld+json"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/rdf+xml" + ] [ + a ht:HeaderElement; + ht:elementName "text/turtle" + ] [ + a ht:HeaderElement; + ht:elementName "application/n-triples" + ] [ + a ht:HeaderElement; + ht:elementName "text/html" + ] [ + a ht:HeaderElement; + ht:elementName "application/ld+json" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "CONSTRUCT query appropriate content type (expect one of: RDF/XML, Turtle, N-Triples, RDFa, JSON-LD))" . + +:query_content_type_describe a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "query=DESCRIBE%20%3Chttp%3A%2F%2Fexample.org%2F%3E&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/rdf+xml, text/turtle, application/n-triples, text/html, application/ld+json"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/rdf+xml" + ] [ + a ht:HeaderElement; + ht:elementName "text/turtle" + ] [ + a ht:HeaderElement; + ht:elementName "application/n-triples" + ] [ + a ht:HeaderElement; + ht:elementName "text/html" + ] [ + a ht:HeaderElement; + ht:elementName "application/ld+json" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "DESCRIBE query appropriate content type (expect one of: RDF/XML, Turtle, N-Triples, RDFa, JSON-LD)" . + +:query_content_type_select a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "query=SELECT%20%281%20AS%20%3Fvalue%29%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-results+xml, application/sparql-results+json, text/tab-separated-values, text/csv"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ] [ + a ht:HeaderElement; + ht:elementName "application/sparql-results+json" + ] [ + a ht:HeaderElement; + ht:elementName "text/tab-separated-values" + ] [ + a ht:HeaderElement; + ht:elementName "text/csv" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "SELECT query appropriate content type (expect one of: XML, JSON, CSV, TSV)" . + +:query_dataset_default_graph a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "query=ASK%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%3Fp%20%3Fo%20%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars true + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-results+xml, application/sparql-results+json"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ] [ + a ht:HeaderElement; + ht:elementName "application/sparql-results+json" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "query with protocol-specified default graph" . + +:query_dataset_default_graphs_get a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?query=ASK%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20.%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20.%20%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf"; + ht:httpVersion "1.1"; + ht:methodName "GET"; + ht:resp [ + a ht:Response; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars true + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-results+xml, application/sparql-results+json"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ] [ + a ht:HeaderElement; + ht:elementName "application/sparql-results+json" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "GET query with protocol-specified default graphs" . + +:query_dataset_default_graphs_post a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "query=ASK%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20.%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20.%20%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars true + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-results+xml, application/sparql-results+json"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ] [ + a ht:HeaderElement; + ht:elementName "application/sparql-results+json" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "POST query with protocol-specified default graphs" . + +:query_dataset_full a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "query=%0AASK%20%7B%0A%20%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20%3Ftype%0A%20%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%0A%20%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%0A%7D%0A&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars true + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-results+xml, application/sparql-results+json"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ] [ + a ht:HeaderElement; + ht:elementName "application/sparql-results+json" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "query with protocol-specified dataset (both named and default graphs)" . + +:query_dataset_named_graphs_get a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?query=ASK%20%7B%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%20%7D&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf"; + ht:httpVersion "1.1"; + ht:methodName "GET"; + ht:resp [ + a ht:Response; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars true + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-results+xml, application/sparql-results+json"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ] [ + a ht:HeaderElement; + ht:elementName "application/sparql-results+json" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "GET query with protocol-specified named graphs" . + +:query_dataset_named_graphs_post a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "query=ASK%20%7B%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%20%7D&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars true + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-results+xml, application/sparql-results+json"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ] [ + a ht:HeaderElement; + ht:elementName "application/sparql-results+json" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "POST query with protocol-specified named graphs" . + +:query_get a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; + ht:httpVersion "1.1"; + ht:methodName "GET"; + ht:resp [ + a ht:Response; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars true + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-results+xml, application/sparql-results+json"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ] [ + a ht:HeaderElement; + ht:elementName "application/sparql-results+json" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "query via GET" . + +:query_multiple_dataset a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "query=ASK%20FROM%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%20%7D&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars true + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-results+xml, application/sparql-results+json"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ] [ + a ht:HeaderElement; + ht:elementName "application/sparql-results+json" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "query specifying dataset in both query string and protocol; test for use of protocol-specified dataset" . + +:query_post_direct a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "ASK {}" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-query"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-query" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars true + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-results+xml, application/sparql-results+json"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ] [ + a ht:HeaderElement; + ht:elementName "application/sparql-results+json" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "query via POST directly" . + +:query_post_form a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars true + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-results+xml, application/sparql-results+json"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ] [ + a ht:HeaderElement; + ht:elementName "application/sparql-results+json" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "query via URL-encoded POST" . + +:update_base_uri a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "update=CLEAR%20SILENT%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-base-test%2F%3E%20%3B%20INSERT%20DATA%20%7B%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-base-test%2F%3E%20%7B%20%3Chttp%3A%2F%2Fexample.org%2Fs%3E%20%3Chttp%3A%2F%2Fexample.org%2Fp%3E%20%3Ctest%3E%20%7D%20%7D" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "2XX", + "3XX" + ] + ] [ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "query=SELECT%20%3Fo%20WHERE%20%7B%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-base-test%2F%3E%20%7B%20%3Chttp%3A%2F%2Fexample.org%2Fs%3E%20%3Chttp%3A%2F%2Fexample.org%2Fp%3E%20%3Fo%20%7D%20%7D" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Accept"; + ht:fieldValue "application/sparql-results+xml"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "one result with `?o` bound to an IRI that is _not_ ``" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-results+xml"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "test for service-defined BASE URI (\"which MAY be the service endpoint\")" . + +:update_dataset_default_graph a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ACLEAR%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%0A%20%20%20%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%0A%20%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20a%20dc%3ABibliographicResource%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20%3Fs%20a%20foaf%3ADocument%0A%7D%0A" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "2XX", + "3XX" + ] + ] [ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars """ +ASK { + GRAPH { + a + } +} +""" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Accept"; + ht:fieldValue "application/sparql-results+xml"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-query"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-query" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-results+xml"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "update with protocol-specified default graph" . + +:update_dataset_default_graphs a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ADROP%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-graphs-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20a%20dc%3ABibliographicResource%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20%3Fs%20a%20foaf%3ADocument%0A%7D%0A" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "2XX", + "3XX" + ] + ] [ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars """ +ASK { + GRAPH { + a . + a . + } + FILTER NOT EXISTS { + GRAPH { + a . } - WHERE { - ?s a foaf:Document + } +} +""" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Accept"; + ht:fieldValue "application/sparql-results+xml"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-query"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-query" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-results+xml"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "update with protocol-specified default graphs" . + +:update_dataset_full a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ADROP%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-full-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20%3Chttp%3A%2F%2Fexample.org%2Fin%3E%20%3Fin%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20%7B%0A%20%20%20%20GRAPH%20%3Fg%20%7B%20%3Fs%20a%20foaf%3ADocument%20%7D%0A%20%20%20%20BIND%28%3Fg%20AS%20%3Fin%29%0A%20%20%7D%0A%20%20UNION%0A%20%20%7B%0A%20%20%20%20%3Fs%20a%20foaf%3ADocument%20.%0A%20%20%20%20BIND%28%22default%22%20AS%20%3Fin%29%0A%20%20%7D%0A%7D%0A&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf"; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "2XX", + "3XX" + ] + ] [ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars """ +ASK { + GRAPH { + \"default\" . + . + } + FILTER NOT EXISTS { + GRAPH { + ?p ?o } - -#### Response - - 2xx or 3xx response - -followed by - -#### Request - - POST /sparql HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Accept: application/sparql-results+xml - Content-Type: application/sparql-query - Content-Length: XXX - - ASK { - GRAPH { - a - } - } - -#### Response - - 2xx or 3xx response - Content-Type: application/sparql-results+xml - - true - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:update_dataset_default_graphs rdf:type mf:ProtocolTest ; - mf:name "update with protocol-specified default graphs" ; - rdfs:comment """ -#### Request - - POST /sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/sparql-update - Content-Length: XXX - - PREFIX dc: - PREFIX foaf: - CLEAR ALL ; - INSERT DATA { - GRAPH { a foaf:Document } - GRAPH { a foaf:Document } - GRAPH { a foaf:Document } - } ; - INSERT { - GRAPH { - ?s a dc:BibliographicResource - } - } - WHERE { - ?s a foaf:Document - } - -#### Response - - 2xx or 3xx response - -followed by - -#### Request - - POST /sparql HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Accept: application/sparql-results+xml - Content-Type: application/sparql-query - Content-Length: XXX - - ASK { - GRAPH { - a . - a . - } - FILTER NOT EXISTS { - GRAPH { - a . - } - } - } - -#### Response - - 2xx or 3xx response - Content-Type: application/sparql-results+xml - - true - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:update_dataset_named_graphs rdf:type mf:ProtocolTest ; - mf:name "update with protocol-specified named graphs" ; - rdfs:comment """ -#### Request - - POST /sparql?using-named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/sparql-update - Content-Length: XXX - - PREFIX dc: - PREFIX foaf: - CLEAR ALL ; - INSERT DATA { - GRAPH { a foaf:Document } - GRAPH { a foaf:Document } - GRAPH { a foaf:Document } - } ; - INSERT { - GRAPH { - ?s a dc:BibliographicResource - } - } - WHERE { - GRAPH ?g { - ?s a foaf:Document - } - } - -#### Response - - 2xx or 3xx response - -followed by - -#### Request - - POST /sparql HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Accept: application/sparql-results+xml - Content-Type: application/sparql-query - Content-Length: XXX - - ASK { - GRAPH { - a . - a . - } - FILTER NOT EXISTS { - GRAPH { - a . - } - } - } - -#### Response - - 2xx or 3xx response - Content-Type: application/sparql-results+xml - - true - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:update_dataset_full rdf:type mf:ProtocolTest ; - mf:name "update with protocol-specified dataset (both named and default graphs)" ; - rdfs:comment """ -#### Request - - POST /sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/sparql-update - Content-Length: XXX - - PREFIX dc: - PREFIX foaf: - CLEAR ALL ; - INSERT DATA { - GRAPH { a foaf:Document } - GRAPH { a foaf:Document } - GRAPH { a foaf:Document } - } ; - INSERT { - GRAPH { - ?s ?in - } + } +} +END +""" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Accept"; + ht:fieldValue "application/sparql-results+xml"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-query"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-query" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-results+xml"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "update with protocol-specified dataset (both named and default graphs)" . + +:update_dataset_named_graphs a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ADROP%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-named-graphs-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20a%20dc%3ABibliographicResource%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20GRAPH%20%3Fg%20%7B%0A%20%20%20%20%3Fs%20a%20foaf%3ADocument%0A%20%20%7D%0A%7D%0A" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "2XX", + "3XX" + ] + ] [ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars """ +ASK { + GRAPH { + a . + a . + } + FILTER NOT EXISTS { + GRAPH { + a . } - WHERE { - { - GRAPH ?g { ?s a foaf:Document } - BIND(?g AS ?in) - } - UNION - { - ?s a foaf:Document . - BIND("default" AS ?in) - } - } - -#### Response - - 2xx or 3xx response - -followed by - -#### Request - - POST /sparql HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Accept: application/sparql-results+xml - Content-Type: application/sparql-query - Content-Length: XXX - - ASK { - GRAPH { - "default" . - . - } - FILTER NOT EXISTS { - GRAPH { - ?p ?o - } - } - } - -#### Response - - 2xx or 3xx response - Content-Type: application/sparql-results+xml - - true - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:update_post_form rdf:type mf:ProtocolTest ; - mf:name "update via URL-encoded POST" ; - rdfs:comment """ -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/x-www-form-urlencoded - Content-Length: XXX - - update=CLEAR%20ALL - -#### Response - - 2xx or 3xx response - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:update_post_direct rdf:type mf:ProtocolTest ; - mf:name "update via POST directly" ; - rdfs:comment """ -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/sparql-update - Content-Length: XXX - - CLEAR ALL - -#### Response - - 2xx or 3xx response - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:update_base_uri rdf:type mf:ProtocolTest ; - mf:name "test for service-defined BASE URI (\"which MAY be the service endpoint\")" ; - rdfs:comment """ -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/sparql-update - Content-Length: XXX - - CLEAR GRAPH ; - INSERT DATA { GRAPH { } } - -#### Response - - 2xx or 3xx response - -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/sparql-query - Accept: application/sparql-results+xml - Content-Length: XXX - - SELECT ?o WHERE { - GRAPH { - ?o - } - } - -#### Response - - 2xx or 3xx response - Content-Type: application/sparql-results+xml - - one result with `?o` bound to an IRI that is _not_ `` - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:query_post_direct rdf:type mf:ProtocolTest ; - mf:name "query via POST directly" ; - rdfs:comment """ -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/sparql-query - Content-Length: XXX - - ASK {} - -#### Response - - 2xx or 3xx response - Content-Type: application/sparql-results+xml or application/sparql-results+json - - true - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:bad_query_method rdf:type mf:ProtocolTest ; - mf:name "invoke query operation with a method other than GET or POST" ; - rdfs:comment """ -#### Request - - PUT /sparql?query=ASK%20%7B%7D - -#### Response - - 4xx - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:bad_multiple_queries rdf:type mf:ProtocolTest ; - mf:name "invoke query operation with more than one query string" ; - rdfs:comment """ -#### Request - - GET /sparql?query=ASK%20%7B%7D&query=SELECT%20%2A%20%7B%7D - -#### Response - - 4xx - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:bad_query_wrong_media_type rdf:type mf:ProtocolTest ; - mf:name "invoke query operation with a POST with media type that's not url-encoded or application/sparql-query" ; - rdfs:comment """ -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: text/plain - Content-Length: XXX - - ASK {} - -#### Response - - 4xx - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:bad_query_missing_form_type rdf:type mf:ProtocolTest ; - mf:name "invoke query operation with url-encoded body, but without application/x-www-form-urlencoded media type" ; - rdfs:comment """ -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Length: XXX - - query=ASK%20%7B%7D - -#### Response - - 4xx - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:bad_query_missing_direct_type rdf:type mf:ProtocolTest ; - mf:name "invoke query operation with SPARQL body, but without application/sparql-query media type" ; - rdfs:comment """ -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Length: XXX - - ASK {} - -#### Response - - 4xx - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:bad_query_non_utf8 rdf:type mf:ProtocolTest ; - mf:name "invoke query operation with direct POST, but with a non-UTF8 encoding (UTF-16)" ; - rdfs:comment """ -(content body encoded in utf-16) - -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/sparql-query; charset=UTF-16 - Content-Length: XXX - - ASK {} - -#### Response - - 4xx - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:bad_query_syntax rdf:type mf:ProtocolTest ; - mf:name "invoke query operation with invalid query syntax (4XX result)" ; - rdfs:comment """ -#### Request - - GET /sparql?query=ASK%20%7B - -#### Response - - 4xx - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:bad_update_get rdf:type mf:ProtocolTest ; - mf:name "invoke update operation with GET" ; - rdfs:comment """ -#### Request - - GET /sparql?update=CLEAR%20ALL - -#### Response - - 4xx - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:bad_multiple_updates rdf:type mf:ProtocolTest ; - mf:name "invoke update operation with more than one update string" ; - rdfs:comment """ -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/x-www-form-urlencoded - Content-Length: XXX - - update=CLEAR%20NAMED&update=CLEAR%20DEFAULT - -#### Response - - 4xx - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:bad_update_wrong_media_type rdf:type mf:ProtocolTest ; - mf:name "invoke update operation with a POST with media type that's not url-encoded or application/sparql-update" ; - rdfs:comment """ -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: text/plain - Content-Length: XXX - - CLEAR NAMED - -#### Response - - 4xx - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:bad_update_missing_form_type rdf:type mf:ProtocolTest ; - mf:name "invoke update operation with url-encoded body, but without application/x-www-form-urlencoded media type" ; - rdfs:comment """ -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Length: XXX - - update=CLEAR%20NAMED - -#### Response - - 4xx - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:bad_update_non_utf8 rdf:type mf:ProtocolTest ; - mf:name "invoke update operation with direct POST, but with a non-UTF8 encoding" ; - rdfs:comment """ -(content body encoded in utf-16) - -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/sparql-update; charset=UTF-16 - Content-Length: XXX - - CLEAR NAMED - -#### Response - - 4xx - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:bad_update_syntax rdf:type mf:ProtocolTest ; - mf:name "invoke update operation with invalid update syntax" ; - rdfs:comment """ -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/x-www-form-urlencoded - Content-Length: XXX - - update=CLEAR%20XYZ - -#### Response - - 4xx - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . - -:bad_update_dataset_conflict rdf:type mf:ProtocolTest ; - mf:name "invoke update with both using-graph-uri/using-named-graph-uri parameter and USING/WITH clause" ; - rdfs:comment """ -#### Request - - POST /sparql/ HTTP/1.1 - Host: www.example - User-agent: sparql-client/0.1 - Content-Type: application/x-www-form-urlencoded - Content-Length: XXX - - using-named-graph-uri=http%3A%2F%2Fexample%2Fpeople&update=%09%09PREFIX%20foaf%3A%20%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0A%09%09WITH%20%3Chttp%3A%2F%2Fexample%2Faddresses%3E%0A%09%09DELETE%20%7B%20%3Fperson%20foaf%3AgivenName%20%27Bill%27%20%7D%0A%09%09INSERT%20%7B%20%3Fperson%20foaf%3AgivenName%20%27William%27%20%7D%0A%09%09WHERE%20%7B%0A%09%09%09%3Fperson%20foaf%3AgivenName%20%27Bill%27%0A%09%09%7D%0A - -#### Response - - 4xx - """ ; - dawgt:approval dawgt:Approved ; - dawgt:approvedBy ; - . + } +} +""" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Accept"; + ht:fieldValue "application/sparql-results+xml"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-query"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-query" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-results+xml"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-results+xml" + ]) + ]); + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "update with protocol-specified named graphs" . + +:update_post_direct a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "CLEAR ALL" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/sparql-update"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/sparql-update" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "update via POST directly" . + +:update_post_form a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "/sparql"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars "update=CLEAR%20ALL" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "application/x-www-form-urlencoded"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "application/x-www-form-urlencoded" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "2XX", + "3XX" + ] + ]) + ]; + mf:name "update via URL-encoded POST" . diff --git a/sparql11/data-sparql11/protocol/protocol_validator.cgi b/sparql11/data-sparql11/protocol/protocol_validator.cgi new file mode 100755 index 00000000..7b4a7ebc --- /dev/null +++ b/sparql11/data-sparql11/protocol/protocol_validator.cgi @@ -0,0 +1,1438 @@ +#!/usr/bin/perl + +use utf8; +use strict; +use warnings; +use lib qw(lib); +use Data::Dumper; +use CGI qw(Accept); +use JSON; +use TryCatch; +use Encode; +use Data::Dumper; +use HTTP::Request::Common; +use Scalar::Util qw(blessed); +use LWP::UserAgent; +use URI::Escape; +use RDF::Trine qw(statement iri literal blank); +use RDF::Trine::Namespace qw(rdf dc xsd); +use Plack; +use Plack::Request; +use Plack::Response; +use Plack::Handler::CGI; + +our $VERSION = 0.1; +our $SHOW_ERROR_DETAIL = 1; +# our $SUBMIT_URL = 'http://localhost/protocol_validator.cgi'; +# our $SUBMIT_URL = 'http://kasei.us/2009/09/sparql/protocol_validator.cgi'; +our $SUBMIT_URL = 'http://www.w3.org/2009/sparql/protocol_validator'; + +use constant { + PASS => 'pass', + FAIL => 'fail', +}; + +use constant NEGATIVE_TESTS => qw( + bad_query_method + bad_multiple_queries + bad_query_wrong_media_type + bad_query_missing_form_type + bad_query_missing_direct_type + bad_query_non_utf8 + bad_query_syntax + bad_update_get + bad_multiple_updates + bad_update_wrong_media_type + bad_update_missing_form_type + bad_update_non_utf8 + bad_update_syntax + bad_update_dataset_conflict +); + +use constant POSITIVE_TESTS => qw( + query_post_form + query_get + query_post_direct + query_dataset_default_graph + query_dataset_default_graphs_get + query_dataset_default_graphs_post + query_dataset_named_graphs_post + query_dataset_named_graphs_get + query_dataset_full + query_multiple_dataset + query_content_type_select + query_content_type_ask + query_content_type_describe + query_content_type_construct + update_dataset_default_graph + update_dataset_default_graphs + update_dataset_named_graphs + update_dataset_full + update_post_form + update_post_direct + update_base_uri +); + +use constant REQUIRED_TESTS => (POSITIVE_TESTS(), NEGATIVE_TESTS()); +use constant OPTIONAL_TESTS => (); + +use constant DESCRIPTION => { + "query_get" => "query via GET", + "query_post_form" => "query via URL-encoded POST", + "query_post_direct" => "query via POST directly", + "query_dataset_default_graph" => "query with protocol-specified default graph", + "query_dataset_default_graphs_post" => "POST query with protocol-specified default graphs", + "query_dataset_default_graphs_get" => "GET query with protocol-specified default graphs", + "query_dataset_named_graphs_post" => "POST query with protocol-specified named graphs", + "query_dataset_named_graphs_get" => "GET query with protocol-specified named graphs", + "query_dataset_full" => "query with protocol-specified dataset (both named and default graphs)", + "query_multiple_dataset" => "query specifying dataset in both query string and protocol; test for use of protocol-specified dataset", # (test relies on the endpoint allowing client-specified RDF datasets; returns 400 otherwise) + "query_content_type_select" => "SELECT query appropriate content type (expect one of: XML, JSON, CSV, TSV)", + "query_content_type_ask" => "ASK query appropriate content type (expect one of: XML, JSON)", + "query_content_type_describe" => "DESCRIBE query appropriate content type (expect one of: RDF/XML, Turtle, N-Triples, RDFa)", + "query_content_type_construct" => "CONSTRUCT query appropriate content type (expect one of: RDF/XML, Turtle, N-Triples, RDFa)", + "update_dataset_default_graph" => "update with protocol-specified default graph", + "update_dataset_default_graphs" => "update with protocol-specified default graphs", + "update_dataset_named_graphs" => "update with protocol-specified named graphs", + "update_dataset_full" => "update with protocol-specified dataset (both named and default graphs)", + "update_post_form" => "update via URL-encoded POST", + "update_post_direct" => "update via POST directly", + "update_base_uri" => "test for service-defined BASE URI (\"which MAY be the service endpoint\")", + "bad_query_method" => "invoke query operation with a method other than GET or POST", + "bad_multiple_queries" => "invoke query operation with more than one query string", + "bad_query_wrong_media_type" => "invoke query operation with a POST with media type that's not url-encoded or application/sparql-query", + "bad_query_missing_form_type" => "invoke query operation with url-encoded body, but without application/x-www-form-urlencoded media type", + "bad_query_missing_direct_type" => "invoke query operation with SPARQL body, but without application/sparql-query media type", + "bad_query_non_utf8" => "invoke query operation with direct POST, but with a non-UTF8 encoding (UTF-16)", + "bad_query_syntax" => "invoke query operation with invalid query syntax (4XX result)", + "bad_update_get" => "invoke update operation with GET", + "bad_multiple_updates" => "invoke update operation with more than one update string", + "bad_update_wrong_media_type" => "invoke update operation with a POST with media type that's not url-encoded or application/sparql-update", + "bad_update_missing_form_type" => "invoke update operation with url-encoded body, but without application/x-www-form-urlencoded media type", +# "bad_update_missing_direct_type" => "invoke update operation with SPARQL body, but without application/sparql-update media type", + "bad_update_non_utf8" => "invoke update operation with direct POST, but with a non-UTF8 encoding", + "bad_update_syntax" => "invoke update operation with invalid update syntax (4XX result)", + "bad_update_dataset_conflict" => "invoke update with both using-graph-uri/using-named-graph-uri parameter and USING/WITH clause", +}; + +# $XML::SAX::ParserPackage = "XML::SAX::Expat"; +our $VALIDATOR_IRI = 'http://www.w3.org/2009/sparql/protocol_validator#validator'; +my $doap = RDF::Trine::Namespace->new( 'http://usefulinc.com/ns/doap#' ); +my $earl = RDF::Trine::Namespace->new( 'http://www.w3.org/ns/earl#' ); +my $sd = RDF::Trine::Namespace->new( 'http://www.w3.org/ns/sparql-service-description#' ); +my $ptests = RDF::Trine::Namespace->new( 'http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#' ); + +binmode(\*STDOUT, ':utf8'); +# if (scalar(@ARGV)) { +# my $q = new CGI; +# $q->param('Accept' => 'text/turtle'); +# my $qurl = shift || ''; +# my $uurl = shift || ''; +# my $res = validate($qurl, $uurl, 1); +# results_response($qurl, $uurl, '#implementation#', '#name#', '#homepage#', $res, 1, $q); +# exit; +# } + +my $app = sub { + my $env = shift; + my $req = Plack::Request->new($env); + my $qurl = $req->param('query_url'); + my $uurl = $req->param('update_url'); + my $opt = $req->param('bp') ? 1 : 0; + my $sw = $req->param('software'); + my $name = $req->param('softwarename'); + my $homepage = $req->param('softwareurl'); + if ($homepage) { + $homepage = iri($homepage); + } + + my $res; + if ($qurl or $uurl) { + $res = validate($qurl, $uurl, $opt); + $res = results_response($qurl, $uurl, $sw, $name, $homepage, $res, $opt, $req); + } else { + $res = $req->new_response(200); + $res->content_type('text/html; charset=UTF-8'); + my $head = html_header(); + my $form = form('', '', '','',''); + my $foot = html_footer(); + $res->body( [$head, $form, $foot] ); + } + return $res->finalize; +}; + +Plack::Handler::CGI->new->run($app); + +sub passed { + my $res = shift; + my $test = shift; + my $type = test_type($test); + no warnings 'uninitialized'; + return ($res->{$type}{$test}{result} eq PASS); +} + +sub test_messages { + my $res = shift; + my $test = shift; + my $type = test_type($test); + my $msg = $res->{$type}{$test}{message}; + if (ref($msg)) { + return @$msg; + } else { + return ($msg); + } +} + +sub test_detail { + my $res = shift; + my $test = shift; + my $type = test_type($test); + my $detail = $res->{$type}{$test}{detail}; + return $detail; +} + +sub test_type { + my $test = shift; + foreach my $t (REQUIRED_TESTS) { + return 'required' if ($test eq $t); + } + return 'optional'; +} + +sub add_result { + my $res = shift; + my $test = shift; + my $status = shift; + my $mesg = shift; + my $detail = shift; + my $type = test_type($test); + my $desc = DESCRIPTION->{ $test }; + $res->{$type}{$test} = { result => $status, description => $desc }; + if (defined $mesg) { + $res->{$type}{$test}{ message } = $mesg; + } + if (defined $detail) { + $res->{$type}{$test}{ detail } = $detail; + } +} + +sub update_result { + my $res = shift; + my $test = shift; + my $status = shift; + my $mesg = shift; + my $type = test_type($test); + my $desc = DESCRIPTION->{ $test }; + if (exists($res->{$test})) { + my $result = $res->{$type}{$test}{result}; + if ($result eq PASS and $status eq FAIL) { + $res->{$type}{$test}{result} = FAIL; + } + if ($mesg) { + push(@{ $res->{$type}{$test}{ message } }, $mesg); + } + } else { + $res->{$type}{$test} = { result => $status, description => $desc }; + if ($mesg) { + $res->{$type}{$test}{ message } = [ $mesg ]; + } + } +} + +sub validate { + my $qurl = shift; + my $uurl = shift; + my $opt = shift; + my $model = RDF::Trine::Model->new(); + my $res = {}; + my $pass = 0; + + my $ua = LWP::UserAgent->new; + $ua->agent("SPARQL11ProtocolValidator/$VERSION " . $ua->_agent); + + if (1) { + ### Positive tests + foreach my $t (POSITIVE_TESTS) { + try { + my $name = $t; + $name =~ tr/-/_/; + + unless ($qurl) { + next if $name =~ /query/i; + } + unless ($uurl and $qurl) { + next if $name =~ /update/i; + } + + # warn "Positive test: $t\n"; + if (my $cv = __PACKAGE__->can("test_$name")) { + $cv->($ua, $qurl, $uurl, $opt, $res, $t); + } else { + warn "*** no implementation for test: $name\n"; + } + } catch ($e) { + warn "faield test $t with error: " . Dumper($e); + } + } + } + + if (1) { + ### Negative tests + my @tests = bad_requests( $qurl, $uurl ); + my %tests; + foreach my $t (@tests) { + try { + my ($name, $req) = @$t; + unless ($qurl) { + next if $name =~ /query/i; + } + unless ($uurl and $qurl) { + next if $name =~ /update/i; + } + + $tests{ $name } = $req; + } + } + + foreach my $name (NEGATIVE_TESTS) { + try { + my $req = $tests{ $name }; + warn "No request object for test $name" unless ($req); + my $resp = $ua->request( $req ); + my $code = $resp->code; + if ($code =~ /^[45]\d\d$/) { + add_result( $res, $name, PASS ); + } else { + add_result( $res, $name, FAIL, "Expected an error response code, but got: " . $resp->status_line, [$req, $resp] ); + } + } + } + } + + + return $res; +} + +sub results_response { + my $qurl = shift; + my $uurl = shift; + my $sw = shift; + my $name = shift; + my $homepage = shift; + my $res = shift; + my $opt = shift; + my $req = shift; + my @accept; + push(@accept, { type => 'text/html', value => Accept('text/html') } ); + push(@accept, { type => 'application/json', value => Accept('application/json') } ); + push(@accept, { type => 'application/rdf+xml', value => Accept('application/rdf+xml') } ); + push(@accept, { type => 'text/turtle', value => Accept('text/turtle') } ); + push(@accept, { type => 'text/plain', value => Accept('text/plain') } ); + @accept = sort { $b->{value} <=> $a->{value} || $b->{type} eq 'html' } @accept; + my $a = $accept[0]; + + my $tested = ($sw) ? iri($sw) : iri($qurl); + + my $resp = Plack::Response->new(200); + if ($a->{type} eq 'text/html') { + $resp->content_type('text/html; charset=UTF-8'); + my $url = $homepage ? $homepage->uri_value : ''; + $resp->body(html_results($qurl, $uurl, $tested->uri_value, $name, $url, $res, $opt)); + } elsif ($a->{type} eq 'application/json') { + my $data = { endpoint => $qurl, results => $res }; + if (length($tested)) { + $data->{software} = $tested; + } + my $type = $a->{type}; + $resp->content_type("${type}; charset=UTF-8"); + $resp->body(JSON->new->utf8->pretty->encode($data)); + } elsif ($a->{type} =~ m#^((application/rdf[+]xml)|(text/(turtle|plain)))$#) { + my $mediatype = $a->{type}; + $resp->content_type("${mediatype}; charset=UTF-8"); + my $map = RDF::Trine::NamespaceMap->new( { rdf => $rdf, earl => $earl, prot => $ptests, dc => $dc, doap => $doap } ); + my $type; + if ($a->{type} =~ /turtle/) { + $type = 'turtle'; + } elsif ($a->{type} =~ /xml/) { + $type = 'rdfxml'; + } else { + $type = 'ntriples'; + } + my $s = RDF::Trine::Serializer->new( $type, namespaces => $map ); + $resp->body(rdf_results($qurl, $uurl, $tested, $name, $homepage, $res, $s, $opt)); + } else { + $resp->content_type("text/plain; charset=UTF-8"); + $resp->body("should emit $a->{type}"); + } + return $resp; +} + +sub results_model { + my $qurl = shift; + my $uurl = shift; + my $tested = shift; + my $name = shift; + my $homepage = shift; + my $res = shift; + my $s = shift; + my $opt = shift; + my $model = RDF::Trine::Model->new(); + my ($sec, $min, $hour, $day, $mon, $year) = gmtime(); + $mon++; + $year += 1900; + my $time = sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ', $year, $mon, $day, $hour, $min, $sec); + my $by = iri($VALIDATOR_IRI); + my @tests = (REQUIRED_TESTS); + if ($opt) { + push(@tests, OPTIONAL_TESTS); + } + + $model->add_statement( statement($tested, $rdf->type, $doap->Project) ); + $model->add_statement( statement($tested, $doap->name, literal($name)) ); + $model->add_statement( statement($tested, $doap->homepage, $homepage) ); + + foreach my $test (@tests) { + unless ($qurl) { + next if $test =~ /query/i; + } + unless ($uurl and $qurl) { + next if $test =~ /update/i; + } + + my $type = test_type($test); + my $desc = DESCRIPTION->{ $test }; + no warnings 'uninitialized'; + my $status = ($res->{$type}{$test}{result} eq PASS) ? $earl->pass : $earl->fail; + + my $a = blank(); + my $r = blank(); + $model->add_statement( statement($a, $rdf->type, $earl->Assertion) ); + $model->add_statement( statement($a, $earl->assertedBy, $by) ); + $model->add_statement( statement($a, $earl->subject, $tested) ); + $model->add_statement( statement($a, $earl->result, $r) ); + $model->add_statement( statement($a, $earl->test, $ptests->$test()) ); + $model->add_statement( statement($r, $rdf->type, $earl->TestResult) ); + $model->add_statement( statement($r, $earl->outcome, $status) ); + $model->add_statement( statement($r, $dc->date, literal($time, undef, $xsd->dateTime)) ); + my @msg = test_messages($res, $test); + foreach my $m (@msg) { + next unless (defined($m)); + my $st = statement($r, $earl->info, literal($m)); + $model->add_statement( $st ); + } + } + return $model; +} + + +sub rdf_results { + my $qurl = shift; + my $uurl = shift; + my $tested = shift; + my $name = shift; + my $homepage = shift; + my $res = shift; + my $s = shift; + my $opt = shift; + my $model = results_model($qurl, $uurl, $tested, $name, $homepage, $res, $s, $opt); + return $s->serialize_model_to_string( $model ); +} + +sub html_results { + my $qurl = shift; + my $uurl = shift; + my $tested = shift; + my $name = shift; + my $homepage = shift; + my $res = shift; + my $opt = shift; + my $head = html_header(); + my $form = form($qurl, $uurl, $tested, $name, $homepage); + + my $body = $head . $form; + + my $req_total = 0; + my $req_passed = 0; + my $req_failed = 0; + foreach my $test (REQUIRED_TESTS) { + unless ($qurl) { + next if $test =~ /query/i; + } + unless ($uurl and $qurl) { + next if $test =~ /update/i; + } + + $req_total++; + if (passed($res, $test)) { + $req_passed++; + } else { + $req_failed++; + } + } + + my $opt_total = 0; + my $opt_passed = 0; + my $opt_failed = 0; + if ($opt) { + foreach my $test (OPTIONAL_TESTS) { + $opt_total++; + if (passed($res, $test)) { + $opt_passed++; + } else { + $opt_failed++; + } + } + } + + my $total = $req_total + $opt_total; + my $passed = $req_passed + $opt_passed; + my $failed = $req_failed + $opt_failed; + + my $req_class; + if ($req_total == $req_passed) { + $req_class = 'pass'; + } elsif ($req_total == $req_failed) { + $req_class = 'fail'; + } else { + $req_class = 'fail'; + } + + my $opt_class; + if ($opt) { + if ($opt_total == $opt_passed) { + $opt_class = 'pass'; + } elsif ($opt_total == $opt_failed) { + $opt_class = 'fail'; + } else { + $opt_class = 'fail'; + } + } + + my $impl = qq[${name}]; + + if ($total == $passed) { + $body .= qq[

All tests passed for ${impl}

\n]; + } elsif ($req_total == $req_failed) { + $body .= qq[

All required tests failed for ${impl}

\n]; + } elsif ($req_total == $req_passed) { + $body .= qq[

All required tests passed, but some tests failed for ${impl}

\n]; + } else { + $body .= qq[

Some tests failed for ${impl}

\n]; + } + + $body .= <<"END"; + + + + + + + + + +END +# if ($opt) { +# $body .= <<"END"; +# +# +# +# +# END +# } + + $body .= <<"END"; +
TestPassed tests
Required Tests${req_passed}/${req_total}
Best Practice Tests${opt_passed}/${opt_total}
+END + $body .= <<"END"; +

Required Tests

+
    +END + foreach my $test (REQUIRED_TESTS) { + unless ($qurl) { + next if $test =~ /query/i; + } + unless ($uurl and $qurl) { + next if $test =~ /update/i; + } + + my $type = test_type($test); + my $desc = "$test: " . DESCRIPTION->{ $test }; + no warnings 'uninitialized'; + my $status; + if ($res->{$type}{$test}{result} eq PASS) { + $status = qq[✔ PASS]; + } else { + $status = qq[✘ FAIL]; + } + my @msg = test_messages($res, $test); + my $msg = scalar(@msg) ? join("
    ", @msg) : ''; + my $detail = test_detail($res, $test); + + my $class = ($res->{$type}{$test}{result} eq PASS) ? 'pass' : 'fail'; + $body .= <<"END"; +
  • + ${status} ${desc} +END + if ($SHOW_ERROR_DETAIL) { # XXX show failure details in html + if (length($msg)) { + my $reqs = ''; + my $resps = ''; + if (ref($detail)) { + my ($req, $resp) = @$detail; + $reqs = $req->as_string; + $resps = $resp->as_string; + for ($reqs, $resps) { + s/\n}g; + } + } + $body .= <<"END"; +
    +

    $msg

    +

    Request:

    +

    $reqs

    +

    Response:

    +

    $resps

    +
    +END + } + } + $body .= <<"END"; +
  • +END + } + $body .= qq[\t
\n]; + + + +# if ($opt) { +# $body .= <<"END"; +#

Best Practice Tests

+#
    +# END +# foreach my $test (OPTIONAL_TESTS) { +# my $type = test_type($test); +# my $desc = DESCRIPTION->{ $test }; +# no warnings 'uninitialized'; +# my $status = ($res->{$type}{$test}{result} eq PASS) ? qq[✔ PASS] : qq[✘ FAIL]; +# my @msg = test_messages($res, $test); +# my $msg = scalar(@msg) ? join("
    ", @msg) : ''; +# my $class = ($res->{$type}{$test}{result} eq PASS) ? 'pass' : 'fail'; +# $body .= <<"END"; +#
  • +# ${status} ${desc} +# END +# if (length($msg)) { +# $body .= qq[\t\t\t$msg\n]; +# } +# +# $body .= <<"END"; +#
  • +# END +# } +# $body .= qq[\t
\n]; +# } + + $body .= html_footer(); + return $body; +} + +sub form { + my $qurl = shift; + my $uurl = shift; + my $software = shift; + my $name = shift; + my $homepage = shift; + return <<"END"; +
+ SPARQL Query Endpoint:
+ SPARQL Update Endpoint:
+ Implementation software IRI:
+ Implementation Name:
+ Implementation Homepage:
+ + +
+END +} + +sub html_header { + return <<"END"; + + + + + SPARQL Protocol Report + + + +END +} + +sub html_footer { + return <<"END"; + + +END +} + +sub _positive_test_request { + my ($ua, $res, $name, $req) = @_; + my $resp = $ua->request( $req ); +# warn $resp->status_line; + if ($resp->is_success) { + return $resp; + } else { + add_result( $res, $name, FAIL, "Expected success response code, but got: " . $resp->status_line, [$req, $resp] ); + return; + } +} + +sub _test_boolean_result_for_true { + my ($req, $resp, $res, $name) = @_; + my $type = $resp->header('Content-Type'); + my $content = $resp->decoded_content; + my $iter = ($type =~ /xml/) ? RDF::Trine::Iterator->from_string($content) : RDF::Trine::Iterator->from_json($content); + my $r = $iter->next; + if ($r) { + add_result( $res, $name, PASS ); + } else { + add_result( $res, $name, FAIL, "Expected true SPARQL boolean result, but got false", [$req, $resp] ); + } +} + +sub _test_result_for_select_query { + my ($req, $resp, $res, $name) = @_; + my $type = $resp->header('Content-Type'); + if (_test_for_media_type($type, 'application/sparql-results+xml')) { + add_result( $res, $name, PASS ); + } elsif (_test_for_media_type($type, 'application/sparql-results+json')) { + add_result( $res, $name, PASS ); + } elsif ($type =~ m#text/tab-separated-values#) { + add_result( $res, $name, PASS ); + } elsif ($type =~ m#text/csv#) { + add_result( $res, $name, PASS ); + } else { + add_result( $res, $name, FAIL, "Expected SPARQL Results format appropriate for SELECT form, but got $type", [$req, $resp] ); + } +} + +sub _test_result_for_ask_query { + my ($req, $resp, $res, $name) = @_; + Carp::confess unless (blessed($resp) and $resp->can('header')); + my $type = $resp->header('Content-Type'); + if (_test_for_media_type($type, 'application/sparql-results+xml')) { + add_result( $res, $name, PASS ); + } elsif (_test_for_media_type($type, 'application/sparql-results+json')) { + add_result( $res, $name, PASS ); + } else { + add_result( $res, $name, FAIL, "Expected SPARQL Results format appropriate for ASK form, but got $type", [$req, $resp] ); + } +} + +sub _test_result_for_rdf_type { + my ($req, $resp, $res, $name) = @_; + my $type = $resp->header('Content-Type'); + + # RDF/XML, Turtle, N-Triples, RDFa + if ($type =~ m#^((application/rdf[+](xml|json))|(text/turtle))#) { + add_result( $res, $name, PASS ); + # XXX @@ + } else { + add_result( $res, $name, FAIL, "Expected RDF Results format, but got $type", [$req, $resp] ); + } +} + +sub _test_for_media_type { + my $got = shift; + my $expect = shift; +# warn "testing media type $got...\n"; + my $re = quotemeta($expect); + return ($got =~ m{^${re}(?:\s*;\s*charset=.*)?$}); +} + +sub __________TESTS__________ {} + +sub bad_requests { + my $qurl = shift; + my $uurl = shift; + + my @reqs; + + if ($qurl) { + { + # bad-query-method - invoke query operation with a method other than GET or POST + my $req = PUT("${qurl}?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", Content => ''); + push(@reqs, [ 'bad_query_method', $req]); + } + + { + # bad-multiple-queries - invoke query operation with more than one query string + my $req = GET("${qurl}?query=ASK%20%7B%7D&query=SELECT%20%2A%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"); + push(@reqs, [ 'bad_multiple_queries', $req]); + } + + { + # bad-query-wrong-media-type - invoke query operation with a POST with media type that's not url-encoded or application/sparql-query + my $req = POST($qurl, ['default-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data0.rdf'], 'Content-Type' => 'text/plain', Content => 'ASK {}'); + push(@reqs, [ 'bad_query_wrong_media_type', $req]); + } + + { + # bad-query-missing-form-type - invoke query operation with url-encoded body, but without application/x-www-form-urlencoded media type + my $req = POST($qurl, ['query' => 'ASK {}', 'default-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data0.rdf']); + $req->remove_header('Content-Type'); + push(@reqs, [ 'bad_query_missing_form_type', $req]); + } + + { + # bad-query-missing-direct-type - invoke query operation with SPARQL body, but without application/sparql-query media type + my $req = HTTP::Request->new('POST', $qurl, ['default-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data0.rdf']); + $req->content('ASK {}'); + push(@reqs, [ 'bad_query_missing_direct_type', $req]); + } + + { + # bad-query-non-utf8 - invoke query operation with direct POST, but with a non-UTF8 encoding (UTF-16) + my $req = POST($qurl, ['default-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data0.rdf'], 'Content-Type' => 'application/sparql-query; charset=UTF-16', Content => encode('utf-16', 'ASK {}')); + push(@reqs, [ 'bad_query_non_utf8', $req]); + } + + { + # bad-query-syntax - invoke query operation with invalid query syntax (4XX result) + my $req = GET("${qurl}?query=ASK%20%7B&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"); + push(@reqs, [ 'bad_query_syntax', $req]); + } + } + + if ($uurl) { + { + # bad-update-get - invoke update operation with GET + my $req = GET("${uurl}?update=CLEAR%20ALL&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"); + push(@reqs, [ 'bad_update_get', $req]); + } + + { + # bad-multiple-updates - invoke update operation with more than one update string + my $req = POST($uurl, [ 'update' => 'CLEAR NAMED', 'update' => 'CLEAR DEFAULT', 'using-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data0.rdf' ]); + push(@reqs, [ 'bad_multiple_updates', $req]); + } + + { + # bad-update-wrong-media-type - invoke update operation with a POST with media type that's not url-encoded or application/sparql-update + my $req = POST($uurl, ['using-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data0.rdf'], 'Content-Type' => 'text/plain', Content => 'CLEAR NAMED'); + push(@reqs, [ 'bad_update_wrong_media_type', $req]); + } + + { + # bad-update-missing-form-type - invoke update operation with url-encoded body, but without application/x-www-form-urlencoded media type + my $req = POST($uurl, [ 'update' => 'CLEAR NAMED', 'using-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data0.rdf' ]); + $req->remove_header('Content-Type'); + push(@reqs, [ 'bad_update_missing_form_type', $req]); + } + +# { +# # bad-update-missing-direct-type - invoke update operation with SPARQL body, but without application/sparql-update media type +# my $req = POST($uurl, ['using-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data0.rdf'], Content => 'CLEAR NAMED'); +# $req->remove_header('Content-Type'); +# push(@reqs, [ 'bad_update_missing_direct_type', $req]); +# } + + { + # bad-update-non-utf8 - invoke update operation with direct POST, but with a non-UTF8 encoding + my $req = POST($uurl, ['using-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data0.rdf'], 'Content-Type' => 'application/sparql-update; charset=UTF-16', Content => encode('utf-16', 'CLEAR NAMED')); + push(@reqs, [ 'bad_update_non_utf8', $req]); + } + + { + # bad-update-syntax - invoke update operation with invalid update syntax (4XX result) + my $req = POST($uurl, ['update' => 'CLEAR XYZ', 'using-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data0.rdf']); + push(@reqs, [ 'bad_update_syntax', $req]); + } + + { + # bad-update-dataset-conflict - invoke update with both using-graph-uri/using-named-graph-uri parameter and USING/WITH clause + my $update = <<"END"; +PREFIX foaf: +WITH +DELETE { ?person foaf:givenName 'Bill' } +INSERT { ?person foaf:givenName 'William' } +WHERE { + ?person foaf:givenName 'Bill' +} +END + my $req = POST($uurl, ['using-named-graph-uri' => 'http://example/people', 'update' => $update]); + push(@reqs, [ 'bad_update_dataset_conflict', $req]); + } + } + + return @reqs; +} + +sub test_query_get { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + my $req = GET("${qurl}?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + my $type = $resp->header('Content-Type'); + if (_test_for_media_type($type, 'application/sparql-results+xml') or _test_for_media_type($type, 'application/sparql-results+json')) { + _test_boolean_result_for_true( $req, $resp, $res, $name ); + + } else { + add_result( $res, $name, FAIL, "Expected SPARQL XML or JSON results, but got: " . $type, [$req, $resp] ); + } + } +} + +sub test_query_post_form { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + my $req = POST($qurl, ['query' => 'ASK {}', 'default-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data0.rdf']); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + my $type = $resp->header('Content-Type'); + if (_test_for_media_type($type, 'application/sparql-results+xml') or _test_for_media_type($type, 'application/sparql-results+json')) { + _test_boolean_result_for_true( $req, $resp, $res, $name ); + } else { + add_result( $res, $name, FAIL, "Expected SPARQL XML or JSON results, but got: " . $type, [$req, $resp] ); + } + } +} + +sub test_query_post_direct { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + my $req = POST($qurl, ['default-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data0.rdf'], 'Content-Type' => 'application/sparql-query', Content => 'ASK {}'); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + my $type = $resp->header('Content-Type'); + if (_test_for_media_type($type, 'application/sparql-results+xml') or _test_for_media_type($type, 'application/sparql-results+json')) { + _test_boolean_result_for_true( $req, $resp, $res, $name ); + } else { + add_result( $res, $name, FAIL, "Expected SPARQL XML or JSON results, but got: " . $type, [$req, $resp] ); + } + } +} + +sub _setup_dataset { + my $ua = shift; + my $uurl = shift; + my $res = shift; + my $name = shift; + my $dgraphs = shift; + my $graphs = shift; + my @ops = ('DROP ALL'); + foreach my $g (@$dgraphs) { + push(@ops, "LOAD <$g>"); + } + foreach my $g (@$graphs) { + push(@ops, "LOAD <$g> INTO GRAPH <$g>"); + } + my $sparql = join(" ;\n", @ops); + my $req = POST($uurl, [ + 'update' => $sparql, + ]); + my $resp = $ua->request( $req ); + if ($resp->is_success) { + return 1; + } else { + add_result( $res, $name, FAIL, "Failed to setup dataset; " . $resp->status_line, [$req, $resp] ); + return; + } +} + +sub test_query_dataset_default_graph { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + _setup_dataset($ua, $uurl, $res, $name, [], ['http://kasei.us/2009/09/sparql/data/data1.rdf']) or return; + my $req = POST($qurl, [ + 'query' => 'ASK { ?p ?o }', + 'default-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data1.rdf' + ]); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + my $type = $resp->header('Content-Type'); + if (_test_for_media_type($type, 'application/sparql-results+xml') or _test_for_media_type($type, 'application/sparql-results+json')) { + _test_boolean_result_for_true( $req, $resp, $res, $name ); + } else { + add_result( $res, $name, FAIL, "Expected SPARQL XML or JSON results, but got: " . $type, [$req, $resp] ); + } + } +} + +sub test_query_dataset_default_graphs_post { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + _setup_dataset($ua, $uurl, $res, $name, [], ['http://kasei.us/2009/09/sparql/data/data1.rdf', 'http://kasei.us/2009/09/sparql/data/data2.rdf']) or return; + my $req = POST($qurl, [ + 'query' => 'ASK { a ?type . a ?type . }', + 'default-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data1.rdf', + 'default-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data2.rdf' + ]); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + my $type = $resp->header('Content-Type'); + if (_test_for_media_type($type, 'application/sparql-results+xml') or _test_for_media_type($type, 'application/sparql-results+json')) { + _test_boolean_result_for_true( $req, $resp, $res, $name ); + } else { + add_result( $res, $name, FAIL, "Expected SPARQL XML or JSON results, but got: " . $type, [$req, $resp] ); + } + } +} + +sub test_query_dataset_default_graphs_get { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + _setup_dataset($ua, $uurl, $res, $name, [], ['http://kasei.us/2009/09/sparql/data/data1.rdf', 'http://kasei.us/2009/09/sparql/data/data2.rdf']) or return; + my $req = GET("${qurl}?query=ASK%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20.%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20.%20%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf"); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + my $type = $resp->header('Content-Type'); + if (_test_for_media_type($type, 'application/sparql-results+xml') or _test_for_media_type($type, 'application/sparql-results+json')) { + _test_boolean_result_for_true( $req, $resp, $res, $name ); + } else { + add_result( $res, $name, FAIL, "Expected SPARQL XML or JSON results, but got: " . $type, [$req, $resp] ); + } + } +} + +sub test_query_dataset_named_graphs_post { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + _setup_dataset($ua, $uurl, $res, $name, [], ['http://kasei.us/2009/09/sparql/data/data1.rdf', 'http://kasei.us/2009/09/sparql/data/data2.rdf']) or return; + my $req = POST($qurl, [ + 'query' => 'ASK { GRAPH ?g1 { a ?type } GRAPH ?g2 { a ?type } }', + 'named-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data1.rdf', + 'named-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data2.rdf' + ]); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + my $type = $resp->header('Content-Type'); + if (_test_for_media_type($type, 'application/sparql-results+xml') or _test_for_media_type($type, 'application/sparql-results+json')) { + _test_boolean_result_for_true( $req, $resp, $res, $name ); + } else { + add_result( $res, $name, FAIL, "Expected SPARQL XML or JSON results, but got: " . $type, [$req, $resp] ); + } + } +} + +sub test_query_dataset_named_graphs_get { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + _setup_dataset($ua, $uurl, $res, $name, [], ['http://kasei.us/2009/09/sparql/data/data1.rdf', 'http://kasei.us/2009/09/sparql/data/data2.rdf']) or return; + my $req = GET("${qurl}?query=ASK%20%7B%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%20%7D&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf"); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + my $type = $resp->header('Content-Type'); + if (_test_for_media_type($type, 'application/sparql-results+xml') or _test_for_media_type($type, 'application/sparql-results+json')) { + _test_boolean_result_for_true( $req, $resp, $res, $name ); + } else { + add_result( $res, $name, FAIL, "Expected SPARQL XML or JSON results, but got: " . $type, [$req, $resp] ); + } + } +} + +sub test_query_dataset_full { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + _setup_dataset($ua, $uurl, $res, $name, [], ['http://kasei.us/2009/09/sparql/data/data1.rdf', 'http://kasei.us/2009/09/sparql/data/data2.rdf', 'http://kasei.us/2009/09/sparql/data/data3.rdf']) or return; + my $query = <<"END"; +ASK { + a ?type + GRAPH ?g1 { a ?type } + GRAPH ?g2 { a ?type } +} +END + my $req = POST($qurl, [ + 'query' => $query, + 'default-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data3.rdf', + 'named-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data1.rdf', + 'named-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data2.rdf' + ]); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + my $type = $resp->header('Content-Type'); + if (_test_for_media_type($type, 'application/sparql-results+xml') or _test_for_media_type($type, 'application/sparql-results+json')) { + _test_boolean_result_for_true( $req, $resp, $res, $name ); + } else { + add_result( $res, $name, FAIL, "Expected SPARQL XML or JSON results, but got: " . $type, [$req, $resp] ); + } + } +} + +sub test_query_multiple_dataset { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + _setup_dataset($ua, $uurl, $res, $name, [], ['http://kasei.us/2009/09/sparql/data/data1.rdf', 'http://kasei.us/2009/09/sparql/data/data2.rdf', 'http://kasei.us/2009/09/sparql/data/data3.rdf']) or return; + my $req = POST($qurl, [ + 'query' => 'ASK FROM { GRAPH ?g1 { a ?type } GRAPH ?g2 { a ?type } }', + 'named-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data1.rdf', + 'named-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data2.rdf' + ]); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + my $type = $resp->header('Content-Type'); + if (_test_for_media_type($type, 'application/sparql-results+xml') or _test_for_media_type($type, 'application/sparql-results+json')) { + _test_boolean_result_for_true( $req, $resp, $res, $name ); + } else { + add_result( $res, $name, FAIL, "Expected SPARQL XML or JSON results, but got: " . $type, [$req, $resp] ); + } + } +} + +sub test_query_content_type_select { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + my $req = POST($qurl, [ 'query' => 'SELECT (1 AS ?value) {}', 'default-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data0.rdf' ]); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + my $type = $resp->header('Content-Type'); + _test_result_for_select_query( $req, $resp, $res, $name ); + } +} + +sub test_query_content_type_ask { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + my $req = POST($qurl, [ 'query' => 'ASK {}', 'default-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data0.rdf' ]); +# warn $req->as_string; + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { +# warn $resp->as_string; + my $type = $resp->header('Content-Type'); + _test_result_for_ask_query( $req, $resp, $res, $name ); + } +} + +sub test_query_content_type_describe { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + my $req = POST($qurl, [ 'query' => 'DESCRIBE ', 'default-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data0.rdf' ]); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + my $type = $resp->header('Content-Type'); + _test_result_for_rdf_type( $req, $resp, $res, $name ); + } +} + +sub test_query_content_type_construct { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + my $req = POST($qurl, [ 'query' => 'CONSTRUCT {

1 } WHERE {}', 'default-graph-uri' => 'http://kasei.us/2009/09/sparql/data/data0.rdf' ]); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + my $type = $resp->header('Content-Type'); + _test_result_for_rdf_type( $req, $resp, $res, $name ); + } +} + +sub __________UPDATE_TESTS__________ {} + +sub test_update_post_form { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + my $req = POST($uurl, [ + 'update' => 'CLEAR ALL', + ]); + my $resp = $ua->request( $req ); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + add_result( $res, $name, PASS ); + } +} + +sub test_update_post_direct { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + my $req = POST($uurl, [], 'Content-Type' => 'application/sparql-update', Content => 'CLEAR ALL'); + my $resp = $ua->request( $req ); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + add_result( $res, $name, PASS ); + } +} + +sub test_update_base_uri { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + { + my $resp = $ua->request( POST($uurl, [ + 'update' => 'CLEAR SILENT GRAPH ; INSERT DATA { GRAPH { } }', + ]) ); + } + my $req = POST($qurl, [ + 'query' => 'SELECT ?o WHERE { GRAPH { ?o } }' + ], 'Accept' => 'application/sparql-results+xml'); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + my $content = $resp->decoded_content; + my $iter = RDF::Trine::Iterator->from_string($content); + my $row = blessed($iter) ? $iter->next : {}; + my $term = $row->{'o'}; + if (blessed($term)) { + my $uri = $term->uri_value; + if ($uri eq 'test') { + add_result( $res, $name, FAIL, "No BASE URI was applied to inserted data", [$req, $resp] ); + } else { + add_result( $res, $name, PASS ); + } + } else { + add_result( $res, $name, FAIL, "Failed to retrieve inserted data with subsequent query", [$req, $resp] ); + } + } +} + +sub test_update_dataset_default_graph { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + { + my $sparql = <<"END"; +PREFIX dc: +PREFIX foaf: +CLEAR ALL ; +INSERT DATA { + GRAPH { + a foaf:Document + } +} ; +INSERT { + GRAPH { + ?s a dc:BibliographicResource + } +} +WHERE { + ?s a foaf:Document +} +END + my $req = POST("${uurl}?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf", [ + 'update' => $sparql, + ]); + return unless (my $resp = _positive_test_request($ua, $res, $name, $req)); + } + + if (0) { + my $sparql = "SELECT * WHERE { GRAPH ?g { ?s ?p ?o } }"; + my $req = POST($qurl, [], 'Content-Type' => 'application/sparql-query', 'Accept' => 'application/sparql-results+xml', Content => $sparql); + my $resp = _positive_test_request($ua, $res, $name, $req); + warn $resp->decoded_content; + die; + } + + { + my $sparql = <<"END"; +ASK { + GRAPH { + a + } +} +END + my $req = POST($qurl, [], 'Content-Type' => 'application/sparql-query', 'Accept' => 'application/sparql-results+xml', Content => $sparql); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + my $xmlres = $resp->decoded_content; + my $type = $resp->header('Content-Type'); + if (_test_for_media_type($type, 'application/sparql-results+xml')) { + _test_boolean_result_for_true( $req, $resp, $res, $name ); + } else { + add_result( $res, $name, FAIL, "Expected SPARQL XML or JSON results, but got: " . $type, [$req, $resp] ); + } + } + } +} + +sub test_update_dataset_default_graphs { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + { + my $sparql = <<"END"; +PREFIX dc: +PREFIX foaf: +DROP ALL ; +INSERT DATA { + GRAPH { a foaf:Document } + GRAPH { a foaf:Document } + GRAPH { a foaf:Document } +} ; +INSERT { + GRAPH { + ?s a dc:BibliographicResource + } +} +WHERE { + ?s a foaf:Document +} +END + my $req = POST("${uurl}?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", [ + 'update' => $sparql, + ]); + return unless (my $resp = _positive_test_request($ua, $res, $name, $req)); + } + + { + my $sparql = <<"END"; +ASK { + GRAPH { + a . + a . + } + FILTER NOT EXISTS { + GRAPH { + a . + } + } +} +END + my $req = POST($qurl, [], 'Content-Type' => 'application/sparql-query', 'Accept' => 'application/sparql-results+xml', Content => $sparql); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + my $xmlres = $resp->decoded_content; + my $type = $resp->header('Content-Type'); + if (_test_for_media_type($type, 'application/sparql-results+xml')) { + _test_boolean_result_for_true( $req, $resp, $res, $name ); + } else { + add_result( $res, $name, FAIL, "Expected SPARQL XML or JSON results, but got: " . $type, [$req, $resp] ); + } + } + } +} + +sub test_update_dataset_named_graphs { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + { + my $sparql = <<"END"; +PREFIX dc: +PREFIX foaf: +DROP ALL ; +INSERT DATA { + GRAPH { a foaf:Document } + GRAPH { a foaf:Document } + GRAPH { a foaf:Document } +} ; +INSERT { + GRAPH { + ?s a dc:BibliographicResource + } +} +WHERE { + GRAPH ?g { + ?s a foaf:Document + } +} +END + my $req = POST("${uurl}?using-named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", [ + 'update' => $sparql, + ]); + return unless (my $resp = _positive_test_request($ua, $res, $name, $req)); + } + + { + my $sparql = <<"END"; +ASK { + GRAPH { + a . + a . + } + FILTER NOT EXISTS { + GRAPH { + a . + } + } +} +END + my $req = POST($qurl, [], 'Content-Type' => 'application/sparql-query', 'Accept' => 'application/sparql-results+xml', Content => $sparql); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + my $xmlres = $resp->decoded_content; + my $type = $resp->header('Content-Type'); + if (_test_for_media_type($type, 'application/sparql-results+xml')) { + _test_boolean_result_for_true( $req, $resp, $res, $name ); + } else { + add_result( $res, $name, FAIL, "Expected SPARQL XML or JSON results, but got: " . $type, [$req, $resp] ); + } + } + } +} + +sub test_update_dataset_full { + my ($ua, $qurl, $uurl, $opt, $res, $name) = @_; + { + my $sparql = <<"END"; +PREFIX dc: +PREFIX foaf: +DROP ALL ; +INSERT DATA { + GRAPH { a foaf:Document } + GRAPH { a foaf:Document } + GRAPH { a foaf:Document } +} ; +INSERT { + GRAPH { + ?s ?in + } +} +WHERE { + { + GRAPH ?g { ?s a foaf:Document } + BIND(?g AS ?in) + } + UNION + { + ?s a foaf:Document . + BIND("default" AS ?in) + } +} +END + my $req = POST("${uurl}?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", [ + 'update' => $sparql, + ]); + return unless (my $resp = _positive_test_request($ua, $res, $name, $req)); + } + + { + my $sparql = <<"END"; +ASK { + GRAPH { + "default" . + . + } + FILTER NOT EXISTS { + GRAPH { + ?p ?o + } + } +} +END + my $req = POST($qurl, [], 'Content-Type' => 'application/sparql-query', 'Accept' => 'application/sparql-results+xml', Content => $sparql); + if (my $resp = _positive_test_request($ua, $res, $name, $req)) { + my $xmlres = $resp->decoded_content; + my $type = $resp->header('Content-Type'); + if (_test_for_media_type($type, 'application/sparql-results+xml')) { + _test_boolean_result_for_true( $req, $resp, $res, $name ); + } else { + add_result( $res, $name, FAIL, "Expected SPARQL XML or JSON results, but got: " . $type, [$req, $resp] ); + } + } + } +} + +__END__ \ No newline at end of file diff --git a/sparql11/data-sparql11/protocol/template.haml b/sparql11/data-sparql11/protocol/template.haml index 0f1a0e52..2ec771b1 100644 --- a/sparql11/data-sparql11/protocol/template.haml +++ b/sparql11/data-sparql11/protocol/template.haml @@ -1,5 +1,5 @@ !!! 5 -%html{lang: :en, prefix: "dawgt: http://www.w3.org/2001/sw/DataAccess/tests/test-dawg# mf: http://www.w3.org/2001/sw/DataAccess/tests/test-manifest# mfx: http://jena.hpl.hp.com/2005/05/test-manifest-extra# qt: http://www.w3.org/2001/sw/DataAccess/tests/test-query# sd: http://www.w3.org/ns/sparql-service-description# ut: http://www.w3.org/2009/sparql/tests/test-update#"} +%html{lang: :en, prefix: "dawgt: http://www.w3.org/2001/sw/DataAccess/tests/test-dawg# mf: http://www.w3.org/2001/sw/DataAccess/tests/test-manifest# cnt: http://www.w3.org/2011/content# ht: http://www.w3.org/2011/http#"} %head %meta{"http-equiv" => "Content-Type", content: "text/html;charset=utf-8"} %meta{name: "viewport", content: "width=device-width, initial-scale=1.0"} @@ -63,21 +63,6 @@ :markdown This page describes W3C SPARQL Working Group's SPARQL1.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: - - * "query_url" -- query endpoint URL - * "update_url" -- update endpoint URL - * "software" -- The Protocol implementation IRI that will be used if [conneg](http://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html) is used and requests RDF - - The following parameters *should* also be accounted for (in a future version): - - * does the default graph change based on other graphs (e.g. acts as the union of named graphs)? - - ### 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: @@ -123,20 +108,14 @@ Test Descriptions %dl.test-description - man['entries'].each do |test| - %dt{id: test['@id']} - %a.testlink{href: "##{test['@id']}"} + %dt{id: test['@id'][1..-1]} + %a.testlink{href: "#{test['@id']}"} = "#{test['@id']}:" %span{about: test['@id'], property: "mf:name"}<~test['name'] %dd{property: "mf:entry", inlist: true, resource: test['@id'], typeof: test['@type']} - %div{property: "rdfs:comment"} - :markdown - #{test['comment'].to_s.gsub(/(MUST|SHOULD|MAY)/, '\\1')} - - if test['type'] =~ /Negative/ - %p.error - Negative Test %dl.test-detail %dt="type" - %dd<~test['@type'] + %dd{property: 'rdf:type'}<~test['@type'] %dt="approval" %dd{property: "mf:approval", resource: test['approval']}<~test['approval'] - # Syntax Tests @@ -144,85 +123,84 @@ %dt="approvedBy" %dd %a{property: "dawgt:approvedBy", href: test['approvedBy']}<~test['approvedBy'] - - - # Evaluation Tests - - if test['action'].is_a?(String) - %dt="action" - %dd - %a{property: "mf:action", href: test['action']}<~test['action'] - - if test['action'].is_a?(Hash) - %dt="action" - %dd - %dl.test-detail{property: "mf:action", resource: test['action']['@id']} - - # Entailment - - if test['action']['EntailmentProfile'] - %dt='EntailmentProfile' - %dd - - test['action']['EntailmentProfile'].each do |r| - %span{property: "sd:EntailmentProfile", resource: r}<~r - - if test['action']['http://www.w3.org/ns/sparql-service-description#EntailmentProfile'] - %dt='EntailmentProfile' - %dd{property: "sd:EntailmentProfile", resource: test['action']['http://www.w3.org/ns/sparql-service-description#EntailmentProfile']['@id']}<~test['action']['http://www.w3.org/ns/sparql-service-description#EntailmentProfile']['@id'] - - if test['action']['entailmentRegime'] - %dt='entailmentRegime' - %dd - - test['action']['entailmentRegime'].each do |r| - %span{property: "sd:entailmentRegime", resource: r}<~r - - if test['action']['http://www.w3.org/ns/sparql-service-description#entailmentRegime'] - %dt='entailmentRegime' - %dd{property: "sd:entailmentRegime", resource: test['action']['http://www.w3.org/ns/sparql-service-description#entailmentRegime']['@id']}<~test['action']['http://www.w3.org/ns/sparql-service-description#entailmentRegime']['@id'] - - - if test['action']['query'] - %dt='query' - %dd - %a{property: "qt:query", href: test['action']['query']}<~test['action']['query'] - - if test['action']['data'] - %dt='data' - %dd - %a{property: "qt:data", href: test['action']['data']}<~test['action']['data'] - - if test['action']['ut:data'] - %dt='data' - %dd - %a{property: "ut:data", href: test['action']['ut:data']}<~test['action']['ut:data'] - - if test['action']['ut:graphData'] - %dt='graphData' - %dd - %table.test-detail - - test['action']['ut:graphData'].each do |gd| - %tr{property: 'ut:graphData', resource: gd['@id']} - %td{property: "rdfs:label"}<~gd['label'] - %td - %a{property: "ut:graph", href: gd['ut:graph']}<~gd['ut:graph'] - - if test['action']['ut:request'] - %dt='request' - %dd - %a{property: "ut:request", href: test['action']['ut:request']}<~test['action']['ut:request'] - - - if test['result'].is_a?(String) - %dt="result" - %dd - %a{property: "mf:result", href: test['result']}<~test['result'] - - if test['result'].is_a?(Hash) - %dt="result" - %dd - %dl.test-detail{property: "mf:result", resource: test['result']['@id']} - - if test['result']['ut:result'] - %dt='result' - %dd - %code{property: "ut:result", resource: test['result']['ut:result']}<~test['result']['ut:result'] - - if test['result']['ut:data'] - %dt='data' - %dd - %a{property: "ut:data", href: test['result']['ut:data']}<~test['result']['ut:data'] - - if test['result']['ut:graphData'] - %dt='graphData' - %dd - %table.test-detail - - test['result']['ut:graphData'].each do |gd| - %tr{property: 'ut:graphData', resource: gd['@id']} - %td{property: "rdfs:label"}<~gd['label'] - %td - %a{property: "ut:graph", href: gd['ut:graph']}<~gd['ut:graph'] + - # Evaluation Tests + - if test['action'].is_a?(Hash) + %div.test-detail{property: "mf:action", typeof: test['action']['@type']} + %meta{property: "ht:connectionAuthority", value: test['action']['ht:connectionAuthority']} + %div{property: 'ht:requests', inlist: true} + - test['action']['requests'].each_with_index do |request, ndx| + - response = request['ht:resp'] + - if ndx > 0 + %br + %div + followed by + %div{typeof: request['@type']} + %h4 Request + %code + %span{property: 'ht:methodName'}<=request['ht:methodName'] + %span{property: 'ht:absolutePath'}&=request['ht:absolutePath'] + HTTP/ + %span{property: 'ht:absolutePath'}<>=request['ht:httpVersion'] + %br + %span<="Host: " + test['action']['ht:connectionAuthority'] + %br + - if request['headers'] + %span{property: 'ht:headers', inlist: true} + - request['headers'].each do |header| + %div{typeof: header['@type']} + %meta{property: 'ht:fieldValue', value: header['ht:fieldValue']} + %span{property: 'ht:fieldName'}<>= header['ht:fieldName'] + = ': ' + %span{property: 'ht:headerElements', inlist: true} + - header['headerElements'].each_with_index do |he, hendx| + - if hendx > 0 + %span or + %span{typeof: he['@type']} + %span{property: 'ht:elementName'}<>= he['ht:elementName'] + - Array(he['params']).each do |param| + = "; " + %span{property: 'ht:params', typeof: param['@type'], inlist: true} + %span{property: 'ht:paramName'}<>= param['ht:paramName'] + = "=" + %span{property: 'ht:paramValue'}<>= param['ht:paramValue'] + - if request['ht:body'] + %br + %div{property: 'ht:body', typeof: request['ht:body']['@type']} + %meta{property: 'cnt:characterEncoding', value: request['ht:body']['cnt:characterEncoding']} + %span{property: 'cnt:chars'}&= request['ht:body']['cnt:chars'] + %div{typeof: response['@type']} + %h4 Response + %code + - response['ht:statusCodeValue'].each_with_index do |s, sndx| + - if sndx > 0 + = "or" + %span{property: 'ht:statusCodeValue'}<=s + %span + response + - if response['headers'] + %span{property: 'ht:headers', inlist: true} + - response['headers'].each_with_index do |header, hndx| + %div{typeof: header['@type']} + %meta{property: 'ht:fieldValue', value: header['ht:fieldValue']} + %span{property: 'ht:fieldName'}<>= header['ht:fieldName'] + = ': ' + %span{property: 'ht:headerElements', inlist: true} + - header['headerElements'].each_with_index do |he, hendx| + - if hendx > 0 + %span or + %span{typeof: he['@type']} + %span{property: 'ht:elementName'}<>= he['ht:elementName'] + - Array(he['params']).each do |param| + = "; " + %span{property: 'ht:params', typeof: param['@type'], inlist: true} + %span{property: 'ht:paramName'}<>= param['ht:paramName'] + = "=" + %span{property: 'ht:paramValue'}<>= param['ht:paramValue'] + - if response['ht:body'] + %br + %div{property: 'ht:body', typeof: response['ht:body']['@type']} + %meta{property: 'cnt:characterEncoding', value: response['ht:body']['cnt:characterEncoding']} + %span{property: 'cnt:chars'}&= response['ht:body']['cnt:chars'] %footer :markdown From ad40f933cadec0def640bcebdbcbc93f1c90e04b Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 25 Apr 2022 14:21:30 -0700 Subject: [PATCH 4/8] Validate and lint HTML/RDFa output. --- .../data-sparql11/protocol/gen_manifest.rb | 8 ++- sparql11/data-sparql11/protocol/index.html | 70 +++++++++---------- sparql11/data-sparql11/protocol/template.haml | 2 +- 3 files changed, 41 insertions(+), 39 deletions(-) diff --git a/sparql11/data-sparql11/protocol/gen_manifest.rb b/sparql11/data-sparql11/protocol/gen_manifest.rb index 74d8ab39..7f88e077 100644 --- a/sparql11/data-sparql11/protocol/gen_manifest.rb +++ b/sparql11/data-sparql11/protocol/gen_manifest.rb @@ -1,6 +1,7 @@ require 'cgi' require 'getoptlong' require 'json/ld' +require 'rdf/rdfa' require 'rdf/reasoner' require 'rdf/turtle' require 'haml' @@ -883,12 +884,13 @@ def usage(**options) template = File.read(File.expand_path('../template.haml', __FILE__)) engine = Haml::Engine.new(template, format: :html5) html = engine.render(self, man: JSON.parse(man.to_json)) + validate(RDF::RDFa::Reader.new(html, base_uri: "http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest.ttl", validate: validate)) if validate output.write(html) when :jsonld - validate(JSON::LD::Reader.new(man.to_json)) if validate + validate(JSON::LD::Reader.new(man.to_json, base_uri: "http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest.ttl", validate: validate)) if validate output.puts man.to_json(JSON::LD::JSON_STATE) when :ttl - JSON::LD::Reader.new(man.to_json) do |reader| + JSON::LD::Reader.new(man.to_json, validate: validate) do |reader| ttl = RDF::Turtle::Writer.buffer( prefixes: { "": "http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest#", @@ -902,7 +904,7 @@ def usage(**options) } ) {|writer| writer << reader} - validate(RDF::Turtle::Reader.new(ttl)) if validate + validate(RDF::Turtle::Reader.new(ttl, base_uri: "http://www.w3.org/2009/sparql/docs/tests/data-sparql11/protocol/manifest.ttl", validate: true)) if validate # Do some result hacking ttl.sub!('', '<>') diff --git a/sparql11/data-sparql11/protocol/index.html b/sparql11/data-sparql11/protocol/index.html index 96b88fe0..9b87f689 100644 --- a/sparql11/data-sparql11/protocol/index.html +++ b/sparql11/data-sparql11/protocol/index.html @@ -116,7 +116,7 @@

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -169,7 +169,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -229,7 +229,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -294,7 +294,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -359,7 +359,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -412,7 +412,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -477,7 +477,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -542,7 +542,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -595,7 +595,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -660,7 +660,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -725,7 +725,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -789,7 +789,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -849,7 +849,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -915,7 +915,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -981,7 +981,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -1082,7 +1082,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -1189,7 +1189,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -1296,7 +1296,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -1399,7 +1399,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -1450,7 +1450,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -1501,7 +1501,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -1601,7 +1601,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -1639,7 +1639,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -1677,7 +1677,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -1727,7 +1727,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -1770,7 +1770,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -1820,7 +1820,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -1871,7 +1871,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -1909,7 +1909,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -1947,7 +1947,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -1997,7 +1997,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -2047,7 +2047,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -2090,7 +2090,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -2141,7 +2141,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
@@ -2191,7 +2191,7 @@

Response

type
-
mf:ProtocolTest
+
mf:ProtocolTest
approval
dawgt:Approved
approvedBy
diff --git a/sparql11/data-sparql11/protocol/template.haml b/sparql11/data-sparql11/protocol/template.haml index 2ec771b1..ebee15ac 100644 --- a/sparql11/data-sparql11/protocol/template.haml +++ b/sparql11/data-sparql11/protocol/template.haml @@ -115,7 +115,7 @@ %dd{property: "mf:entry", inlist: true, resource: test['@id'], typeof: test['@type']} %dl.test-detail %dt="type" - %dd{property: 'rdf:type'}<~test['@type'] + %dd<~test['@type'] %dt="approval" %dd{property: "mf:approval", resource: test['approval']}<~test['approval'] - # Syntax Tests From a4c095c0ac7802717a67681a8b104b8b1d94e803 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Tue, 26 Apr 2022 14:22:24 -0700 Subject: [PATCH 5/8] Fix a couple of errors in queries. --- sparql11/data-sparql11/protocol/gen_manifest.rb | 3 +-- sparql11/data-sparql11/protocol/index.html | 3 +-- sparql11/data-sparql11/protocol/manifest.jsonld | 4 ++-- sparql11/data-sparql11/protocol/manifest.ttl | 3 +-- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/sparql11/data-sparql11/protocol/gen_manifest.rb b/sparql11/data-sparql11/protocol/gen_manifest.rb index 7f88e077..3a54b099 100644 --- a/sparql11/data-sparql11/protocol/gen_manifest.rb +++ b/sparql11/data-sparql11/protocol/gen_manifest.rb @@ -424,7 +424,6 @@ } } } -END ), 'Content-Type': 'application/sparql-query', 'Accept': 'application/sparql-results+xml', @@ -558,7 +557,7 @@ name: "invoke query operation with invalid query syntax (4XX result)", req: [{ method: :GET, - query: 'ASK {}', + query: 'ASK {', "default-graph-uri": "http://kasei.us/2009/09/sparql/data/data0.rdf", resp: { status: "4XX" diff --git a/sparql11/data-sparql11/protocol/index.html b/sparql11/data-sparql11/protocol/index.html index 9b87f689..977571ba 100644 --- a/sparql11/data-sparql11/protocol/index.html +++ b/sparql11/data-sparql11/protocol/index.html @@ -1368,7 +1368,6 @@

Request

} } } -END

@@ -1885,7 +1884,7 @@

Response

Request

GET -/sparql?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf +/sparql?query=ASK%20%7B&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf HTTP/1.1
Host: www.example
diff --git a/sparql11/data-sparql11/protocol/manifest.jsonld b/sparql11/data-sparql11/protocol/manifest.jsonld index 43cf2454..46f982ef 100644 --- a/sparql11/data-sparql11/protocol/manifest.jsonld +++ b/sparql11/data-sparql11/protocol/manifest.jsonld @@ -1330,7 +1330,7 @@ ], "ht:body": { "@type": "cnt:ContentAsText", - "cnt:chars": "\nASK {\n GRAPH {\n \"default\" .\n .\n }\n FILTER NOT EXISTS {\n GRAPH {\n ?p ?o\n }\n }\n}\nEND\n", + "cnt:chars": "\nASK {\n GRAPH {\n \"default\" .\n .\n }\n FILTER NOT EXISTS {\n GRAPH {\n ?p ?o\n }\n }\n}\n", "cnt:characterEncoding": "UTF-8" }, "ht:resp": { @@ -1779,7 +1779,7 @@ "@type": "ht:Request", "ht:methodName": "GET", "ht:httpVersion": "1.1", - "ht:absolutePath": "/sparql?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", + "ht:absolutePath": "/sparql?query=ASK%20%7B&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", "ht:resp": { "@type": "ht:Response", "ht:statusCodeValue": [ diff --git a/sparql11/data-sparql11/protocol/manifest.ttl b/sparql11/data-sparql11/protocol/manifest.ttl index 8d3b7a22..2e41f47d 100644 --- a/sparql11/data-sparql11/protocol/manifest.ttl +++ b/sparql11/data-sparql11/protocol/manifest.ttl @@ -227,7 +227,7 @@ Some tests require special result processing. ht:connectionAuthority "www.example"; ht:requests ([ a ht:Request; - ht:absolutePath "/sparql?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; + ht:absolutePath "/sparql?query=ASK%20%7B&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; ht:httpVersion "1.1"; ht:methodName "GET"; ht:resp [ @@ -1413,7 +1413,6 @@ ASK { } } } -END """ ]; ht:headers ([ From 653cda3c2c80f6a03662d0bea58d0958724b18a6 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 27 Apr 2022 15:48:28 -0700 Subject: [PATCH 6/8] Update http-rdf-update manifests the same as with protocol. --- .../data-sparql11/http-rdf-update/Rakefile | 14 + .../http-rdf-update/gen_manifest.rb | 640 ++++++ .../data-sparql11/http-rdf-update/index.html | 1763 +++++++++++------ .../http-rdf-update/manifest-frame.jsonld | 28 - .../http-rdf-update/manifest.jsonld | 1231 ++++++++++++ .../http-rdf-update/manifest.ttl | 1447 +++++++++----- .../http-rdf-update/template.haml | 181 +- 7 files changed, 4129 insertions(+), 1175 deletions(-) create mode 100644 sparql11/data-sparql11/http-rdf-update/Rakefile create mode 100644 sparql11/data-sparql11/http-rdf-update/gen_manifest.rb delete mode 100644 sparql11/data-sparql11/http-rdf-update/manifest-frame.jsonld create mode 100644 sparql11/data-sparql11/http-rdf-update/manifest.jsonld diff --git a/sparql11/data-sparql11/http-rdf-update/Rakefile b/sparql11/data-sparql11/http-rdf-update/Rakefile new file mode 100644 index 00000000..c3c62b82 --- /dev/null +++ b/sparql11/data-sparql11/http-rdf-update/Rakefile @@ -0,0 +1,14 @@ +# Builds manifests +task default: [:jsonld, :ttl, :html] + +task jsonld: "gen_manifest.rb" do + %x(ruby gen_manifest.rb -o manifest.jsonld) +end + +task ttl: "gen_manifest.rb" do + %x(ruby gen_manifest.rb --format ttl -o manifest.ttl) +end + +task html: "gen_manifest.rb" do + %x(ruby gen_manifest.rb --format html -o index.html) +end diff --git a/sparql11/data-sparql11/http-rdf-update/gen_manifest.rb b/sparql11/data-sparql11/http-rdf-update/gen_manifest.rb new file mode 100644 index 00000000..0908e982 --- /dev/null +++ b/sparql11/data-sparql11/http-rdf-update/gen_manifest.rb @@ -0,0 +1,640 @@ +require 'cgi' +require 'getoptlong' +require 'json/ld' +require 'rdf/rdfa' +require 'rdf/reasoner' +require 'rdf/turtle' +require 'haml' +require 'byebug' +require 'amazing_print' + +# Test descriptions used for generating Manifest and HTML renderings. +# +# ### Request (`req`): +# * `method`: HTTP request method +# * `content`: HTTP request content. If an object/hash, used to create application/x-www-form-urlencoded content. If the request `Content-Type` header indicates a text encoding this MUST be used for encoding any POST content. +# * `Accept`: HTTP request accept header +# * `Content-Type`: HTTP request content-type (defaults to `application/x-www-form-urlencoded` for POST). +# * Other entries are encoded as request query parameters. +# +# If `req` has more than one entry, the intermediate response is expected to be a success with the following `resp` description used to match the final response. +# +# ### Response (`resp`): +# `status`: HTTP response status to match. +# `Content-Type`: response content-type expected to match one of these. +POSITIVE_TESTS = { + put__initial_state: { + name: "PUT - Initial state", + req: [{ + method: :PUT, + path: "$GRAPHSTORE$/person/1.ttl", + Host: "$HOST$", + "Content-Type": "text/turtle; charset=utf-8", + content: %( +@prefix foaf: . +@prefix v: . + + a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:fn "John Doe" + ]. +), + resp: { + status: %w(201) + } + }], + }, + get_of_put__initial_state: { + name: "GET of PUT - Initial state", + req: [{ + method: :GET, + path: "$GRAPHSTORE$?graph=$GRAPHSTORE$/person/1.ttl", + Host: "$HOST$", + Accept: "text/turtle", + resp: { + status: %w(200), + "Content-Type": "text/turtle; charset=utf-8", + content: %( + a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:fn "John Doe" + ]. +) + } + }], + }, + put__graph_already_in_store: { + name: "PUT - graph already in store", + req: [{ + method: :PUT, + path: "$GRAPHSTORE$/person/1", + Host: "$HOST$", + "Content-Type": "text/turtle; charset=utf-8", + content: %( +@prefix foaf: . +@prefix v: . + + a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:fn "Jane Doe" + ]. +), + resp: { + status: %w(204), + } + }], + }, + get_of_put__graph_already_in_store: { + name: "GET of PUT - graph already in store", + req: [{ + method: :GET, + path: "$GRAPHSTORE$/person/1", + Host: "$HOST$", + Accept: "text/turtle", + resp: { + status: %w(200), + "Content-Type": "text/turtle; charset=utf-8", + content: %( +@prefix foaf: . +@prefix v: . + + a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:fn "Jane Doe" + ] . +) + } + }], + }, + put__default_graph: { + name: "PUT - default graph", + req: [{ + method: :PUT, + path: "$GRAPHSTORE$?default", + Host: "$HOST$", + "Content-Type": "text/turtle; charset=utf-8", + content: %( +@prefix foaf: . +@prefix v: . + +[] a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:given-name "Alice" + ] . +), + resp: { + status: %w(201), + } + }], + }, + get_of_put__default_graph: { + name: "GET of PUT - default graph", + req: [{ + method: :GET, + path: "$GRAPHSTORE$?default", + Host: "$HOST$", + Accept: "text/turtle", + resp: { + status: %w(200), + "Content-Type": "text/turtle; charset=utf-8", + content: %( +@prefix foaf: . +@prefix v: . + +[] a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:given-name "Alice" + ] . +) + } + }], + }, + put__mismatched_payload: { + name: "PUT - mismatched payload", + req: [{ + method: :PUT, + path: "$GRAPHSTORE$?default", + Host: "$HOST$", + "Content-Type": "text/turtle; charset=utf-8", + content: %( +@prefix foaf: . +@prefix v: . + + a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:fn "Jane Doe" + ]. +), + resp: { + status: %w(400), + } + }], + }, + delete__existing_graph: { + name: "DELETE - existing graph", + req: [{ + method: :DELETE, + path: "$GRAPHSTORE$/person/2.ttl", + Host: "$HOST$", + resp: { + status: %w(200), + } + }], + }, + get_of_delete__existing_graph: { + name: "GET of DELETE - existing graph", + req: [{ + method: :GET, + path: "$GRAPHSTORE$/person/2.ttl", + Host: "$HOST$", + resp: { + status: %w(404), + } + }], + }, + delete__nonexistent_graph: { + name: "DELETE - non-existent graph)", + req: [{ + method: :DELETE, + path: "$GRAPHSTORE$/person/2.ttl", + Host: "$HOST$", + resp: { + status: %w(404), + } + }], + }, + post__existing_graph: { + name: "POST - existing graph", + req: [{ + method: :POST, + path: "$GRAPHSTORE$/person/1.ttl", + Host: "$HOST$", + "Content-Type": "text/turtle; charset=utf-8", + content: %( +@prefix foaf: . + + foaf:name "Jane Doe" +), + resp: { + status: %w(200), + } + }], + }, + get_of_post__existing_graph: { + name: "GET of POST - existing graph", + req: [{ + method: :GET, + path: "$GRAPHSTORE$/person/1.ttl", + Host: "$HOST$", + Accept: "text/turtle", + resp: { + status: %w(200), + "Content-Type": "text/turtle; charset=utf-8", + content: %( +@prefix foaf: . +@prefix v: . + + a foaf:Person; + foaf:name "Jane Doe"; + foaf:businessCard [ + a v:VCard; + v:fn "Jane Doe" + ] . +) + } + }], + }, + post__multipart_formdata: { + name: "POST - multipart/form-data", + req: [{ + method: :POST, + path: "$GRAPHSTORE$/person/1.ttl", + Host: "$HOST$", + "Content-Type": "multipart/form-data; boundary=a6fe4cd636164618814be9f8d3d1a0de", + content: %( +--a6fe4cd636164618814be9f8d3d1a0de +Content-Disposition: form-data; name="lastName.ttl"; filename="lastName.ttl" +Content-Type: text/turtle; charset=utf-8 + +@prefix foaf: . + foaf:familyName "Doe" + +--a6fe4cd636164618814be9f8d3d1a0de +Content-Disposition: form-data; name="firstName.ttl"; filename="firstName.ttl" +Content-Type: text/turtle; charset=utf-8 + +@prefix foaf: . + foaf:givenName "Jane" + +--a6fe4cd636164618814be9f8d3d1a0de-- + ), + resp: { + status: %w(200), + } + }], + }, + get_of_post__multipart_formdata: { + name: "GET of POST - multipart/form-data", + req: [{ + method: :GET, + path: "$GRAPHSTORE$/person/1.ttl", + Host: "$HOST$", + resp: { + status: %w(200), + "Content-Type": "text/turtle; charset=utf-8", + content: %( +@prefix foaf: . +@prefix v: . + + a foaf:Person; + foaf:name "Jane Doe"; + foaf:givenName "Jane"; + foaf:familyName "Doe"; + foaf:businessCard [ + a v:VCard; + v:fn "Jane Doe" + ] . +) + } + }], + }, + post__create__new_graph: { + name: "POST - create new graph", + req: [{ + method: :POST, + path: "$GRAPHSTORE$", + Host: "$HOST$", + "Content-Type": "text/turtle; charset=utf-8", + content: %( +@prefix foaf: . +@prefix v: . + +[] a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:given-name "Alice" + ] . +), + resp: { + status: %w(201), + Location: "$NEWPATH$" + } + }], + }, + get_of_post__create__new_graph: { + name: "GET of POST - create new graph", + req: [{ + method: :GET, + path: "$NEWPATH$", + Host: "$HOST$", + Accept: "text/turtle", + resp: { + status: %w(200), + "Content-Type": "text/turtle; charset=utf-8", + content: %( +[] a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:given-name "Alice" + ] . +) + } + }], + }, + get_of_post__after_noop: { + name: "GET of POST - after noop", + req: [{ + method: :GET, + path: "$NEWPATH$", + Host: "$HOST$", + Accept: "text/turtle", + resp: { + status: %w(200), + "Content-Type": "text/turtle; charset=utf-8", + content: %( +[] a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:given-name "Alice" + ] . +) + } + }] + }, + head_on_an_existing_graph: { + name: "", + req: [{ + method: :HEAD, + path: "$GRAPHSTORE$/person/1.ttl", + Host: "$HOST$", + resp: { + status: %w(200), + "Content-Type": "text/turtle; charset=utf-8", + } + }] + }, + head_on_a_nonexisting_graph: { + name: "HEAD on a non-existing graph", + req: [{ + method: :HEAD, + path: "$GRAPHSTORE$/person/4.ttl", + Host: "$HOST$", + resp: { + status: %w(404), + } + }] + } +} + +def req_uri(params) + params.map do |key, values| + unless %i(method name content resp Content-Type Accept).include?(key) + Array(values).map do |value| + "#{key}=#{CGI.escape(value.to_s).gsub('+', '%20')}" + end.join('&') + end + end.compact.join('&') +end + +def encode_header(params, field) + values = Array(params[field]).map(&:to_s) + h_field = { + "@type": "ht:RequestHeader", + "ht:fieldName": field, + "ht:fieldValue": Array(values).join(', ') + } + + values.each do |value| + value, *params = value.split(';').map(&:strip) + element = { + "@type": "ht:HeaderElement", + "ht:elementName": value + } + params.each do |param| + p, v = param.split('=') + pv = v.sub(/^["']?([^"']*)["']?$/, '\1') + # Remember charset for body encoding + $charset = pv if p.downcase == 'charset' + param = { + "@type": "ht:Parameter", + "ht:paramName": p, + "ht:paramValue": pv + } + + (element[:params] ||= []) << param + end + + (h_field[:headerElements] ||= []) << element + end + + h_field +end + +def encode_body(content) + content = req_uri(content) if content.is_a?(Hash) + { + "@type": "cnt:ContentAsText", + "cnt:chars": content, + "cnt:characterEncoding": $charset + } +end + +def gen_entry(frag, params) + $charset = "UTF-8" + entry = { + '@id': "##{frag}", + "@type": "mf:ProtocolTest", + "name": params.delete(:name), + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [] + } + } + requests = entry[:action][:requests] + params[:req].each do |req| + path = req[:path] + request = { + "@type": "ht:Request", + "ht:methodName": req[:method], + "ht:httpVersion": "1.1", + "ht:absolutePath": path, + } + + # Headers + req.each_key do |key| + next unless key.to_s.start_with?(/[A-Z]/) + (request[:headers] ||= []) << encode_header(req, key) + end + + request[:"ht:body"] = encode_body(req[:content]) if req[:content] + + if resp = req.delete(:resp) + response = { + "@type": "ht:Response", + "ht:statusCodeValue": Array(resp[:status]) + } + + resp.each_key do |key| + next unless key.to_s.start_with?(/[A-Z]/) + (request[:headers] ||= []) << encode_header(resp, key) + end + + response[:"ht:body"] = encode_body(resp[:content]) if resp[:content] + + request[:"ht:resp"] = response + end + + requests << request + end + entry +end + +def validate(reader) + RDF::Reasoner.apply(:rdfs, :owl) + graph = RDF::Graph.new {|g| g << reader} + graph.entail! + messages = graph.lint + messages.each do |kind, term_messages| + term_messages.each do |term, messages| + STDERR.puts "#{kind} #{term}" + messages.each {|m| options[:output].puts " #{m}"} + end + end + exit 1 unless messages.empty? +end + +# Generate JSON-LD describing the test manifest +man = { + "@context": { + "@base": "http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest", + "cnt": "http://www.w3.org/2011/content#", + "dawgt": "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#", + "ht": "http://www.w3.org/2011/http#", + "mf": "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#", + "mq": "http://www.w3.org/2001/sw/DataAccess/tests/test-query#", + "rdfs": "http://www.w3.org/2000/01/rdf-schema#", + "xsd": "http://www.w3.org/2001/XMLSchema#", + + "action": {"@id": "mf:action", "@type": "@id"}, + "approval": {"@id": "dawgt:approval", "@type": "@id"}, + "approvedBy": {"@id": "dawgt:approvedBy", "@type": "@id"}, + "comment": {"@id": "rdfs:comment"}, + "data": {"@id": "mq:data", "@type": "@id"}, + "entries": {"@id": "mf:entries", "@container": "@list", "@type": "@id"}, + "feature": {"@id": "mf:feature", "@type": "@vocab"}, + "graphData": {"@id": "mq:graphData", "@type": "@id"}, + "label": {"@id": "rdfs:label"}, + "name": {"@id": "mf:name"}, + "notable": {"@id": "mf:notable", "@type": "@vocab"}, + "query": {"@id": "mq:query", "@type": "@id"}, + "queryForm": {"@id": "mq:queryForm", "@type": "@vocab"}, + "requires": {"@id": "mf:requires", "@type": "@vocab", "@container": "@set"}, + "result": {"@id": "mf:result", "@type": "@id"}, + + "headerElements": {"@id": "ht:headerElements", "@container": "@list"}, + "headers": {"@id": "ht:headers", "@container": "@list"}, + "params": {"@id": "ht:params", "@container": "@list"}, + "requests": {"@id": "ht:requests", "@container": "@list"}, + }, + "@id": "", + "@type": "mf:Manifest", + "label": "SPARQL Graph Store Protocol", + "entries": [] +} + +POSITIVE_TESTS.each do |frag, params| + entry = gen_entry(frag, params) + man[:entries] << entry +end + +OPT_ARGS = [ + ["--help", "-?", GetoptLong::NO_ARGUMENT, "print this message"], + ["--format", "-f", GetoptLong::REQUIRED_ARGUMENT, "Output format (jsonld, ttl or html)"], + ["--output", "-o", GetoptLong::REQUIRED_ARGUMENT, "Output to specified file"], + ["--validate", GetoptLong::NO_ARGUMENT, "Validate the resulting graph"], +] + +def usage(**options) + STDERR.puts %{ + generate Graph Store Protocol manifests + + Usage: #{$0} [options] + }.gsub(/^ /, '') + width = OPT_ARGS.map do |o| + l = o.first.length + l += o[1].length + 2 if o[1].is_a?(String) + l + end.max + OPT_ARGS.each do |o| + s = " %-*s " % [width, (o[1].is_a?(String) ? "#{o[0,2].join(', ')}" : o[0])] + s += o.last + STDERR.puts s + end + exit(1) +end + +opts = GetoptLong.new(*OPT_ARGS.map {|o| o[0..-2]}) + +format = :jsonld +output = $stdout +validate = false + +opts.each do |opt, arg| + case opt + when '--help' then usage + when '--format' then format = arg.to_sym + when '--output' then output = File.open(arg, "w") + when '--validate' then validate = true + end +end + +case format +when :html + template = File.read(File.expand_path('../template.haml', __FILE__)) + engine = Haml::Engine.new(template, format: :html5) + html = engine.render(self, man: JSON.parse(man.to_json)) + validate(RDF::RDFa::Reader.new(html, base_uri: "http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest.ttl", validate: validate)) if validate + output.write(html) +when :jsonld + validate(JSON::LD::Reader.new(man.to_json, base_uri: "http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest.ttl", validate: validate)) if validate + output.puts man.to_json(JSON::LD::JSON_STATE) +when :ttl + JSON::LD::Reader.new(man.to_json, validate: validate) do |reader| + ttl = RDF::Turtle::Writer.buffer( + prefixes: { + "": "http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#", + cnt: "http://www.w3.org/2011/content#", + dawgt: "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#", + ht: "http://www.w3.org/2011/http#", + mf: "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#", + qt: "http://www.w3.org/2001/sw/DataAccess/tests/test-query#", + rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + rdfs: "http://www.w3.org/2000/01/rdf-schema#", + } + ) {|writer| writer << reader} + + validate(RDF::Turtle::Reader.new(ttl, base_uri: "http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest.ttl", validate: true)) if validate + + # Do some result hacking + ttl.sub!('', '<>') + ttl.sub!(/mf:entries \((.*)\) \.$/) do |matched| + matched.sub('(:', '( :').gsub(' :', "\n :") + end + + output.write(ttl) + end +else + STDERR.puts "unknown output format #{format}" + usage +end + diff --git a/sparql11/data-sparql11/http-rdf-update/index.html b/sparql11/data-sparql11/http-rdf-update/index.html index 9ff165d2..9bd29663 100644 --- a/sparql11/data-sparql11/http-rdf-update/index.html +++ b/sparql11/data-sparql11/http-rdf-update/index.html @@ -1,610 +1,1157 @@ - - - - - - - - SPARQL Graph Store Protocol - - - - -

- - W3C - -

-

SPARQL Graph Store Protocol

-

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

-
-
-

Abstract

-

- -

-

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

- -

$HOST$ is the host where the Graph Store Protocol implementation is listening

- -

$GRAPHSTORE$ is the path of the URL of the graph store

- -

$NEWPATH$ is the URL returned in the Location HTTP header

- -

HTTP response messages are in the format:

- -
HTTP Status code
Headers
<space>
Body                    
- -

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 -

-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#put__initial_state: - - PUT - Initial state -
-
-
-

Request

- -
PUT $GRAPHSTORE$/person/1.ttl HTTP/1.1
Host: $HOST$
Content-Type: text/turtle; charset=utf-8

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

<http://$HOST$/$GRAPHSTORE$/person/1> a foaf:Person;
    foaf:businessCard [
        a v:VCard;
        v:fn "John Doe"
    ].
- -

Response

- -

201 Created

-
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#get_of_put__initial_state: - - GET of PUT - Initial state -
-
-
-

Request

- -
GET $GRAPHSTORE$?graph=$GRAPHSTORE$/person/1.ttl HTTP/1.1
Host: $HOST$
Accept: text/turtle
- -

Response

- -
200 OK
Content-Type: text/turtle; charset=utf-8
Content-Length: ...

<http://$HOST$/$GRAPHSTORE$/person/1> a foaf:Person;
   foaf:businessCard [
        a v:VCard;
        v:fn "John Doe"
   ].
-
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#put__graph_already_in_store: - - PUT - graph already in store -
-
-
-

Request

- -
PUT $GRAPHSTORE$/person/1.ttl HTTP/1.1
Host: $HOST$
Content-Type: text/turtle; charset=utf-8

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

<http://$HOST$/$GRAPHSTORE$/person/1> a foaf:Person;
    foaf:businessCard [
        a v:VCard;
        v:fn "Jane Doe"
    ].
- -

Response

- -
204 No Content
-
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#get_of_put__graph_already_in_store: - - GET of PUT - graph already in store -
-
-
-

Request

- -
GET $GRAPHSTORE$/person/1.ttl HTTP/1.1
Host: $HOST$
Accept: text/turtle
- -

Response

- -
200 OK
Content-Type: text/turtle; charset=utf-8
Content-Length: ...

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

<http://$HOST$/$GRAPHSTORE$/person/1> a foaf:Person;
   foaf:businessCard [
        a v:VCard;
        v:fn "Jane Doe"
   ] .
-
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#put__default_graph: - - PUT - default graph -
-
-
-

Request

- -
PUT $GRAPHSTORE$?default HTTP/1.1
Host: $HOST$
Content-Type: text/turtle; charset=utf-8

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

[]  a foaf:Person;
    foaf:businessCard [
        a v:VCard;
        v:given-name "Alice"
    ] .
- -

Response

- -
201 Created
-
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#get_of_put__default_graph: - - GET of PUT - default graph -
-
-
-

Request

- -
GET $GRAPHSTORE$?default HTTP/1.1
Host: $HOST$
Accept: text/turtle
- -

Response

- -
200 OK
Content-Type: text/turtle; charset=utf-8
Content-Length: ...

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

[]  a foaf:Person;
    foaf:businessCard [
        a v:VCard;
        v:given-name "Alice"
    ] .
-
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#put__mismatched_payload: - - PUT - mismatched payload -
-
-
-

Request

- -
PUT $GRAPHSTORE$/person/1.ttl HTTP/1.1
Host: $HOST$
Content-Type: text/turtle; charset=utf-8

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

<http://$HOST$/$GRAPHSTORE$/person/1> a foaf:Person;
    foaf:businessCard [
        a v:VCard;
        v:fn "Jane Doe"
    ].
- -

Response

- -
400 Bad Request
-
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#delete__existing_graph: - - DELETE - existing graph -
-
-
-

Request

- -
DELETE $GRAPHSTORE$/person/2.ttl HTTP/1.1
Host: $HOST$
- -

Response

- -
200 OK
-
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#get_of_delete__existing_graph: - - GET of DELETE - existing graph -
-
-
-

Request

- -
GET $GRAPHSTORE$/person/2.ttl HTTP/1.1
Host: $HOST$
- -

Response

- -
404 Not Found
-
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#delete__nonexistent_graph: - - DELETE - non-existent graph -
-
-
-

Request

- -
DELETE $GRAPHSTORE$/person/2.ttl HTTP/1.1
Host: $HOST$
- -

Response

- -
404 Not Found
-
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#post__existing_graph: - - POST - existing graph -
-
-
- -
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#get_of_post__existing_graph: - - GET of POST - existing graph -
-
-
-

Request

- -
POST $GRAPHSTORE$/person/1.ttl HTTP/1.1
Host: $HOST$
Content-Type: text/turtle; charset=utf-8

@prefix foaf: <http://xmlns.com/foaf/0.1/> .

<http://$HOST$/$GRAPHSTORE$/person/1> foaf:name "Jane Doe"
- -

Response

- -
200 OK
-
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#post__multipart_formdata: - - POST - multipart/form-data -
-
-
-

Request

- -
POST $GRAPHSTORE$/person/1.ttl HTTP/1.1
Host: $HOST$
Content-Type: multipart/form-data; boundary=a6fe4cd636164618814be9f8d3d1a0de

--a6fe4cd636164618814be9f8d3d1a0de
Content-Disposition: form-data; name="lastName.ttl"; filename="lastName.ttl"
Content-Type: text/turtle; charset=utf-8

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<http://$HOST$/$GRAPHSTORE$/person/1> foaf:familyName "Doe"

--a6fe4cd636164618814be9f8d3d1a0de
Content-Disposition: form-data; name="firstName.ttl"; filename="firstName.ttl"
Content-Type: text/turtle; charset=utf-8

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<http://$HOST$/$GRAPHSTORE$/person/1> foaf:givenName "Jane"

--a6fe4cd636164618814be9f8d3d1a0de--
- -

Response

- -
200 OK
-
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#get_of_post__multipart_formdata: - - GET of POST - multipart/form-data -
-
-
-

Request

- -
GET $GRAPHSTORE$/person/1.ttl HTTP/1.1
Host: $HOST$
- -

Response

- -
200 OK
Content-Type: text/turtle; charset=utf-8
Content-Length: ...

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

<http://$HOST$/$GRAPHSTORE$/person/1> a foaf:Person;
    foaf:name           "Jane Doe";
    foaf:givenName      "Jane";
    foaf:familyName     "Doe";
    foaf:businessCard [
        a               v:VCard;
        v:fn            "Jane Doe"
    ] .
-
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#post__create__new_graph: - - POST - create new graph -
-
-
-

Request

- -
POST $GRAPHSTORE$ HTTP/1.1
Host: $HOST$
Content-Type: text/turtle; charset=utf-8

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

[]  a foaf:Person;
    foaf:businessCard [
        a v:VCard;
        v:given-name "Alice"
    ] .
- -

Response

- -
201 Created
Location: $NEWPATH$
-
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#get_of_post__create__new_graph: - - GET of POST - create new graph -
-
-
-

Request

- -
GET $NEWPATH$ HTTP/1.1
Host: $HOST$
Accept: text/turtle
- -

Response

- -
200 OK
Content-Type: text/turtle; charset=utf-8
Content-Length: ...

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

[]  a foaf:Person;
    foaf:businessCard [
        a v:VCard;
        v:given-name "Alice"
    ] .
-
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#get_of_post__after_noop: - - GET of POST - after noop -
-
-
-

Request

- -
GET $NEWPATH$ HTTP/1.1
Host: $HOST$
Accept: text/turtle
- -

Response

- -
200 OK
Content-Type: text/turtle; charset=utf-8
Content-Length: ...

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

[]  a foaf:Person;
    foaf:businessCard [
        a v:VCard;
        v:given-name "Alice"
    ] .
-
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#head_on_an_existing_graph: - - HEAD on an existing graph -
-
-
-

Request

- -
HEAD $GRAPHSTORE$/person/1.ttl HTTP/1.1
Host: $HOST$
- -

Response

- -
200 OK
Content-Type: text/turtle; charset=utf-8
Content-Length: ...
-
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
- - http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest#head_on_a_nonexisting_graph: - - HEAD on a non-existing graph -
-
-
-

Request

- -
HEAD $GRAPHSTORE$/person/4.ttl HTTP/1.1
Host: $HOST$
- -

Response

- -
404 Not Found
-
-
-
type
-
mf:GraphStoreProtocolTest
-
approval
-
dawgt:Approved
-
approvedBy
-
- http://www.w3.org/2009/sparql/meeting/2012-11-27#resolution_3 -
-
-
-
-
- - + + + + + + + +SPARQL Graph Store Protocol + + + + +

+ +W3C + +

+

SPARQL Graph Store Protocol

+

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

+
+
+

Abstract

+

+ +

+

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

+ +

$HOST$ +: is the host where the Graph Store Protocol implementation is listening

+ +

$GRAPHSTORE$ +: is the path of the URL of the graph store

+ +

$NEWPATH$ +: is the URL returned in the Location HTTP header

+ +

HTTP response messages are in the format:

+ +
HTTP Status code
Headers
<space>
Body                    
+ +

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 +

+
+
+ +#put__initial_state: + +PUT - Initial state +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+PUT +$GRAPHSTORE$/person/1.ttl +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+Content-Type: +text/turtle; charset=utf-8 + + +
+
+
+
+ +
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

<http://$HOST$/$GRAPHSTORE$/person/1> a foaf:Person;
    foaf:businessCard [
        a v:VCard;
        v:fn "John Doe"
    ].
+
+
+
+

Response

+201 + +response + +
+
+
+
+
+ +#get_of_put__initial_state: + +GET of PUT - Initial state +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+GET +$GRAPHSTORE$?graph=$GRAPHSTORE$/person/1.ttl +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+Accept: +text/turtle + +
+
+Content-Type: +text/turtle; charset=utf-8 + + +
+
+
+
+

Response

+200 + +response + +
+
+ +
<http://$HOST$/$GRAPHSTORE$/person/1> a foaf:Person;
   foaf:businessCard [
        a v:VCard;
        v:fn "John Doe"
   ].
+
+
+
+
+
+
+ +#put__graph_already_in_store: + +PUT - graph already in store +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+PUT +$GRAPHSTORE$/person/1 +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+Content-Type: +text/turtle; charset=utf-8 + + +
+
+
+
+ +
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

<http://$HOST$/$GRAPHSTORE$/person/1> a foaf:Person;
    foaf:businessCard [
        a v:VCard;
        v:fn "Jane Doe"
    ].
+
+
+
+

Response

+204 + +response + +
+
+
+
+
+ +#get_of_put__graph_already_in_store: + +GET of PUT - graph already in store +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+GET +$GRAPHSTORE$/person/1 +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+Accept: +text/turtle + +
+
+Content-Type: +text/turtle; charset=utf-8 + + +
+
+
+
+

Response

+200 + +response + +
+
+ +
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

<http://$HOST$/$GRAPHSTORE$/person/1> a foaf:Person;
   foaf:businessCard [
        a v:VCard;
        v:fn "Jane Doe"
   ] .
+
+
+
+
+
+
+ +#put__default_graph: + +PUT - default graph +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+PUT +$GRAPHSTORE$?default +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+Content-Type: +text/turtle; charset=utf-8 + + +
+
+
+
+ +
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

[]  a foaf:Person;
    foaf:businessCard [
        a v:VCard;
        v:given-name "Alice"
    ] .
+
+
+
+

Response

+201 + +response + +
+
+
+
+
+ +#get_of_put__default_graph: + +GET of PUT - default graph +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+GET +$GRAPHSTORE$?default +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+Accept: +text/turtle + +
+
+Content-Type: +text/turtle; charset=utf-8 + + +
+
+
+
+

Response

+200 + +response + +
+
+ +
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

[]  a foaf:Person;
    foaf:businessCard [
        a v:VCard;
        v:given-name "Alice"
    ] .
+
+
+
+
+
+
+ +#put__mismatched_payload: + +PUT - mismatched payload +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+PUT +$GRAPHSTORE$?default +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+Content-Type: +text/turtle; charset=utf-8 + + +
+
+
+
+ +
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

<http://$HOST$/$GRAPHSTORE$/person/1> a foaf:Person;
    foaf:businessCard [
        a v:VCard;
        v:fn "Jane Doe"
    ].
+
+
+
+

Response

+400 + +response + +
+
+
+
+
+ +#delete__existing_graph: + +DELETE - existing graph +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+DELETE +$GRAPHSTORE$/person/2.ttl +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+
+
+

Response

+200 + +response + +
+
+
+
+
+ +#get_of_delete__existing_graph: + +GET of DELETE - existing graph +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+GET +$GRAPHSTORE$/person/2.ttl +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+
+
+

Response

+404 + +response + +
+
+
+
+
+ +#delete__nonexistent_graph: + +DELETE - non-existent graph) +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+DELETE +$GRAPHSTORE$/person/2.ttl +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+
+
+

Response

+404 + +response + +
+
+
+
+
+ +#post__existing_graph: + +POST - existing graph +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+POST +$GRAPHSTORE$/person/1.ttl +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+Content-Type: +text/turtle; charset=utf-8 + + +
+
+
+
+ +
@prefix foaf: <http://xmlns.com/foaf/0.1/> .

<http://$HOST$/$GRAPHSTORE$/person/1> foaf:name "Jane Doe"
+
+
+
+

Response

+200 + +response + +
+
+
+
+
+ +#get_of_post__existing_graph: + +GET of POST - existing graph +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+GET +$GRAPHSTORE$/person/1.ttl +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+Accept: +text/turtle + +
+
+Content-Type: +text/turtle; charset=utf-8 + + +
+
+
+
+

Response

+200 + +response + +
+
+ +
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

<http://$HOST$/$GRAPHSTORE$/person/1> a foaf:Person;
    foaf:name "Jane Doe";
    foaf:businessCard [ 
        a v:VCard;
        v:fn "Jane Doe" 
    ] .
+
+
+
+
+
+
+ +#post__multipart_formdata: + +POST - multipart/form-data +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+POST +$GRAPHSTORE$/person/1.ttl +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+Content-Type: +multipart/form-data; boundary=a6fe4cd636164618814be9f8d3d1a0de + + +
+
+
+
+ +
--a6fe4cd636164618814be9f8d3d1a0de
Content-Disposition: form-data; name="lastName.ttl"; filename="lastName.ttl"
Content-Type: text/turtle; charset=utf-8

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<http://$HOST$/$GRAPHSTORE$/person/1> foaf:familyName "Doe"

--a6fe4cd636164618814be9f8d3d1a0de
Content-Disposition: form-data; name="firstName.ttl"; filename="firstName.ttl"
Content-Type: text/turtle; charset=utf-8

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<http://$HOST$/$GRAPHSTORE$/person/1> foaf:givenName "Jane"

--a6fe4cd636164618814be9f8d3d1a0de--
+
+
+
+

Response

+200 + +response + +
+
+
+
+
+ +#get_of_post__multipart_formdata: + +GET of POST - multipart/form-data +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+GET +$GRAPHSTORE$/person/1.ttl +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+Content-Type: +text/turtle; charset=utf-8 + + +
+
+
+
+

Response

+200 + +response + +
+
+ +
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

<http://$HOST$/$GRAPHSTORE$/person/1> a foaf:Person;
    foaf:name           "Jane Doe";
    foaf:givenName      "Jane";
    foaf:familyName     "Doe";
    foaf:businessCard [
        a               v:VCard;
        v:fn            "Jane Doe"
    ] .
+
+
+
+
+
+
+ +#post__create__new_graph: + +POST - create new graph +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+POST +$GRAPHSTORE$ +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+Content-Type: +text/turtle; charset=utf-8 + + +
+
+Location: +$NEWPATH$ + +
+
+
+
+ +
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

[]  a foaf:Person;
    foaf:businessCard [
        a v:VCard;
        v:given-name "Alice"
    ] .
+
+
+
+

Response

+201 + +response + +
+
+
+
+
+ +#get_of_post__create__new_graph: + +GET of POST - create new graph +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+GET +$NEWPATH$ +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+Accept: +text/turtle + +
+
+Content-Type: +text/turtle; charset=utf-8 + + +
+
+
+
+

Response

+200 + +response + +
+
+ +
[]  a foaf:Person;
    foaf:businessCard [
        a v:VCard;
        v:given-name "Alice"
    ] .
+
+
+
+
+
+
+ +#get_of_post__after_noop: + +GET of POST - after noop +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+GET +$NEWPATH$ +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+Accept: +text/turtle + +
+
+Content-Type: +text/turtle; charset=utf-8 + + +
+
+
+
+

Response

+200 + +response + +
+
+ +
[]  a foaf:Person;
    foaf:businessCard [
        a v:VCard;
        v:given-name "Alice"
    ] .
+
+
+
+
+
+
+ +#head_on_an_existing_graph: + + +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+HEAD +$GRAPHSTORE$/person/1.ttl +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+Content-Type: +text/turtle; charset=utf-8 + + +
+
+
+
+

Response

+200 + +response + +
+
+
+
+
+ +#head_on_a_nonexisting_graph: + +HEAD on a non-existing graph +
+
+
+
type
+
mf:ProtocolTest
+
approval
+
dawgt:Approved
+
approvedBy
+
+http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3 +
+
+
+ +
+
+

Request

+HEAD +$GRAPHSTORE$/person/4.ttl +HTTP/1.1
+Host: www.example +
+ +
+Host: +$HOST$ + +
+
+
+
+

Response

+404 + +response + +
+
+
+
+
+
+ + diff --git a/sparql11/data-sparql11/http-rdf-update/manifest-frame.jsonld b/sparql11/data-sparql11/http-rdf-update/manifest-frame.jsonld deleted file mode 100644 index c7b8c829..00000000 --- a/sparql11/data-sparql11/http-rdf-update/manifest-frame.jsonld +++ /dev/null @@ -1,28 +0,0 @@ -{ - "@context": { - "dawgt": "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#", - "mf": "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#", - "mq": "http://www.w3.org/2001/sw/DataAccess/tests/test-query#", - "rdfs": "http://www.w3.org/2000/01/rdf-schema#", - "xsd": "http://www.w3.org/2001/XMLSchema#", - - "action": {"@id": "mf:action", "@type": "@id"}, - "approval": {"@id": "dawgt:approval", "@type": "@id"}, - "approvedBy": {"@id": "dawgt:approvedBy", "@type": "@id"}, - "comment": {"@id": "rdfs:comment"}, - "data": {"@id": "mq:data", "@type": "@id"}, - "entries": {"@id": "mf:entries", "@container": "@list", "@type": "@id"}, - "feature": {"@id": "mf:feature", "@type": "@vocab"}, - "graphData": {"@id": "mq:graphData", "@type": "@id"}, - "include": {"@id": "mf:include", "@container": "@list", "@type": "@id"}, - "label": {"@id": "rdfs:label"}, - "name": {"@id": "mf:name"}, - "notable": {"@id": "mf:notable", "@type": "@vocab"}, - "query": {"@id": "mq:query", "@type": "@id"}, - "queryForm": {"@id": "mq:queryForm", "@type": "@vocab"}, - "requires": {"@id": "mf:requires", "@type": "@vocab", "@container": "@set"}, - "result": {"@id": "mf:result", "@type": "@id"} - }, - "@type": "mf:Manifest", - "entries": {"@embed": true} -} \ No newline at end of file diff --git a/sparql11/data-sparql11/http-rdf-update/manifest.jsonld b/sparql11/data-sparql11/http-rdf-update/manifest.jsonld new file mode 100644 index 00000000..e9d123cd --- /dev/null +++ b/sparql11/data-sparql11/http-rdf-update/manifest.jsonld @@ -0,0 +1,1231 @@ +{ + "@context": { + "@base": "http://www.w3.org/2009/sparql/docs/tests/data-sparql11/http-rdf-update/manifest", + "cnt": "http://www.w3.org/2011/content#", + "dawgt": "http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#", + "ht": "http://www.w3.org/2011/http#", + "mf": "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#", + "mq": "http://www.w3.org/2001/sw/DataAccess/tests/test-query#", + "rdfs": "http://www.w3.org/2000/01/rdf-schema#", + "xsd": "http://www.w3.org/2001/XMLSchema#", + "action": { + "@id": "mf:action", + "@type": "@id" + }, + "approval": { + "@id": "dawgt:approval", + "@type": "@id" + }, + "approvedBy": { + "@id": "dawgt:approvedBy", + "@type": "@id" + }, + "comment": { + "@id": "rdfs:comment" + }, + "data": { + "@id": "mq:data", + "@type": "@id" + }, + "entries": { + "@id": "mf:entries", + "@container": "@list", + "@type": "@id" + }, + "feature": { + "@id": "mf:feature", + "@type": "@vocab" + }, + "graphData": { + "@id": "mq:graphData", + "@type": "@id" + }, + "label": { + "@id": "rdfs:label" + }, + "name": { + "@id": "mf:name" + }, + "notable": { + "@id": "mf:notable", + "@type": "@vocab" + }, + "query": { + "@id": "mq:query", + "@type": "@id" + }, + "queryForm": { + "@id": "mq:queryForm", + "@type": "@vocab" + }, + "requires": { + "@id": "mf:requires", + "@type": "@vocab", + "@container": "@set" + }, + "result": { + "@id": "mf:result", + "@type": "@id" + }, + "headerElements": { + "@id": "ht:headerElements", + "@container": "@list" + }, + "headers": { + "@id": "ht:headers", + "@container": "@list" + }, + "params": { + "@id": "ht:params", + "@container": "@list" + }, + "requests": { + "@id": "ht:requests", + "@container": "@list" + } + }, + "@id": "", + "@type": "mf:Manifest", + "label": "SPARQL Graph Store Protocol", + "entries": [ + { + "@id": "#put__initial_state", + "@type": "mf:ProtocolTest", + "name": "PUT - Initial state", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "PUT", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$GRAPHSTORE$/person/1.ttl", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "text/turtle; charset=utf-8", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle", + "params": [ + { + "@type": "ht:Parameter", + "ht:paramName": "charset", + "ht:paramValue": "utf-8" + } + ] + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "\n@prefix foaf: .\n@prefix v: .\n\n a foaf:Person;\n foaf:businessCard [\n a v:VCard;\n v:fn \"John Doe\"\n ].\n", + "cnt:characterEncoding": "utf-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "201" + ] + } + } + ] + } + }, + { + "@id": "#get_of_put__initial_state", + "@type": "mf:ProtocolTest", + "name": "GET of PUT - Initial state", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "GET", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$GRAPHSTORE$?graph=$GRAPHSTORE$/person/1.ttl", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Accept", + "ht:fieldValue": "text/turtle", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "text/turtle; charset=utf-8", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle", + "params": [ + { + "@type": "ht:Parameter", + "ht:paramName": "charset", + "ht:paramValue": "utf-8" + } + ] + } + ] + } + ], + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "200" + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "\n a foaf:Person;\n foaf:businessCard [\n a v:VCard;\n v:fn \"John Doe\"\n ].\n", + "cnt:characterEncoding": "utf-8" + } + } + } + ] + } + }, + { + "@id": "#put__graph_already_in_store", + "@type": "mf:ProtocolTest", + "name": "PUT - graph already in store", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "PUT", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$GRAPHSTORE$/person/1", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "text/turtle; charset=utf-8", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle", + "params": [ + { + "@type": "ht:Parameter", + "ht:paramName": "charset", + "ht:paramValue": "utf-8" + } + ] + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "\n@prefix foaf: .\n@prefix v: .\n\n a foaf:Person;\n foaf:businessCard [\n a v:VCard;\n v:fn \"Jane Doe\"\n ].\n", + "cnt:characterEncoding": "utf-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "204" + ] + } + } + ] + } + }, + { + "@id": "#get_of_put__graph_already_in_store", + "@type": "mf:ProtocolTest", + "name": "GET of PUT - graph already in store", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "GET", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$GRAPHSTORE$/person/1", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Accept", + "ht:fieldValue": "text/turtle", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "text/turtle; charset=utf-8", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle", + "params": [ + { + "@type": "ht:Parameter", + "ht:paramName": "charset", + "ht:paramValue": "utf-8" + } + ] + } + ] + } + ], + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "200" + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "\n@prefix foaf: .\n@prefix v: .\n\n a foaf:Person;\n foaf:businessCard [\n a v:VCard;\n v:fn \"Jane Doe\"\n ] .\n", + "cnt:characterEncoding": "utf-8" + } + } + } + ] + } + }, + { + "@id": "#put__default_graph", + "@type": "mf:ProtocolTest", + "name": "PUT - default graph", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "PUT", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$GRAPHSTORE$?default", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "text/turtle; charset=utf-8", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle", + "params": [ + { + "@type": "ht:Parameter", + "ht:paramName": "charset", + "ht:paramValue": "utf-8" + } + ] + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "\n@prefix foaf: .\n@prefix v: .\n\n[] a foaf:Person;\n foaf:businessCard [\n a v:VCard;\n v:given-name \"Alice\"\n ] .\n", + "cnt:characterEncoding": "utf-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "201" + ] + } + } + ] + } + }, + { + "@id": "#get_of_put__default_graph", + "@type": "mf:ProtocolTest", + "name": "GET of PUT - default graph", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "GET", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$GRAPHSTORE$?default", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Accept", + "ht:fieldValue": "text/turtle", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "text/turtle; charset=utf-8", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle", + "params": [ + { + "@type": "ht:Parameter", + "ht:paramName": "charset", + "ht:paramValue": "utf-8" + } + ] + } + ] + } + ], + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "200" + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "\n@prefix foaf: .\n@prefix v: .\n\n[] a foaf:Person;\n foaf:businessCard [\n a v:VCard;\n v:given-name \"Alice\"\n ] .\n", + "cnt:characterEncoding": "utf-8" + } + } + } + ] + } + }, + { + "@id": "#put__mismatched_payload", + "@type": "mf:ProtocolTest", + "name": "PUT - mismatched payload", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "PUT", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$GRAPHSTORE$?default", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "text/turtle; charset=utf-8", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle", + "params": [ + { + "@type": "ht:Parameter", + "ht:paramName": "charset", + "ht:paramValue": "utf-8" + } + ] + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "\n@prefix foaf: .\n@prefix v: .\n\n a foaf:Person;\n foaf:businessCard [\n a v:VCard;\n v:fn \"Jane Doe\"\n ].\n", + "cnt:characterEncoding": "utf-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "400" + ] + } + } + ] + } + }, + { + "@id": "#delete__existing_graph", + "@type": "mf:ProtocolTest", + "name": "DELETE - existing graph", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "DELETE", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$GRAPHSTORE$/person/2.ttl", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + } + ], + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "200" + ] + } + } + ] + } + }, + { + "@id": "#get_of_delete__existing_graph", + "@type": "mf:ProtocolTest", + "name": "GET of DELETE - existing graph", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "GET", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$GRAPHSTORE$/person/2.ttl", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + } + ], + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "404" + ] + } + } + ] + } + }, + { + "@id": "#delete__nonexistent_graph", + "@type": "mf:ProtocolTest", + "name": "DELETE - non-existent graph)", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "DELETE", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$GRAPHSTORE$/person/2.ttl", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + } + ], + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "404" + ] + } + } + ] + } + }, + { + "@id": "#post__existing_graph", + "@type": "mf:ProtocolTest", + "name": "POST - existing graph", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$GRAPHSTORE$/person/1.ttl", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "text/turtle; charset=utf-8", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle", + "params": [ + { + "@type": "ht:Parameter", + "ht:paramName": "charset", + "ht:paramValue": "utf-8" + } + ] + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "\n@prefix foaf: .\n\n foaf:name \"Jane Doe\"\n", + "cnt:characterEncoding": "utf-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "200" + ] + } + } + ] + } + }, + { + "@id": "#get_of_post__existing_graph", + "@type": "mf:ProtocolTest", + "name": "GET of POST - existing graph", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "GET", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$GRAPHSTORE$/person/1.ttl", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Accept", + "ht:fieldValue": "text/turtle", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "text/turtle; charset=utf-8", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle", + "params": [ + { + "@type": "ht:Parameter", + "ht:paramName": "charset", + "ht:paramValue": "utf-8" + } + ] + } + ] + } + ], + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "200" + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "\n@prefix foaf: .\n@prefix v: .\n\n a foaf:Person;\n foaf:name \"Jane Doe\";\n foaf:businessCard [ \n a v:VCard;\n v:fn \"Jane Doe\" \n ] . \n", + "cnt:characterEncoding": "utf-8" + } + } + } + ] + } + }, + { + "@id": "#post__multipart_formdata", + "@type": "mf:ProtocolTest", + "name": "POST - multipart/form-data", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$GRAPHSTORE$/person/1.ttl", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "multipart/form-data; boundary=a6fe4cd636164618814be9f8d3d1a0de", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "multipart/form-data", + "params": [ + { + "@type": "ht:Parameter", + "ht:paramName": "boundary", + "ht:paramValue": "a6fe4cd636164618814be9f8d3d1a0de" + } + ] + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "\n--a6fe4cd636164618814be9f8d3d1a0de\nContent-Disposition: form-data; name=\"lastName.ttl\"; filename=\"lastName.ttl\"\nContent-Type: text/turtle; charset=utf-8\n\n@prefix foaf: .\n foaf:familyName \"Doe\"\n\n--a6fe4cd636164618814be9f8d3d1a0de\nContent-Disposition: form-data; name=\"firstName.ttl\"; filename=\"firstName.ttl\"\nContent-Type: text/turtle; charset=utf-8\n\n@prefix foaf: .\n foaf:givenName \"Jane\"\n\n--a6fe4cd636164618814be9f8d3d1a0de--\n ", + "cnt:characterEncoding": "UTF-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "200" + ] + } + } + ] + } + }, + { + "@id": "#get_of_post__multipart_formdata", + "@type": "mf:ProtocolTest", + "name": "GET of POST - multipart/form-data", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "GET", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$GRAPHSTORE$/person/1.ttl", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "text/turtle; charset=utf-8", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle", + "params": [ + { + "@type": "ht:Parameter", + "ht:paramName": "charset", + "ht:paramValue": "utf-8" + } + ] + } + ] + } + ], + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "200" + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "\n@prefix foaf: .\n@prefix v: .\n\n a foaf:Person;\n foaf:name \"Jane Doe\";\n foaf:givenName \"Jane\";\n foaf:familyName \"Doe\";\n foaf:businessCard [\n a v:VCard;\n v:fn \"Jane Doe\"\n ] .\n", + "cnt:characterEncoding": "utf-8" + } + } + } + ] + } + }, + { + "@id": "#post__create__new_graph", + "@type": "mf:ProtocolTest", + "name": "POST - create new graph", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "POST", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$GRAPHSTORE$", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "text/turtle; charset=utf-8", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle", + "params": [ + { + "@type": "ht:Parameter", + "ht:paramName": "charset", + "ht:paramValue": "utf-8" + } + ] + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Location", + "ht:fieldValue": "$NEWPATH$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$NEWPATH$" + } + ] + } + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "\n@prefix foaf: .\n@prefix v: .\n\n[] a foaf:Person;\n foaf:businessCard [\n a v:VCard;\n v:given-name \"Alice\"\n ] .\n", + "cnt:characterEncoding": "utf-8" + }, + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "201" + ] + } + } + ] + } + }, + { + "@id": "#get_of_post__create__new_graph", + "@type": "mf:ProtocolTest", + "name": "GET of POST - create new graph", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "GET", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$NEWPATH$", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Accept", + "ht:fieldValue": "text/turtle", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "text/turtle; charset=utf-8", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle", + "params": [ + { + "@type": "ht:Parameter", + "ht:paramName": "charset", + "ht:paramValue": "utf-8" + } + ] + } + ] + } + ], + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "200" + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "\n[] a foaf:Person;\n foaf:businessCard [\n a v:VCard;\n v:given-name \"Alice\"\n ] .\n", + "cnt:characterEncoding": "utf-8" + } + } + } + ] + } + }, + { + "@id": "#get_of_post__after_noop", + "@type": "mf:ProtocolTest", + "name": "GET of POST - after noop", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "GET", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$NEWPATH$", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Accept", + "ht:fieldValue": "text/turtle", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "text/turtle; charset=utf-8", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle", + "params": [ + { + "@type": "ht:Parameter", + "ht:paramName": "charset", + "ht:paramValue": "utf-8" + } + ] + } + ] + } + ], + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "200" + ], + "ht:body": { + "@type": "cnt:ContentAsText", + "cnt:chars": "\n[] a foaf:Person;\n foaf:businessCard [\n a v:VCard;\n v:given-name \"Alice\"\n ] .\n", + "cnt:characterEncoding": "utf-8" + } + } + } + ] + } + }, + { + "@id": "#head_on_an_existing_graph", + "@type": "mf:ProtocolTest", + "name": "", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "HEAD", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$GRAPHSTORE$/person/1.ttl", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + }, + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Content-Type", + "ht:fieldValue": "text/turtle; charset=utf-8", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "text/turtle", + "params": [ + { + "@type": "ht:Parameter", + "ht:paramName": "charset", + "ht:paramValue": "utf-8" + } + ] + } + ] + } + ], + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "200" + ] + } + } + ] + } + }, + { + "@id": "#head_on_a_nonexisting_graph", + "@type": "mf:ProtocolTest", + "name": "HEAD on a non-existing graph", + "approval": "dawgt:Approved", + "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", + "action": { + "@type": "ht:Connection", + "ht:connectionAuthority": "www.example", + "requests": [ + { + "@type": "ht:Request", + "ht:methodName": "HEAD", + "ht:httpVersion": "1.1", + "ht:absolutePath": "$GRAPHSTORE$/person/4.ttl", + "headers": [ + { + "@type": "ht:RequestHeader", + "ht:fieldName": "Host", + "ht:fieldValue": "$HOST$", + "headerElements": [ + { + "@type": "ht:HeaderElement", + "ht:elementName": "$HOST$" + } + ] + } + ], + "ht:resp": { + "@type": "ht:Response", + "ht:statusCodeValue": [ + "404" + ] + } + } + ] + } + } + ] +} diff --git a/sparql11/data-sparql11/http-rdf-update/manifest.ttl b/sparql11/data-sparql11/http-rdf-update/manifest.ttl index 94e1b96e..327dbfa9 100644 --- a/sparql11/data-sparql11/http-rdf-update/manifest.ttl +++ b/sparql11/data-sparql11/http-rdf-update/manifest.ttl @@ -1,453 +1,1006 @@ @prefix : . -@prefix dawg: . -@prefix gsp: . +@prefix cnt: . +@prefix dawgt: . +@prefix ht: . @prefix mf: . @prefix rdf: . @prefix rdfs: . -# Note: Comments are formated as Markdown for transformation to HTML version of manifest. - <> a mf:Manifest; - rdfs:label "SPARQL Graph Store Protocol"; - mf:entries ( gsp:put__initial_state - gsp:get_of_put__initial_state - gsp:put__graph_already_in_store - gsp:get_of_put__graph_already_in_store - gsp:put__default_graph - gsp:get_of_put__default_graph - gsp:put__mismatched_payload - gsp:delete__existing_graph - gsp:get_of_delete__existing_graph - gsp:delete__nonexistent_graph - gsp:post__existing_graph - gsp:get_of_post__existing_graph - gsp:post__multipart_formdata - gsp:get_of_post__multipart_formdata - gsp:post__create__new_graph - gsp:get_of_post__create__new_graph - gsp:get_of_post__after_noop - gsp:head_on_an_existing_graph - gsp:head_on_a_nonexisting_graph ) . - -gsp:delete__existing_graph a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "DELETE - existing graph" ; - rdfs:comment """ -#### Request - - DELETE $GRAPHSTORE$/person/2.ttl HTTP/1.1 - Host: $HOST$ - -#### Response - - 200 OK - """ . - -gsp:delete__nonexistent_graph a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "DELETE - non-existent graph" ; - rdfs:comment """ -#### Request - - DELETE $GRAPHSTORE$/person/2.ttl HTTP/1.1 - Host: $HOST$ - -#### Response - - 404 Not Found - """ . - -gsp:get_of_delete__existing_graph a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "GET of DELETE - existing graph" ; - rdfs:comment """ -#### Request - - GET $GRAPHSTORE$/person/2.ttl HTTP/1.1 - Host: $HOST$ - -#### Response - - 404 Not Found - """ . - -gsp:get_of_post__after_noop a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "GET of POST - after noop" ; - rdfs:comment """ -#### Request - - GET $NEWPATH$ HTTP/1.1 - Host: $HOST$ - Accept: text/turtle - -#### Response - - 200 OK - Content-Type: text/turtle; charset=utf-8 - Content-Length: ... - - @prefix foaf: . - @prefix v: . - - [] a foaf:Person; - foaf:businessCard [ - a v:VCard; - v:given-name "Alice" - ] . - """ . - -gsp:get_of_post__create__new_graph a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "GET of POST - create new graph" ; - rdfs:comment """ -#### Request - - GET $NEWPATH$ HTTP/1.1 - Host: $HOST$ - Accept: text/turtle - -#### Response - - 200 OK - Content-Type: text/turtle; charset=utf-8 - Content-Length: ... - - @prefix foaf: . - @prefix v: . - - [] a foaf:Person; - foaf:businessCard [ - a v:VCard; - v:given-name "Alice" - ] . - """ . - -gsp:get_of_post__existing_graph a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "GET of POST - existing graph" ; - rdfs:comment """ -#### Request - - POST $GRAPHSTORE$/person/1.ttl HTTP/1.1 - Host: $HOST$ - Content-Type: text/turtle; charset=utf-8 - - @prefix foaf: . - - foaf:name "Jane Doe" - -#### Response - - 200 OK - """ . - -gsp:get_of_post__multipart_formdata a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "GET of POST - multipart/form-data" ; - rdfs:comment """ -#### Request - - GET $GRAPHSTORE$/person/1.ttl HTTP/1.1 - Host: $HOST$ - -#### Response - - 200 OK - Content-Type: text/turtle; charset=utf-8 - Content-Length: ... - - @prefix foaf: . - @prefix v: . - - a foaf:Person; - foaf:name "Jane Doe"; - foaf:givenName "Jane"; - foaf:familyName "Doe"; - foaf:businessCard [ - a v:VCard; - v:fn "Jane Doe" - ] . - """ . - -gsp:get_of_put__default_graph a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "GET of PUT - default graph" ; - rdfs:comment """ -#### Request - - GET $GRAPHSTORE$?default HTTP/1.1 - Host: $HOST$ - Accept: text/turtle - -#### Response - - 200 OK - Content-Type: text/turtle; charset=utf-8 - Content-Length: ... - - @prefix foaf: . - @prefix v: . - - [] a foaf:Person; - foaf:businessCard [ - a v:VCard; - v:given-name "Alice" - ] . - """ . - -gsp:get_of_put__graph_already_in_store a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "GET of PUT - graph already in store" ; - rdfs:comment """ -#### Request - - GET $GRAPHSTORE$/person/1.ttl HTTP/1.1 - Host: $HOST$ - Accept: text/turtle - -#### Response - - 200 OK - Content-Type: text/turtle; charset=utf-8 - Content-Length: ... - - @prefix foaf: . - @prefix v: . - - a foaf:Person; - foaf:businessCard [ - a v:VCard; - v:fn "Jane Doe" - ] . - """ . - -gsp:get_of_put__initial_state a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "GET of PUT - Initial state" ; - rdfs:comment """ -#### Request - - GET $GRAPHSTORE$?graph=$GRAPHSTORE$/person/1.ttl HTTP/1.1 - Host: $HOST$ - Accept: text/turtle - -#### Response - - 200 OK - Content-Type: text/turtle; charset=utf-8 - Content-Length: ... - - a foaf:Person; - foaf:businessCard [ - a v:VCard; - v:fn "John Doe" - ]. - """ . - -gsp:head_on_a_nonexisting_graph a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "HEAD on a non-existing graph" ; - rdfs:comment """ -#### Request - - HEAD $GRAPHSTORE$/person/4.ttl HTTP/1.1 - Host: $HOST$ - -#### Response - - 404 Not Found - """ . - -gsp:head_on_an_existing_graph a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "HEAD on an existing graph" ; - rdfs:comment """ -#### Request - - HEAD $GRAPHSTORE$/person/1.ttl HTTP/1.1 - Host: $HOST$ - -#### Response - - 200 OK - Content-Type: text/turtle; charset=utf-8 - Content-Length: ... - """ . - -gsp:post__create__new_graph a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "POST - create new graph" ; - rdfs:comment """ -#### Request - - POST $GRAPHSTORE$ HTTP/1.1 - Host: $HOST$ - Content-Type: text/turtle; charset=utf-8 - - @prefix foaf: . - @prefix v: . - - [] a foaf:Person; - foaf:businessCard [ - a v:VCard; - v:given-name "Alice" - ] . - -#### Response - - 201 Created - Location: $NEWPATH$ - """ . - -gsp:post__existing_graph a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "POST - existing graph" . - -gsp:post__multipart_formdata a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "POST - multipart/form-data" ; - rdfs:comment """ -#### Request - - POST $GRAPHSTORE$/person/1.ttl HTTP/1.1 - Host: $HOST$ - Content-Type: multipart/form-data; boundary=a6fe4cd636164618814be9f8d3d1a0de - - --a6fe4cd636164618814be9f8d3d1a0de - Content-Disposition: form-data; name="lastName.ttl"; filename="lastName.ttl" - Content-Type: text/turtle; charset=utf-8 - - @prefix foaf: . - foaf:familyName "Doe" - - --a6fe4cd636164618814be9f8d3d1a0de - Content-Disposition: form-data; name="firstName.ttl"; filename="firstName.ttl" - Content-Type: text/turtle; charset=utf-8 - - @prefix foaf: . - foaf:givenName "Jane" - - --a6fe4cd636164618814be9f8d3d1a0de-- - -#### Response - - 200 OK - """ . - -gsp:put__default_graph a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "PUT - default graph" ; - rdfs:comment """ -#### Request - - PUT $GRAPHSTORE$?default HTTP/1.1 - Host: $HOST$ - Content-Type: text/turtle; charset=utf-8 - - @prefix foaf: . - @prefix v: . - - [] a foaf:Person; - foaf:businessCard [ - a v:VCard; - v:given-name "Alice" - ] . - -#### Response - - 201 Created - """ . - -gsp:put__graph_already_in_store a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "PUT - graph already in store" ; - rdfs:comment """ -#### Request - - PUT $GRAPHSTORE$/person/1.ttl HTTP/1.1 - Host: $HOST$ - Content-Type: text/turtle; charset=utf-8 - - @prefix foaf: . - @prefix v: . - - a foaf:Person; - foaf:businessCard [ - a v:VCard; - v:fn "Jane Doe" - ]. - -#### Response - - 204 No Content - """ . - -gsp:put__initial_state a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "PUT - Initial state" ; - rdfs:comment """ -#### Request - - - PUT $GRAPHSTORE$/person/1.ttl HTTP/1.1 - Host: $HOST$ - Content-Type: text/turtle; charset=utf-8 - - @prefix foaf: . - @prefix v: . - - a foaf:Person; - foaf:businessCard [ - a v:VCard; - v:fn "John Doe" - ]. - -#### Response - -`201 Created` - """ . - -gsp:put__mismatched_payload a mf:GraphStoreProtocolTest; - dawg:approval dawg:Approved; - dawg:approvedBy ; - mf:name "PUT - mismatched payload" ; - rdfs:comment """ -#### Request - - PUT $GRAPHSTORE$/person/1.ttl HTTP/1.1 - Host: $HOST$ - Content-Type: text/turtle; charset=utf-8 - - @prefix foaf: . - @prefix v: . - - a foaf:Person; - foaf:businessCard [ - a v:VCard; - v:fn "Jane Doe" - ]. - -#### Response - - 400 Bad Request - """ . - + rdfs:label "SPARQL Graph Store Protocol"; + mf:entries ( + :put__initial_state + :get_of_put__initial_state + :put__graph_already_in_store + :get_of_put__graph_already_in_store + :put__default_graph + :get_of_put__default_graph + :put__mismatched_payload + :delete__existing_graph + :get_of_delete__existing_graph + :delete__nonexistent_graph + :post__existing_graph + :get_of_post__existing_graph + :post__multipart_formdata + :get_of_post__multipart_formdata + :post__create__new_graph + :get_of_post__create__new_graph + :get_of_post__after_noop + :head_on_an_existing_graph + :head_on_a_nonexisting_graph) . + +:delete__existing_graph a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$GRAPHSTORE$/person/2.ttl"; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "DELETE"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "200" + ] + ]) + ]; + mf:name "DELETE - existing graph" . + +:delete__nonexistent_graph a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$GRAPHSTORE$/person/2.ttl"; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "DELETE"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "404" + ] + ]) + ]; + mf:name "DELETE - non-existent graph)" . + +:get_of_delete__existing_graph a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$GRAPHSTORE$/person/2.ttl"; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "GET"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "404" + ] + ]) + ]; + mf:name "GET of DELETE - existing graph" . + +:get_of_post__after_noop a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$NEWPATH$"; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Accept"; + ht:fieldValue "text/turtle"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "text/turtle; charset=utf-8"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle"; + ht:params ([ + a ht:Parameter; + ht:paramName "charset"; + ht:paramValue "utf-8" + ]) + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "GET"; + ht:resp [ + a ht:Response; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "utf-8"; + cnt:chars """ +[] a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:given-name \"Alice\" + ] . +""" + ]; + ht:statusCodeValue "200" + ] + ]) + ]; + mf:name "GET of POST - after noop" . + +:get_of_post__create__new_graph a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$NEWPATH$"; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Accept"; + ht:fieldValue "text/turtle"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "text/turtle; charset=utf-8"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle"; + ht:params ([ + a ht:Parameter; + ht:paramName "charset"; + ht:paramValue "utf-8" + ]) + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "GET"; + ht:resp [ + a ht:Response; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "utf-8"; + cnt:chars """ +[] a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:given-name \"Alice\" + ] . +""" + ]; + ht:statusCodeValue "200" + ] + ]) + ]; + mf:name "GET of POST - create new graph" . + +:get_of_post__existing_graph a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$GRAPHSTORE$/person/1.ttl"; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Accept"; + ht:fieldValue "text/turtle"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "text/turtle; charset=utf-8"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle"; + ht:params ([ + a ht:Parameter; + ht:paramName "charset"; + ht:paramValue "utf-8" + ]) + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "GET"; + ht:resp [ + a ht:Response; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "utf-8"; + cnt:chars """ +@prefix foaf: . +@prefix v: . + + a foaf:Person; + foaf:name \"Jane Doe\"; + foaf:businessCard [ + a v:VCard; + v:fn \"Jane Doe\" + ] . +""" + ]; + ht:statusCodeValue "200" + ] + ]) + ]; + mf:name "GET of POST - existing graph" . + +:get_of_post__multipart_formdata a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$GRAPHSTORE$/person/1.ttl"; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "text/turtle; charset=utf-8"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle"; + ht:params ([ + a ht:Parameter; + ht:paramName "charset"; + ht:paramValue "utf-8" + ]) + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "GET"; + ht:resp [ + a ht:Response; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "utf-8"; + cnt:chars """ +@prefix foaf: . +@prefix v: . + + a foaf:Person; + foaf:name \"Jane Doe\"; + foaf:givenName \"Jane\"; + foaf:familyName \"Doe\"; + foaf:businessCard [ + a v:VCard; + v:fn \"Jane Doe\" + ] . +""" + ]; + ht:statusCodeValue "200" + ] + ]) + ]; + mf:name "GET of POST - multipart/form-data" . + +:get_of_put__default_graph a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$GRAPHSTORE$?default"; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Accept"; + ht:fieldValue "text/turtle"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "text/turtle; charset=utf-8"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle"; + ht:params ([ + a ht:Parameter; + ht:paramName "charset"; + ht:paramValue "utf-8" + ]) + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "GET"; + ht:resp [ + a ht:Response; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "utf-8"; + cnt:chars """ +@prefix foaf: . +@prefix v: . + +[] a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:given-name \"Alice\" + ] . +""" + ]; + ht:statusCodeValue "200" + ] + ]) + ]; + mf:name "GET of PUT - default graph" . + +:get_of_put__graph_already_in_store a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$GRAPHSTORE$/person/1"; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Accept"; + ht:fieldValue "text/turtle"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "text/turtle; charset=utf-8"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle"; + ht:params ([ + a ht:Parameter; + ht:paramName "charset"; + ht:paramValue "utf-8" + ]) + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "GET"; + ht:resp [ + a ht:Response; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "utf-8"; + cnt:chars """ +@prefix foaf: . +@prefix v: . + + a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:fn \"Jane Doe\" + ] . +""" + ]; + ht:statusCodeValue "200" + ] + ]) + ]; + mf:name "GET of PUT - graph already in store" . + +:get_of_put__initial_state a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$GRAPHSTORE$?graph=$GRAPHSTORE$/person/1.ttl"; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Accept"; + ht:fieldValue "text/turtle"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "text/turtle; charset=utf-8"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle"; + ht:params ([ + a ht:Parameter; + ht:paramName "charset"; + ht:paramValue "utf-8" + ]) + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "GET"; + ht:resp [ + a ht:Response; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "utf-8"; + cnt:chars """ + a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:fn \"John Doe\" + ]. +""" + ]; + ht:statusCodeValue "200" + ] + ]) + ]; + mf:name "GET of PUT - Initial state" . + +:head_on_a_nonexisting_graph a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$GRAPHSTORE$/person/4.ttl"; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "HEAD"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "404" + ] + ]) + ]; + mf:name "HEAD on a non-existing graph" . + +:head_on_an_existing_graph a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$GRAPHSTORE$/person/1.ttl"; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "text/turtle; charset=utf-8"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle"; + ht:params ([ + a ht:Parameter; + ht:paramName "charset"; + ht:paramValue "utf-8" + ]) + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "HEAD"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "200" + ] + ]) + ]; + mf:name "" . + +:post__create__new_graph a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$GRAPHSTORE$"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "utf-8"; + cnt:chars """ +@prefix foaf: . +@prefix v: . + +[] a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:given-name \"Alice\" + ] . +""" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "text/turtle; charset=utf-8"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle"; + ht:params ([ + a ht:Parameter; + ht:paramName "charset"; + ht:paramValue "utf-8" + ]) + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Location"; + ht:fieldValue "$NEWPATH$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$NEWPATH$" + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "201" + ] + ]) + ]; + mf:name "POST - create new graph" . + +:post__existing_graph a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$GRAPHSTORE$/person/1.ttl"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "utf-8"; + cnt:chars """ +@prefix foaf: . + + foaf:name \"Jane Doe\" +""" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "text/turtle; charset=utf-8"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle"; + ht:params ([ + a ht:Parameter; + ht:paramName "charset"; + ht:paramValue "utf-8" + ]) + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "200" + ] + ]) + ]; + mf:name "POST - existing graph" . + +:post__multipart_formdata a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$GRAPHSTORE$/person/1.ttl"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "UTF-8"; + cnt:chars """ +--a6fe4cd636164618814be9f8d3d1a0de +Content-Disposition: form-data; name=\"lastName.ttl\"; filename=\"lastName.ttl\" +Content-Type: text/turtle; charset=utf-8 + +@prefix foaf: . + foaf:familyName \"Doe\" + +--a6fe4cd636164618814be9f8d3d1a0de +Content-Disposition: form-data; name=\"firstName.ttl\"; filename=\"firstName.ttl\" +Content-Type: text/turtle; charset=utf-8 + +@prefix foaf: . + foaf:givenName \"Jane\" + +--a6fe4cd636164618814be9f8d3d1a0de-- + """ + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "multipart/form-data; boundary=a6fe4cd636164618814be9f8d3d1a0de"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "multipart/form-data"; + ht:params ([ + a ht:Parameter; + ht:paramName "boundary"; + ht:paramValue "a6fe4cd636164618814be9f8d3d1a0de" + ]) + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "POST"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "200" + ] + ]) + ]; + mf:name "POST - multipart/form-data" . + +:put__default_graph a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$GRAPHSTORE$?default"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "utf-8"; + cnt:chars """ +@prefix foaf: . +@prefix v: . + +[] a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:given-name \"Alice\" + ] . +""" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "text/turtle; charset=utf-8"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle"; + ht:params ([ + a ht:Parameter; + ht:paramName "charset"; + ht:paramValue "utf-8" + ]) + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "PUT"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "201" + ] + ]) + ]; + mf:name "PUT - default graph" . + +:put__graph_already_in_store a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$GRAPHSTORE$/person/1"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "utf-8"; + cnt:chars """ +@prefix foaf: . +@prefix v: . + + a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:fn \"Jane Doe\" + ]. +""" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "text/turtle; charset=utf-8"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle"; + ht:params ([ + a ht:Parameter; + ht:paramName "charset"; + ht:paramValue "utf-8" + ]) + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "PUT"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "204" + ] + ]) + ]; + mf:name "PUT - graph already in store" . + +:put__initial_state a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$GRAPHSTORE$/person/1.ttl"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "utf-8"; + cnt:chars """ +@prefix foaf: . +@prefix v: . + + a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:fn \"John Doe\" + ]. +""" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "text/turtle; charset=utf-8"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle"; + ht:params ([ + a ht:Parameter; + ht:paramName "charset"; + ht:paramValue "utf-8" + ]) + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "PUT"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "201" + ] + ]) + ]; + mf:name "PUT - Initial state" . + +:put__mismatched_payload a mf:ProtocolTest; + dawgt:approval dawgt:Approved; + dawgt:approvedBy ; + mf:action [ + a ht:Connection; + ht:connectionAuthority "www.example"; + ht:requests ([ + a ht:Request; + ht:absolutePath "$GRAPHSTORE$?default"; + ht:body [ + a cnt:ContentAsText; + cnt:characterEncoding "utf-8"; + cnt:chars """ +@prefix foaf: . +@prefix v: . + + a foaf:Person; + foaf:businessCard [ + a v:VCard; + v:fn \"Jane Doe\" + ]. +""" + ]; + ht:headers ([ + a ht:RequestHeader; + ht:fieldName "Host"; + ht:fieldValue "$HOST$"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "$HOST$" + ]) + ] [ + a ht:RequestHeader; + ht:fieldName "Content-Type"; + ht:fieldValue "text/turtle; charset=utf-8"; + ht:headerElements ([ + a ht:HeaderElement; + ht:elementName "text/turtle"; + ht:params ([ + a ht:Parameter; + ht:paramName "charset"; + ht:paramValue "utf-8" + ]) + ]) + ]); + ht:httpVersion "1.1"; + ht:methodName "PUT"; + ht:resp [ + a ht:Response; + ht:statusCodeValue "400" + ] + ]) + ]; + mf:name "PUT - mismatched payload" . diff --git a/sparql11/data-sparql11/http-rdf-update/template.haml b/sparql11/data-sparql11/http-rdf-update/template.haml index b4cdb2a6..55766b01 100644 --- a/sparql11/data-sparql11/http-rdf-update/template.haml +++ b/sparql11/data-sparql11/http-rdf-update/template.haml @@ -1,5 +1,5 @@ !!! 5 -%html{lang: :en, prefix: "dawgt: http://www.w3.org/2001/sw/DataAccess/tests/test-dawg# mf: http://www.w3.org/2001/sw/DataAccess/tests/test-manifest# mfx: http://jena.hpl.hp.com/2005/05/test-manifest-extra# qt: http://www.w3.org/2001/sw/DataAccess/tests/test-query# sd: http://www.w3.org/ns/sparql-service-description# ut: http://www.w3.org/2009/sparql/tests/test-update#"} +%html{lang: :en, prefix: "dawgt: http://www.w3.org/2001/sw/DataAccess/tests/test-dawg# mf: http://www.w3.org/2001/sw/DataAccess/tests/test-manifest# cnt: http://www.w3.org/2011/content# ht: http://www.w3.org/2011/http#"} %head %meta{"http-equiv" => "Content-Type", content: "text/html;charset=utf-8"} %meta{name: "viewport", content: "width=device-width, initial-scale=1.0"} @@ -27,6 +27,7 @@ dl.test-description>dt {margin-top: 2em;} dd {margin-left: 0;} dd code {display: inline;} + pre.code {margin-left: 0;} footer {text-align: center;} %title = man['label'] @@ -63,11 +64,14 @@ :markdown This page describes W3C SPARQL Working Group's SPARQL1.0 test suite. - **$HOST$** is the host where the Graph Store Protocol implementation is listening + **$HOST$** + : is the host where the Graph Store Protocol implementation is listening - **$GRAPHSTORE$** is the path of the URL of the graph store + **$GRAPHSTORE$** + : is the path of the URL of the graph store - **$NEWPATH$** is the URL returned in the Location HTTP header + **$NEWPATH$** + : is the URL returned in the Location HTTP header HTTP response messages are in the format: @@ -75,7 +79,7 @@ Headers Body - + ### Contributing Tests The test manifests and entries are built automatically from [manifest.ttl](manifest.ttl) using a Rake task. Tests may be contributed via pull request to [https://github.com/w3c/rdf-tests](https://github.com/w3c/rdf-tests) with suitable changes to the [manifest.ttl](manifest.ttl) and referenced files. @@ -102,17 +106,11 @@ Test Descriptions %dl.test-description - man['entries'].each do |test| - %dt{id: test['@id']} - %a.testlink{href: "##{test['@id']}"} + %dt{id: test['@id'][1..-1]} + %a.testlink{href: "#{test['@id']}"} = "#{test['@id']}:" %span{about: test['@id'], property: "mf:name"}<~test['name'] %dd{property: "mf:entry", inlist: true, resource: test['@id'], typeof: test['@type']} - %div{property: "rdfs:comment"} - :markdown - #{test['comment'].to_s.gsub(/(MUST|SHOULD|MAY)/, '\\1')} - - if test['type'] =~ /Negative/ - %p.error - Negative Test %dl.test-detail %dt="type" %dd<~test['@type'] @@ -123,85 +121,84 @@ %dt="approvedBy" %dd %a{property: "dawgt:approvedBy", href: test['approvedBy']}<~test['approvedBy'] - - - # Evaluation Tests - - if test['action'].is_a?(String) - %dt="action" - %dd - %a{property: "mf:action", href: test['action']}<~test['action'] - - if test['action'].is_a?(Hash) - %dt="action" - %dd - %dl.test-detail{property: "mf:action", resource: test['action']['@id']} - - # Entailment - - if test['action']['EntailmentProfile'] - %dt='EntailmentProfile' - %dd - - test['action']['EntailmentProfile'].each do |r| - %span{property: "sd:EntailmentProfile", resource: r}<~r - - if test['action']['http://www.w3.org/ns/sparql-service-description#EntailmentProfile'] - %dt='EntailmentProfile' - %dd{property: "sd:EntailmentProfile", resource: test['action']['http://www.w3.org/ns/sparql-service-description#EntailmentProfile']['@id']}<~test['action']['http://www.w3.org/ns/sparql-service-description#EntailmentProfile']['@id'] - - if test['action']['entailmentRegime'] - %dt='entailmentRegime' - %dd - - test['action']['entailmentRegime'].each do |r| - %span{property: "sd:entailmentRegime", resource: r}<~r - - if test['action']['http://www.w3.org/ns/sparql-service-description#entailmentRegime'] - %dt='entailmentRegime' - %dd{property: "sd:entailmentRegime", resource: test['action']['http://www.w3.org/ns/sparql-service-description#entailmentRegime']['@id']}<~test['action']['http://www.w3.org/ns/sparql-service-description#entailmentRegime']['@id'] - - - if test['action']['query'] - %dt='query' - %dd - %a{property: "qt:query", href: test['action']['query']}<~test['action']['query'] - - if test['action']['data'] - %dt='data' - %dd - %a{property: "qt:data", href: test['action']['data']}<~test['action']['data'] - - if test['action']['ut:data'] - %dt='data' - %dd - %a{property: "ut:data", href: test['action']['ut:data']}<~test['action']['ut:data'] - - if test['action']['ut:graphData'] - %dt='graphData' - %dd - %table.test-detail - - test['action']['ut:graphData'].each do |gd| - %tr{property: 'ut:graphData', resource: gd['@id']} - %td{property: "rdfs:label"}<~gd['label'] - %td - %a{property: "ut:graph", href: gd['ut:graph']}<~gd['ut:graph'] - - if test['action']['ut:request'] - %dt='request' - %dd - %a{property: "ut:request", href: test['action']['ut:request']}<~test['action']['ut:request'] - - - if test['result'].is_a?(String) - %dt="result" - %dd - %a{property: "mf:result", href: test['result']}<~test['result'] - - if test['result'].is_a?(Hash) - %dt="result" - %dd - %dl.test-detail{property: "mf:result", resource: test['result']['@id']} - - if test['result']['ut:result'] - %dt='result' - %dd - %code{property: "ut:result", resource: test['result']['ut:result']}<~test['result']['ut:result'] - - if test['result']['ut:data'] - %dt='data' - %dd - %a{property: "ut:data", href: test['result']['ut:data']}<~test['result']['ut:data'] - - if test['result']['ut:graphData'] - %dt='graphData' - %dd - %table.test-detail - - test['result']['ut:graphData'].each do |gd| - %tr{property: 'ut:graphData', resource: gd['@id']} - %td{property: "rdfs:label"}<~gd['label'] - %td - %a{property: "ut:graph", href: gd['ut:graph']}<~gd['ut:graph'] + - # Evaluation Tests + - if test['action'].is_a?(Hash) + %div.test-detail{property: "mf:action", typeof: test['action']['@type']} + %meta{property: "ht:connectionAuthority", value: test['action']['ht:connectionAuthority']} + %div{property: 'ht:requests', inlist: true} + - test['action']['requests'].each_with_index do |request, ndx| + - response = request['ht:resp'] + - if ndx > 0 + %br + %div + followed by + %div{typeof: request['@type']} + %h4 Request + %code + %span{property: 'ht:methodName'}<=request['ht:methodName'] + %span{property: 'ht:absolutePath'}&=request['ht:absolutePath'] + HTTP/ + %span{property: 'ht:absolutePath'}<>=request['ht:httpVersion'] + %br + %span<="Host: " + test['action']['ht:connectionAuthority'] + %br + - if request['headers'] + %span{property: 'ht:headers', inlist: true} + - request['headers'].each do |header| + %div{typeof: header['@type']} + %meta{property: 'ht:fieldValue', value: header['ht:fieldValue']} + %span{property: 'ht:fieldName'}<>= header['ht:fieldName'] + = ': ' + %span{property: 'ht:headerElements', inlist: true} + - header['headerElements'].each_with_index do |he, hendx| + - if hendx > 0 + %span or + %span{typeof: he['@type']} + %span{property: 'ht:elementName'}<>= he['ht:elementName'] + - Array(he['params']).each do |param| + = "; " + %span{property: 'ht:params', typeof: param['@type'], inlist: true} + %span{property: 'ht:paramName'}<>= param['ht:paramName'] + = "=" + %span{property: 'ht:paramValue'}<>= param['ht:paramValue'] + - if request['ht:body'] + %br + %div{property: 'ht:body', typeof: request['ht:body']['@type']} + %meta{property: 'cnt:characterEncoding', value: request['ht:body']['cnt:characterEncoding']} + %pre.code{property: 'cnt:chars'}&= request['ht:body']['cnt:chars'] + %div{typeof: response['@type']} + %h4 Response + %code + - response['ht:statusCodeValue'].each_with_index do |s, sndx| + - if sndx > 0 + = "or" + %span{property: 'ht:statusCodeValue'}<=s + %span + response + - if response['headers'] + %span{property: 'ht:headers', inlist: true} + - response['headers'].each_with_index do |header, hndx| + %div{typeof: header['@type']} + %meta{property: 'ht:fieldValue', value: header['ht:fieldValue']} + %span{property: 'ht:fieldName'}<>= header['ht:fieldName'] + = ': ' + %span{property: 'ht:headerElements', inlist: true} + - header['headerElements'].each_with_index do |he, hendx| + - if hendx > 0 + %span or + %span{typeof: he['@type']} + %span{property: 'ht:elementName'}<>= he['ht:elementName'] + - Array(he['params']).each do |param| + = "; " + %span{property: 'ht:params', typeof: param['@type'], inlist: true} + %span{property: 'ht:paramName'}<>= param['ht:paramName'] + = "=" + %span{property: 'ht:paramValue'}<>= param['ht:paramValue'] + - if response['ht:body'] + %br + %div{property: 'ht:body', typeof: response['ht:body']['@type']} + %meta{property: 'cnt:characterEncoding', value: response['ht:body']['cnt:characterEncoding']} + %pre.code{property: 'cnt:chars'}&= response['ht:body']['cnt:chars'] %footer :markdown From 23fb231148b7dc8e0e23694dfd28cf917efd2a18 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Thu, 28 Apr 2022 13:53:02 -0700 Subject: [PATCH 7/8] Fix GraphStore test type. --- .../http-rdf-update/gen_manifest.rb | 2 +- .../data-sparql11/http-rdf-update/index.html | 76 +++++++++---------- .../http-rdf-update/manifest.jsonld | 38 +++++----- .../http-rdf-update/manifest.ttl | 38 +++++----- 4 files changed, 77 insertions(+), 77 deletions(-) diff --git a/sparql11/data-sparql11/http-rdf-update/gen_manifest.rb b/sparql11/data-sparql11/http-rdf-update/gen_manifest.rb index 0908e982..a77c2ffd 100644 --- a/sparql11/data-sparql11/http-rdf-update/gen_manifest.rb +++ b/sparql11/data-sparql11/http-rdf-update/gen_manifest.rb @@ -450,7 +450,7 @@ def gen_entry(frag, params) $charset = "UTF-8" entry = { '@id': "##{frag}", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": params.delete(:name), "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", diff --git a/sparql11/data-sparql11/http-rdf-update/index.html b/sparql11/data-sparql11/http-rdf-update/index.html index 9bd29663..d7ad74fc 100644 --- a/sparql11/data-sparql11/http-rdf-update/index.html +++ b/sparql11/data-sparql11/http-rdf-update/index.html @@ -104,10 +104,10 @@

PUT - Initial state -
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
@@ -160,10 +160,10 @@

Response

GET of PUT - Initial state -
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
@@ -221,10 +221,10 @@

Response

PUT - graph already in store -
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
@@ -277,10 +277,10 @@

Response

GET of PUT - graph already in store -
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
@@ -338,10 +338,10 @@

Response

PUT - default graph -
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
@@ -394,10 +394,10 @@

Response

GET of PUT - default graph -
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
@@ -455,10 +455,10 @@

Response

PUT - mismatched payload -
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
@@ -511,10 +511,10 @@

Response

DELETE - existing graph -
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
@@ -556,10 +556,10 @@

Response

GET of DELETE - existing graph -
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
@@ -601,10 +601,10 @@

Response

DELETE - non-existent graph) -
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
@@ -646,10 +646,10 @@

Response

POST - existing graph -
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
@@ -702,10 +702,10 @@

Response

GET of POST - existing graph -
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
@@ -763,10 +763,10 @@

Response

POST - multipart/form-data -
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
@@ -819,10 +819,10 @@

Response

GET of POST - multipart/form-data -
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
@@ -875,10 +875,10 @@

Response

POST - create new graph -
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
@@ -936,10 +936,10 @@

Response

GET of POST - create new graph -
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
@@ -997,10 +997,10 @@

Response

GET of POST - after noop -
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
@@ -1058,10 +1058,10 @@

Response

-
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
@@ -1109,10 +1109,10 @@

Response

HEAD on a non-existing graph -
+
type
-
mf:ProtocolTest
+
mf:mf:GraphStoreProtocolTest
approval
dawgt:Approved
approvedBy
diff --git a/sparql11/data-sparql11/http-rdf-update/manifest.jsonld b/sparql11/data-sparql11/http-rdf-update/manifest.jsonld index e9d123cd..45661f1d 100644 --- a/sparql11/data-sparql11/http-rdf-update/manifest.jsonld +++ b/sparql11/data-sparql11/http-rdf-update/manifest.jsonld @@ -90,7 +90,7 @@ "entries": [ { "@id": "#put__initial_state", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "PUT - Initial state", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", @@ -151,7 +151,7 @@ }, { "@id": "#get_of_put__initial_state", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "GET of PUT - Initial state", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", @@ -223,7 +223,7 @@ }, { "@id": "#put__graph_already_in_store", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "PUT - graph already in store", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", @@ -284,7 +284,7 @@ }, { "@id": "#get_of_put__graph_already_in_store", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "GET of PUT - graph already in store", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", @@ -356,7 +356,7 @@ }, { "@id": "#put__default_graph", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "PUT - default graph", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", @@ -417,7 +417,7 @@ }, { "@id": "#get_of_put__default_graph", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "GET of PUT - default graph", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", @@ -489,7 +489,7 @@ }, { "@id": "#put__mismatched_payload", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "PUT - mismatched payload", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", @@ -550,7 +550,7 @@ }, { "@id": "#delete__existing_graph", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "DELETE - existing graph", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", @@ -588,7 +588,7 @@ }, { "@id": "#get_of_delete__existing_graph", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "GET of DELETE - existing graph", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", @@ -626,7 +626,7 @@ }, { "@id": "#delete__nonexistent_graph", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "DELETE - non-existent graph)", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", @@ -664,7 +664,7 @@ }, { "@id": "#post__existing_graph", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "POST - existing graph", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", @@ -725,7 +725,7 @@ }, { "@id": "#get_of_post__existing_graph", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "GET of POST - existing graph", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", @@ -797,7 +797,7 @@ }, { "@id": "#post__multipart_formdata", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "POST - multipart/form-data", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", @@ -858,7 +858,7 @@ }, { "@id": "#get_of_post__multipart_formdata", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "GET of POST - multipart/form-data", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", @@ -919,7 +919,7 @@ }, { "@id": "#post__create__new_graph", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "POST - create new graph", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", @@ -991,7 +991,7 @@ }, { "@id": "#get_of_post__create__new_graph", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "GET of POST - create new graph", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", @@ -1063,7 +1063,7 @@ }, { "@id": "#get_of_post__after_noop", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "GET of POST - after noop", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", @@ -1135,7 +1135,7 @@ }, { "@id": "#head_on_an_existing_graph", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", @@ -1191,7 +1191,7 @@ }, { "@id": "#head_on_a_nonexisting_graph", - "@type": "mf:ProtocolTest", + "@type": "mf:mf:GraphStoreProtocolTest", "name": "HEAD on a non-existing graph", "approval": "dawgt:Approved", "approvedBy": "http://www.w3.org/2009/sparql/meeting/2012-11-20#resolution_3", diff --git a/sparql11/data-sparql11/http-rdf-update/manifest.ttl b/sparql11/data-sparql11/http-rdf-update/manifest.ttl index 327dbfa9..f80d69dc 100644 --- a/sparql11/data-sparql11/http-rdf-update/manifest.ttl +++ b/sparql11/data-sparql11/http-rdf-update/manifest.ttl @@ -29,7 +29,7 @@ :head_on_an_existing_graph :head_on_a_nonexisting_graph) . -:delete__existing_graph a mf:ProtocolTest; +:delete__existing_graph a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ @@ -57,7 +57,7 @@ ]; mf:name "DELETE - existing graph" . -:delete__nonexistent_graph a mf:ProtocolTest; +:delete__nonexistent_graph a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ @@ -85,7 +85,7 @@ ]; mf:name "DELETE - non-existent graph)" . -:get_of_delete__existing_graph a mf:ProtocolTest; +:get_of_delete__existing_graph a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ @@ -113,7 +113,7 @@ ]; mf:name "GET of DELETE - existing graph" . -:get_of_post__after_noop a mf:ProtocolTest; +:get_of_post__after_noop a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ @@ -173,7 +173,7 @@ ]; mf:name "GET of POST - after noop" . -:get_of_post__create__new_graph a mf:ProtocolTest; +:get_of_post__create__new_graph a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ @@ -233,7 +233,7 @@ ]; mf:name "GET of POST - create new graph" . -:get_of_post__existing_graph a mf:ProtocolTest; +:get_of_post__existing_graph a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ @@ -297,7 +297,7 @@ ]; mf:name "GET of POST - existing graph" . -:get_of_post__multipart_formdata a mf:ProtocolTest; +:get_of_post__multipart_formdata a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ @@ -355,7 +355,7 @@ ]; mf:name "GET of POST - multipart/form-data" . -:get_of_put__default_graph a mf:ProtocolTest; +:get_of_put__default_graph a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ @@ -418,7 +418,7 @@ ]; mf:name "GET of PUT - default graph" . -:get_of_put__graph_already_in_store a mf:ProtocolTest; +:get_of_put__graph_already_in_store a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ @@ -481,7 +481,7 @@ ]; mf:name "GET of PUT - graph already in store" . -:get_of_put__initial_state a mf:ProtocolTest; +:get_of_put__initial_state a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ @@ -541,7 +541,7 @@ ]; mf:name "GET of PUT - Initial state" . -:head_on_a_nonexisting_graph a mf:ProtocolTest; +:head_on_a_nonexisting_graph a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ @@ -569,7 +569,7 @@ ]; mf:name "HEAD on a non-existing graph" . -:head_on_an_existing_graph a mf:ProtocolTest; +:head_on_an_existing_graph a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ @@ -610,7 +610,7 @@ ]; mf:name "" . -:post__create__new_graph a mf:ProtocolTest; +:post__create__new_graph a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ @@ -673,7 +673,7 @@ ]; mf:name "POST - create new graph" . -:post__existing_graph a mf:ProtocolTest; +:post__existing_graph a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ @@ -723,7 +723,7 @@ ]; mf:name "POST - existing graph" . -:post__multipart_formdata a mf:ProtocolTest; +:post__multipart_formdata a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ @@ -785,7 +785,7 @@ Content-Type: text/turtle; charset=utf-8 ]; mf:name "POST - multipart/form-data" . -:put__default_graph a mf:ProtocolTest; +:put__default_graph a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ @@ -840,7 +840,7 @@ Content-Type: text/turtle; charset=utf-8 ]; mf:name "PUT - default graph" . -:put__graph_already_in_store a mf:ProtocolTest; +:put__graph_already_in_store a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ @@ -895,7 +895,7 @@ Content-Type: text/turtle; charset=utf-8 ]; mf:name "PUT - graph already in store" . -:put__initial_state a mf:ProtocolTest; +:put__initial_state a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ @@ -950,7 +950,7 @@ Content-Type: text/turtle; charset=utf-8 ]; mf:name "PUT - Initial state" . -:put__mismatched_payload a mf:ProtocolTest; +:put__mismatched_payload a mf:mf:GraphStoreProtocolTest; dawgt:approval dawgt:Approved; dawgt:approvedBy ; mf:action [ From 515c519abf9c5615862ad559c0fc35eb71b52759 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 16 May 2022 10:53:58 -0700 Subject: [PATCH 8/8] Don't automatically add Content-Type on POSTs if not explicitly provided. --- sparql11/data-sparql11/protocol/Rakefile | 3 + .../data-sparql11/protocol/gen_manifest.rb | 4 +- sparql11/data-sparql11/protocol/index.html | 142 +--------- .../data-sparql11/protocol/manifest.jsonld | 258 ------------------ sparql11/data-sparql11/protocol/manifest.ttl | 179 ------------ 5 files changed, 7 insertions(+), 579 deletions(-) diff --git a/sparql11/data-sparql11/protocol/Rakefile b/sparql11/data-sparql11/protocol/Rakefile index c3c62b82..d949df1f 100644 --- a/sparql11/data-sparql11/protocol/Rakefile +++ b/sparql11/data-sparql11/protocol/Rakefile @@ -1,14 +1,17 @@ # Builds manifests task default: [:jsonld, :ttl, :html] +desc "Create manifest.jsonld" task jsonld: "gen_manifest.rb" do %x(ruby gen_manifest.rb -o manifest.jsonld) end +desc "Create manifest.ttl" task ttl: "gen_manifest.rb" do %x(ruby gen_manifest.rb --format ttl -o manifest.ttl) end +desc "Create index.html" task html: "gen_manifest.rb" do %x(ruby gen_manifest.rb --format html -o index.html) end diff --git a/sparql11/data-sparql11/protocol/gen_manifest.rb b/sparql11/data-sparql11/protocol/gen_manifest.rb index 3a54b099..6ba9c62b 100644 --- a/sparql11/data-sparql11/protocol/gen_manifest.rb +++ b/sparql11/data-sparql11/protocol/gen_manifest.rb @@ -744,8 +744,8 @@ def gen_entry(frag, params) req[:Accept] # Default Content-Type on POST - req[:'Content-Type'] = "application/x-www-form-urlencoded" if - req[:method] == :POST && !req.key?(:'Content-Type') + #req[:'Content-Type'] = "application/x-www-form-urlencoded" if + # req[:method] == :POST && !req.key?(:'Content-Type') (request[:headers] ||= []) << encode_header(req, :'Content-Type') if req[:'Content-Type'] diff --git a/sparql11/data-sparql11/protocol/index.html b/sparql11/data-sparql11/protocol/index.html index 977571ba..1e5e9bee 100644 --- a/sparql11/data-sparql11/protocol/index.html +++ b/sparql11/data-sparql11/protocol/index.html @@ -186,14 +186,7 @@

Request

/sparql?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf HTTP/1.1
Host: www.example -
- -
-Content-Type: -application/x-www-form-urlencoded - -
-
+

Response

@@ -312,13 +305,6 @@

Request

HTTP/1.1
Host: www.example
- -
-Content-Type: -application/x-www-form-urlencoded - -
-

@@ -430,13 +416,6 @@

Request

HTTP/1.1
Host: www.example
- -
-Content-Type: -application/x-www-form-urlencoded - -
-

@@ -495,13 +474,6 @@

Request

HTTP/1.1
Host: www.example
- -
-Content-Type: -application/x-www-form-urlencoded - -
-

@@ -613,13 +585,6 @@

Request

HTTP/1.1
Host: www.example
- -
-Content-Type: -application/x-www-form-urlencoded - -
-

@@ -678,13 +643,6 @@

Request

HTTP/1.1
Host: www.example
- -
-Content-Type: -application/x-www-form-urlencoded - -
-

@@ -743,13 +701,6 @@

Request

HTTP/1.1
Host: www.example
- -
-Content-Type: -application/x-www-form-urlencoded - -
-

@@ -807,13 +758,6 @@

Request

HTTP/1.1
Host: www.example
- -
-Content-Type: -application/x-www-form-urlencoded - -
-

@@ -867,13 +811,6 @@

Request

HTTP/1.1
Host: www.example
- -
-Content-Type: -application/x-www-form-urlencoded - -
-

@@ -933,13 +870,6 @@

Request

HTTP/1.1
Host: www.example
- -
-Content-Type: -application/x-www-form-urlencoded - -
-

@@ -999,13 +929,6 @@

Request

HTTP/1.1
Host: www.example
- -
-Content-Type: -application/x-www-form-urlencoded - -
-

@@ -1100,13 +1023,6 @@

Request

HTTP/1.1
Host: www.example
- -
-Content-Type: -application/x-www-form-urlencoded - -
-

@@ -1207,13 +1123,6 @@

Request

HTTP/1.1
Host: www.example
- -
-Content-Type: -application/x-www-form-urlencoded - -
-

@@ -1313,14 +1222,7 @@

Request

/sparql?update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ADROP%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-full-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20%3Chttp%3A%2F%2Fexample.org%2Fin%3E%20%3Fin%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20%7B%0A%20%20%20%20GRAPH%20%3Fg%20%7B%20%3Fs%20a%20foaf%3ADocument%20%7D%0A%20%20%20%20BIND%28%3Fg%20AS%20%3Fin%29%0A%20%20%7D%0A%20%20UNION%0A%20%20%7B%0A%20%20%20%20%3Fs%20a%20foaf%3ADocument%20.%0A%20%20%20%20BIND%28%22default%22%20AS%20%3Fin%29%0A%20%20%7D%0A%7D%0A&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf HTTP/1.1
Host: www.example -
- -
-Content-Type: -application/x-www-form-urlencoded - -
-
+

Response

@@ -1416,13 +1318,6 @@

Request

HTTP/1.1
Host: www.example
- -
-Content-Type: -application/x-www-form-urlencoded - -
-

@@ -1518,13 +1413,6 @@

Request

HTTP/1.1
Host: www.example
- -
-Content-Type: -application/x-www-form-urlencoded - -
-

@@ -1556,11 +1444,6 @@

Request

application/sparql-results+xml
-
-Content-Type: -application/x-www-form-urlencoded - -

@@ -1787,13 +1670,6 @@

Request

HTTP/1.1
Host: www.example
- -
-Content-Type: -application/x-www-form-urlencoded - -
-

@@ -1964,13 +1840,6 @@

Request

HTTP/1.1
Host: www.example
- -
-Content-Type: -application/x-www-form-urlencoded - -
-

@@ -2158,13 +2027,6 @@

Request

HTTP/1.1
Host: www.example
- -
-Content-Type: -application/x-www-form-urlencoded - -
-

diff --git a/sparql11/data-sparql11/protocol/manifest.jsonld b/sparql11/data-sparql11/protocol/manifest.jsonld index 46f982ef..fe235227 100644 --- a/sparql11/data-sparql11/protocol/manifest.jsonld +++ b/sparql11/data-sparql11/protocol/manifest.jsonld @@ -152,19 +152,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:resp": { "@type": "ht:Response", "ht:statusCodeValue": [ @@ -279,19 +266,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:body": { "@type": "cnt:ContentAsText", "cnt:chars": "query=ASK%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%3Fp%20%3Fo%20%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf", @@ -393,19 +367,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:body": { "@type": "cnt:ContentAsText", "cnt:chars": "query=ASK%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20.%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20.%20%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", @@ -459,19 +420,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:body": { "@type": "cnt:ContentAsText", "cnt:chars": "query=ASK%20%7B%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%20%7D&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", @@ -573,19 +521,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:body": { "@type": "cnt:ContentAsText", "cnt:chars": "query=%0AASK%20%7B%0A%20%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20%3Ftype%0A%20%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%0A%20%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%0A%7D%0A&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", @@ -639,19 +574,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:body": { "@type": "cnt:ContentAsText", "cnt:chars": "query=ASK%20FROM%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%20%7D&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", @@ -705,19 +627,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:body": { "@type": "cnt:ContentAsText", "cnt:chars": "query=SELECT%20%281%20AS%20%3Fvalue%29%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", @@ -774,19 +683,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:body": { "@type": "cnt:ContentAsText", "cnt:chars": "query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", @@ -835,19 +731,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:body": { "@type": "cnt:ContentAsText", "cnt:chars": "query=DESCRIBE%20%3Chttp%3A%2F%2Fexample.org%2F%3E&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", @@ -908,19 +791,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:body": { "@type": "cnt:ContentAsText", "cnt:chars": "query=CONSTRUCT%20%7B%20%3Cs%3E%20%3Cp%3E%201%20%7D%20WHERE%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", @@ -981,19 +851,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:body": { "@type": "cnt:ContentAsText", "cnt:chars": "update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ACLEAR%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%0A%20%20%20%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%0A%20%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20a%20dc%3ABibliographicResource%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20%3Fs%20a%20foaf%3ADocument%0A%7D%0A", @@ -1080,19 +937,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:body": { "@type": "cnt:ContentAsText", "cnt:chars": "update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ADROP%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-graphs-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20a%20dc%3ABibliographicResource%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20%3Fs%20a%20foaf%3ADocument%0A%7D%0A", @@ -1179,19 +1023,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:body": { "@type": "cnt:ContentAsText", "cnt:chars": "update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ADROP%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-named-graphs-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20a%20dc%3ABibliographicResource%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20GRAPH%20%3Fg%20%7B%0A%20%20%20%20%3Fs%20a%20foaf%3ADocument%0A%20%20%7D%0A%7D%0A", @@ -1278,19 +1109,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql?update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ADROP%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-full-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20%3Chttp%3A%2F%2Fexample.org%2Fin%3E%20%3Fin%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20%7B%0A%20%20%20%20GRAPH%20%3Fg%20%7B%20%3Fs%20a%20foaf%3ADocument%20%7D%0A%20%20%20%20BIND%28%3Fg%20AS%20%3Fin%29%0A%20%20%7D%0A%20%20UNION%0A%20%20%7B%0A%20%20%20%20%3Fs%20a%20foaf%3ADocument%20.%0A%20%20%20%20BIND%28%22default%22%20AS%20%3Fin%29%0A%20%20%7D%0A%7D%0A&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:resp": { "@type": "ht:Response", "ht:statusCodeValue": [ @@ -1372,19 +1190,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:body": { "@type": "cnt:ContentAsText", "cnt:chars": "update=CLEAR%20ALL", @@ -1460,19 +1265,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:body": { "@type": "cnt:ContentAsText", "cnt:chars": "update=CLEAR%20SILENT%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-base-test%2F%3E%20%3B%20INSERT%20DATA%20%7B%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-base-test%2F%3E%20%7B%20%3Chttp%3A%2F%2Fexample.org%2Fs%3E%20%3Chttp%3A%2F%2Fexample.org%2Fp%3E%20%3Ctest%3E%20%7D%20%7D", @@ -1502,17 +1294,6 @@ "ht:elementName": "application/sparql-results+xml" } ] - }, - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] } ], "ht:body": { @@ -1687,19 +1468,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql?default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:body": { "@type": "cnt:ContentAsText", "cnt:chars": "ASK {}", @@ -1830,19 +1598,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:body": { "@type": "cnt:ContentAsText", "cnt:chars": "update=CLEAR%20ALL&update=CLEAR%20DEFAULT", @@ -1996,19 +1751,6 @@ "ht:methodName": "POST", "ht:httpVersion": "1.1", "ht:absolutePath": "/sparql?using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf", - "headers": [ - { - "@type": "ht:RequestHeader", - "ht:fieldName": "Content-Type", - "ht:fieldValue": "application/x-www-form-urlencoded", - "headerElements": [ - { - "@type": "ht:HeaderElement", - "ht:elementName": "application/x-www-form-urlencoded" - } - ] - } - ], "ht:body": { "@type": "cnt:ContentAsText", "cnt:chars": "update=CLEAR%20XYZ", diff --git a/sparql11/data-sparql11/protocol/manifest.ttl b/sparql11/data-sparql11/protocol/manifest.ttl index 2e41f47d..d921c0d7 100644 --- a/sparql11/data-sparql11/protocol/manifest.ttl +++ b/sparql11/data-sparql11/protocol/manifest.ttl @@ -86,15 +86,6 @@ Some tests require special result processing. cnt:characterEncoding "UTF-8"; cnt:chars "update=CLEAR%20ALL&update=CLEAR%20DEFAULT" ]; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [ @@ -138,15 +129,6 @@ Some tests require special result processing. cnt:characterEncoding "UTF-8"; cnt:chars "ASK {}" ]; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [ @@ -399,15 +381,6 @@ Some tests require special result processing. cnt:characterEncoding "UTF-8"; cnt:chars "update=CLEAR%20XYZ" ]; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [ @@ -465,15 +438,6 @@ Some tests require special result processing. cnt:characterEncoding "UTF-8"; cnt:chars "query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf" ]; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [ @@ -511,15 +475,6 @@ Some tests require special result processing. cnt:characterEncoding "UTF-8"; cnt:chars "query=CONSTRUCT%20%7B%20%3Cs%3E%20%3Cp%3E%201%20%7D%20WHERE%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf" ]; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [ @@ -566,15 +521,6 @@ Some tests require special result processing. cnt:characterEncoding "UTF-8"; cnt:chars "query=DESCRIBE%20%3Chttp%3A%2F%2Fexample.org%2F%3E&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf" ]; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [ @@ -621,15 +567,6 @@ Some tests require special result processing. cnt:characterEncoding "UTF-8"; cnt:chars "query=SELECT%20%281%20AS%20%3Fvalue%29%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf" ]; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [ @@ -673,15 +610,6 @@ Some tests require special result processing. cnt:characterEncoding "UTF-8"; cnt:chars "query=ASK%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%3Fp%20%3Fo%20%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf" ]; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [ @@ -761,15 +689,6 @@ Some tests require special result processing. cnt:characterEncoding "UTF-8"; cnt:chars "query=ASK%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20.%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20.%20%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf" ]; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [ @@ -812,15 +731,6 @@ Some tests require special result processing. cnt:characterEncoding "UTF-8"; cnt:chars "query=%0AASK%20%7B%0A%20%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20%3Ftype%0A%20%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%0A%20%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%0A%7D%0A&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf" ]; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [ @@ -900,15 +810,6 @@ Some tests require special result processing. cnt:characterEncoding "UTF-8"; cnt:chars "query=ASK%20%7B%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%20%7D&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf" ]; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [ @@ -988,15 +889,6 @@ Some tests require special result processing. cnt:characterEncoding "UTF-8"; cnt:chars "query=ASK%20FROM%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20GRAPH%20%3Fg1%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20%3Ftype%20%7D%20GRAPH%20%3Fg2%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20%3Ftype%20%7D%20%7D&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&named-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf" ]; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [ @@ -1085,15 +977,6 @@ Some tests require special result processing. ht:requests ([ a ht:Request; ht:absolutePath "/sparql?query=ASK%20%7B%7D&default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf"; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [ @@ -1136,15 +1019,6 @@ Some tests require special result processing. cnt:characterEncoding "UTF-8"; cnt:chars "update=CLEAR%20SILENT%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-base-test%2F%3E%20%3B%20INSERT%20DATA%20%7B%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-base-test%2F%3E%20%7B%20%3Chttp%3A%2F%2Fexample.org%2Fs%3E%20%3Chttp%3A%2F%2Fexample.org%2Fp%3E%20%3Ctest%3E%20%7D%20%7D" ]; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [ @@ -1168,14 +1042,6 @@ Some tests require special result processing. a ht:HeaderElement; ht:elementName "application/sparql-results+xml" ]) - ] [ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) ]); ht:httpVersion "1.1"; ht:methodName "POST"; @@ -1216,15 +1082,6 @@ Some tests require special result processing. cnt:characterEncoding "UTF-8"; cnt:chars "update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ACLEAR%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%0A%20%20%20%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%0A%20%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20a%20dc%3ABibliographicResource%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20%3Fs%20a%20foaf%3ADocument%0A%7D%0A" ]; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [ @@ -1297,15 +1154,6 @@ ASK { cnt:characterEncoding "UTF-8"; cnt:chars "update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ADROP%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-graphs-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20a%20dc%3ABibliographicResource%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20%3Fs%20a%20foaf%3ADocument%0A%7D%0A" ]; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [ @@ -1379,15 +1227,6 @@ ASK { ht:requests ([ a ht:Request; ht:absolutePath "/sparql?update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ADROP%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-full-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20%3Chttp%3A%2F%2Fexample.org%2Fin%3E%20%3Fin%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20%7B%0A%20%20%20%20GRAPH%20%3Fg%20%7B%20%3Fs%20a%20foaf%3ADocument%20%7D%0A%20%20%20%20BIND%28%3Fg%20AS%20%3Fin%29%0A%20%20%7D%0A%20%20UNION%0A%20%20%7B%0A%20%20%20%20%3Fs%20a%20foaf%3ADocument%20.%0A%20%20%20%20BIND%28%22default%22%20AS%20%3Fin%29%0A%20%20%7D%0A%7D%0A&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf"; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [ @@ -1466,15 +1305,6 @@ ASK { cnt:characterEncoding "UTF-8"; cnt:chars "update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ADROP%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-named-graphs-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20a%20dc%3ABibliographicResource%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20GRAPH%20%3Fg%20%7B%0A%20%20%20%20%3Fs%20a%20foaf%3ADocument%0A%20%20%7D%0A%7D%0A" ]; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [ @@ -1587,15 +1417,6 @@ ASK { cnt:characterEncoding "UTF-8"; cnt:chars "update=CLEAR%20ALL" ]; - ht:headers ([ - a ht:RequestHeader; - ht:fieldName "Content-Type"; - ht:fieldValue "application/x-www-form-urlencoded"; - ht:headerElements ([ - a ht:HeaderElement; - ht:elementName "application/x-www-form-urlencoded" - ]) - ]); ht:httpVersion "1.1"; ht:methodName "POST"; ht:resp [