<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE spec SYSTEM "../shared/xmlspec.dtd" [
	<!ENTITY base.uri "http://www.w3.org/2009/sparql/docs/protocol-1.1/">
	<!ENTITY maturity.level "REC">
	<!ENTITY doc.shortname "sparql11-protocol">
	<!ENTITY draft.year "2009">
	<!ENTITY draft.month.name "October">
	<!ENTITY draft.month "10">
	<!ENTITY draft.day "22">
	<!ENTITY iso6.doc.date "&draft.year;&draft.month;&draft.day;">
	<!ENTITY doc.ident "&maturity.level;-&doc.shortname;-&iso6.doc.date;">
	<!ENTITY this.version "&base.uri;&doc.ident;">
	<!ENTITY xml.version "&doc.ident;.xml">
	<!ENTITY review.version "&doc.ident;-review.html">
	<!ENTITY pdf.version "&doc.ident;.pdf">
	<!ENTITY errataloc "http://www.w3.org/XML/xml-V10-5e-errata">
	<!ENTITY preverrataloc "http://www.w3.org/XML/xml-V10-4e-errata">
	<!ENTITY translationloc "http://www.w3.org/2003/03/Translations/byTechnology?technology=&doc.shortname;">
	<!ENTITY impreploc "http://www.w3.org/XML/2008/01/xml10-5e-implementation.html">
	<!ENTITY versionOfSPARQL "1.1">
	<!ENTITY WebSGML "WebSGML Adaptations Annex to ISO 8879">
	<!ENTITY nbsp "&#160;">
	<!ENTITY mdash "&#x2014;">
	<!ENTITY magicents "<code>amp</code>,
<code>lt</code>,
<code>gt</code>,
<code>apos</code>,
<code>quot</code>">
	<!ENTITY may "may">
	<!ENTITY MAY "<rfc2119>MAY</rfc2119>">
	<!ENTITY % local.common.att "xml:lang    CDATA  #IMPLIED">
]>
<?xml-stylesheet type="text/xsl" href="../shared/REC-xml.xsl"?>
<spec w3c-doctype="rec" xml:lang="en">
	<!--
Notes on preparation of SPARQL 1.1
	
-->
	<header>
		<title>SPARQL 1.1 Protocol for RDF</title>
		<w3c-designation>&doc.ident;</w3c-designation>
		<w3c-doctype>Editor's Draft</w3c-doctype>
		<pubdate>
			<day>&draft.day;</day>
			<month>&draft.month.name;</month>
			<year>&draft.year;</year>
		</pubdate>
		<publoc>
			<loc href="&this.version;/">&this.version;/</loc>
		</publoc>
        <!--
		<altlocs>
			<loc href="&amp;xml.version;">XML</loc>
			<loc href="&pdf.version;">PDF</loc>
			<loc href="&amp;review.version;">XHTML with color-coded revision indicators</loc>
		</altlocs>
        -->
		<latestloc>
			<loc href="http://www.w3.org/TR/&doc.shortname;/">http://www.w3.org/TR/&doc.shortname;/</loc>
		</latestloc>
		<prevlocs>
			<!--
				@@FPWD loc
				href="http://www.w3.org/TR/2009/WD-rdf-sparql-protocol-20090915/">http://www.w3.org/TR/2009/WD-rdf-sparql-protocol-20090915/</loc
			-->
			<loc href="http://www.w3.org/TR/2008/REC-rdf-sparql-protocol-20080115/">http://www.w3.org/TR/2008/REC-rdf-sparql-protocol-20080115/</loc>
		</prevlocs>
		<authlist>
			<author role="Editor">
				<name>Simon Johnston</name>
				<affiliation>IBM Corporation</affiliation>
				<email href="mailto:skjohn@us.ibm.com">skjohn@us.ibm.com</email>
			</author>
			<author role="Editor">
				<name>Lee Feigenbaum</name>
				<affiliation>Cambridge Semantics</affiliation>
				<email href="mailto:lee@thefigtrees.net">lee@thefigtrees.net</email>
			</author>
			<author role="PreviousEditor">
				<name>Kendall Grant Clark, 1st Edition</name>
				<affiliation>Clark &amp; Parsia LLC</affiliation>
				<email href="mailto:kendall@monkeyfist.com">kendall@monkeyfist.com</email>
			</author>
			<author role="PreviousEditor">
				<name>Elias Torres, 1st Edition</name>
				<affiliation>IBM Corporation</affiliation>
				<email href="mailto:eliast@us.ibm.com">eliast@us.ibm.com</email>
			</author>

		</authlist>
        <!--
		<errataloc href="&amp;errataloc;"/>
		<preverrataloc href="&amp;preverrataloc;"/>
		<translationloc href="&amp;translationloc;"/>
        -->
		<abstract>
<p>
The SPARQL Protocol and RDF Query Language (<acronym title="SPARQL Protocol And RDF Query Language" >SPARQL</acronym>) is a
query language and protocol for <a href="http://www.w3.org/RDF/">RDF</a>. This document specifies the SPARQL Protocol; it
uses <a href="http://www.w3.org/TR/wsdl20/">WSDL 2.0</a> to describe a means for conveying SPARQL queries to an SPARQL query
processing service and returning the query results to the entity that requested them. This protocol was developed by
the <a href="http://www.w3.org/2009/sparql/wiki/Main_Page">W3C SPARQL Working Group</a>, part of
the <a href="http://www.w3.org/2001/sw/">Semantic Web Activity</a> as described in
the <a href="http://www.w3.org/2001/sw/Activity">activity statement</a> .
</p>
		</abstract>
		<status>
<p>
<em>This section describes the status of this document at the time of its publication. Other documents may supersede this
document. A list of current W3C publications and the latest revision of this technical report can be found in
the <a href="http://www.w3.org/TR/">W3C technical reports index</a> at http://www.w3.org/TR/.</em>
</p>
<p>
This is a <a href="http://www.w3.org/2005/10/Process-20051014/tr.html#RecsWD">Editors' Working Draft</a>.
</p>
<p>
Comments on this document should be sent
to <a href="mailto:public-rdf-dawg-comments@w3.org">public-rdf-dawg-comments@w3.org</a>, a mailing list with
a <a href="http://lists.w3.org/Archives/Public/public-rdf-dawg-comments">public archive</a>. Questions and comments about
SPARQL that are not related to this specification, including extensions and features, can be discussed on the mailing
list <a href="mailto:public-sparql-dev@w3.org">public-sparql-dev@w3.org</a>,
(<a href="http://lists.w3.org/Archives/Public/public-sparql-dev">public archive</a>).
</p>
<p>
This document was produced by the <a href="http://www.w3.org/2001/sw/DataAccess/">SPARQL Working Group</a>, which is part
of the <a href="http://www.w3.org/2001/sw/Activity">W3C Semantic Web Activity</a>.
</p>
<p>
This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5
February 2004 W3C Patent Policy</a>. W3C maintains a <a rel="disclosure"
href="http://www.w3.org/2004/01/pp-impl/35463/status">public list of any patent disclosures</a> made in connection with the
deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual
knowledge of a patent which the individual believes
contains <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the
information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the
W3C Patent Policy</a>.
</p>
		</status>
		<pubstmt>
			<p>@@@ World-Wide Web Consortium, SPARQL Working Group, 2009.</p>
		</pubstmt>
		<sourcedesc>
			<p>Created in electronic form.</p>
		</sourcedesc>
		<langusage>
			<language id="EN">English</language>
			<language id="ebnf">Extended Backus-Naur Form (formal grammar)</language>
		</langusage>
		<revisiondesc>
			<p role="cvsid">$Id: Overview.xml,v 1.12 2009/10/21 02:25:37 lfeigenb Exp $</p>
		</revisiondesc>

	</header>


	<body>
    		<div1 id="intro">
			<head>Introduction</head>
<p>
This document (which refers to itself as "SPARQL 1.1 Protocol for RDF") describes the SPARQL Protocol, a means of conveying SPARQL
queries and updates from clients to query processors. SPARQL Protocol has been designed for compatibility with
the <a href="http://www.w3.org/2009/sparql/docs/query-1.1/">SPARQL 1.1 Query Language for RDF</a> [SPARQL] and with the <a href="http://www.w3.org/TR/sparql11-update/">SPARQL 1.1 Update Language for RDF</a>. SPARQL Protocol is described in
two ways: first, as an abstract interface independent of any concrete realization, implementation, or binding to another
protocol; second, as HTTP bindings of this interface. This document, as well as the associated WSDL and W3C XML Schema
documents, are primarily intended for software developers interested in implementing SPARQL query and update services and clients.
</p>
<p>
When this document uses the words <strong>must</strong>,
<strong>must not</strong>, <strong>should</strong>, <strong>should not</strong>, <strong>may</strong>
and <strong>recommended</strong>, and the words appear as emphasized text, they must be interpreted as described
in <a href="http://www.faqs.org/rfcs/rfc2119.html">RFC 2119</a> [RFC2119].
</p>
<p>
When this document contains excerpts from other documents, including WSDL and XML Schema instances, it uses the following
namespace prefixes and namespace URIs:
</p>
    <table border="0" width="50%">
        <tr>
            <th>Prefix</th>
            <th>Namespace URI</th>
        </tr>   
        <tr>
            <td><code>st</code></td>
            <td><code>http://www.w3.org/2005/09/sparql-protocol-types/#</code></td>
        </tr>
        <tr>
            <td><code>xs</code></td>
            <td><code>http://www.w3.org/2001/XMLSchema</code></td>
        </tr>
        <tr>
            <td><code>vbr</code></td>
            <td><code>http://www.w3.org/2005/sparql-results#</code></td>
        </tr>
        <tr>
            <td><code>rdf</code></td>
            <td><code>http://www.w3.org/1999/02/22-rdf-syntax-ns#</code></td>
        </tr>
        <tr>
            <td><code>whttp</code></td>
            <td><code>http://www.w3.org/2006/01/wsdl/http</code></td>
        </tr>
        <tr>
            <td><code>wsoap</code></td>
            <td><code>http://www.w3.org/2006/01/wsdl/soap</code></td>
        </tr>
        <tr>
            <td><code>soap</code></td>
            <td><code>http://www.w3.org/2003/05/soap-envelope</code></td>
        </tr>
        <tr>
            <td><code>wsdlx</code></td>
            <td><code>http://www.w3.org/2005/08/wsdl-extensions</code></td>
        </tr>
        <tr>
            <td><code>tns</code></td>
            <td><code>http://www.w3.org/2005/08/sparql-protocol-query/#</code></td>
        </tr>
    </table>

		</div1>
    		<div1 id="protocol">
			<head>SPARQL Protocol</head>
<p>
This set of documents comprises the specification of the SPARQL Protocol:
</p>
<dl>
	<dt>SPARQL 1.1 Protocol for RDF</dt>
	<dd>The current document which normatively specifies the SPARQL 1.1 Protocol for RDF in human-readable language.</dd>
	
	<dt><a href="http://www.w3.org/2009/sparql/docs/protocol-1.1/protocol-query.wsdl">SPARQL 1.1 Protocol for RDF WSDL 2.0 Description</a></dt>
		<dd>The normative description of the SPARQL Protocol using WSDL 2.0.</dd>

	<dt><a href="http://www.w3.org/2009/sparql/docs/protocol-1.1/protocol-types.xsd">SPARQL 1.1 Protocol for RDF Types</a></dt>
	<dd>The XML Schema document that normatively defines the types used in SPARQL Protocol.</dd>
</dl>
<p>
SPARQL Protocol contains one interface, <code>SparqlProtocol</code>, which in turn contains two operations, XXQUERYXX and
XXUPDATEXX. SPARQL
Protocol is <a href="http://www.w3.org/2009/sparql/docs/protocol-1.1/protocol-query.wsdl">described abstractly</a>
with <a href="http://www.w3.org/TR/wsdl20/">WSDL 2.0</a> [WSDL2] in terms of a web service that implements its interface, types,
faults, and operations, as well as by HTTP bindings. Note that while this document uses WSDL 2.0 to describe SPARQL
Protocol, there is no obligation on the part of any implementation to use any particular implementation strategy, including the
use of any WSDL library or programming language framework.
</p>
   
    			<div2 id="SparqlProtocol">
				<head>SparqlProtocol Interface</head>
   
<p>
<code>SparqlProtocol</code> is the protocol's only interface.  It contains two operations, the first of which is XXQUERYXX, and is used to convey
a <a href="http://www.w3.org/2001/sw/DataAccess/rq23/#defn_SPARQLquery">SPARQL query string</a> and, optionally,
an <a href="http://www.w3.org/2001/sw/DataAccess/rq23/#rdfDataset">RDF dataset</a> description. Secondly the XXUPDATEXX operation is
used to convey a <a href="?">SPARQL update string</a>.
</p>

<div class="excerpt">
<pre>
&lt;!-- Abstract SparqlProtocol Interface -->
&lt;interface name="<b>SparqlProtocol</b>" styleDefault="<b>http://www.w3.org/2006/01/wsdl/style/iri</b>">

   &lt;!-- the Interface Faults -->
   &lt;fault name="<b>MalformedQuery</b>" element="<b>st:malformed-query</b>"/>
   &lt;fault name="<b>QueryRequestRefused</b>" element="<b>st:query-request-refused</b>"/>

   &lt;!-- the Query Operation -->
   &lt;operation name="<b>query</b>" pattern="<b>http://www.w3.org/2006/01/wsdl/in-out</b>">

      &lt;documentation>The operation is used to convey queries and their results from clients to services and back
      again.&lt;/documentation>

      &lt;input messageLabel="<b>In</b>" element="<b>st:query-request</b>"/>
      &lt;output messageLabel="<b>Out</b>" element="<b>st:query-result</b>"/>

      &lt;!-- the interface faults are out faults -->
      &lt;outfault ref="tns:MalformedQuery" messageLabel="Out"/>
      &lt;outfault ref="tns:QueryRequestRefused" messageLabel="Out"/>
   &lt;/operation>

   &lt;!-- the Update Operation -->
   &lt;operation name="<b>update</b>" pattern="<b>http://www.w3.org/2006/01/wsdl/in-out</b>">

      &lt;documentation>The operation is used to insert or update RDF data.&lt;/documentation>

      &lt;input messageLabel="<b>In</b>" element="<b>st:update-request</b>"/>
      &lt;output messageLabel="<b>Out</b>" element="<b>st:update-result</b>"/>

      &lt;!-- the interface faults are out faults -->
      &lt;outfault ref="tns:MalformedRequest" messageLabel="Out"/>
      &lt;outfault ref="tns:RequestRefused" messageLabel="Out"/>
   &lt;/operation>

&lt;/interface>
</pre>
</div>

<p class="capt"><a name="excerpt-1.0">Excerpt 1.0 WSDL 2.0 fragment</a></p>


    				<div3 id="query-operation">
					<head>XXQUERYXX operation</head>

<p>
The XXQUERYXX operation is described as an <a href="http://www.w3.org/TR/wsdl20-adjuncts/#in-out">In-Out
message exchange pattern</a> [WSDL-Adjuncts]. The constraints of an In-Out message exchange pattern are as follows:
</p>

<blockquote>
	<p>
	This pattern consists of exactly two messages, in order, as
	follows:
	</p>
    <ol>
		<li>
	  		<p>A message:</p>
	  		<ul>
	    		<li>
	      			<p>
	      			indicated by a Interface Message Reference component whose {message label} is "In" and {direction} is "in"
	      			</p>
	    		</li>
	    		<li>
	      			<p>received from some node N</p>
	    		</li>
	  		</ul>
		</li>
		<li>
	  		<p>A message:</p>	  
	  		<ul>
	    		<li>
	      			<p>
	      			indicated by a Interface Message Reference component whose {message label} is "Out" and {direction} is "out"
	      			</p>
	    		</li>
	    		<li>
	      			<p>sent to node N</p>
	    		</li>
		  	</ul>
		</li>
	</ol>
    <p>
    This pattern uses the rule <a href="http://www.w3.org/TR/wsdl20-adjuncts/#fault-replacement"><b>@@sec@@ Fault
    Replaces Message</b></a>.
    </p>
</blockquote>

				<div4 id="query-In-Message">
					<head>XXQUERYXX In Message</head>

<p>
Abstractly, the contents of the In Message of <code>SparqlProtocol</code>'s XXQUERYXX operation is an
instance of an XML Schema complex type, called <code>st:query-request</code> in Excerpt 1.0, composed of two further
parts: one <a href="http://www.w3.org/2001/sw/DataAccess/rq23/#grammar">SPARQL query string</a>; and zero or one <a
href="http://www.w3.org/2001/sw/DataAccess/rq23/#rdfDataset">RDF dataset</a> descriptions. The SPARQL query string,
identified by one XXQUERYXX type, is <a href="http://www.w3.org/2009/sparql/docs/query-1.1/#grammar">defined</a> by
[SPARQL] as "a sequence of characters in the language defined by the [SPARQL] grammar, starting with the Query
production". The RDF dataset description is composed of zero or one default RDF graphs &#8212; composed by the RDF
merge of the RDF graphs identified by zero or more <code>default-graph-uri</code> types &#8212; and by zero or more
named RDF graphs, identified by zero or more <code>named-graph-uri</code> types. These correspond to the
<code>FROM</code> and <code>FROM NAMED</code> keywords in [SPARQL], respectively.
</p>
<p>
These types are defined in the following XML Schema fragment, from <a
href="http://www.w3.org/2007/SPARQL/protocol-types.xsd">protocol-types.xsd</a>:
</p>

<div class="excerpt"><pre>&lt;xs:element name="<b>query-request</b>">
  &lt;xs:complexType>
    &lt;xs:sequence>
      &lt;xs:element minOccurs="1" maxOccurs="1" name="<b>query</b>" type="xs:string">
       &lt;xs:annotation>
	      &lt;xs:documentation>query is an xs:string constrained by the language definition,
         http://www.w3.org/TR/rdf-sparql-query/#grammar, as "a sequence of characters in 
         the language defined by the [SPARQL] grammar, starting with the Query production".&lt;/xs:documentation>
       &lt;/xs:annotation>
      &lt;/xs:element>
      &lt;xs:element minOccurs="0" maxOccurs="unbounded" name="<b>default-graph-uri</b>" type="xs:anyURI"/>
      &lt;xs:element minOccurs="0" maxOccurs="unbounded" name="<b>named-graph-uri</b>" type="xs:anyURI"/>
    &lt;/xs:sequence>
  &lt;/xs:complexType>
&lt;/xs:element></pre></div>

<p class="capt"><a name="excerpt-1.1">Excerpt 1.1 XML Schema fragment</a></p>


      					<div5 id="specify-dataset">
						<head>Specifying an RDF Dataset</head>

<p>
The RDF dataset may be specified either in a [SPARQL] query using <code>FROM</code> and <code>FROM NAMED</code>
keywords; or it may be specified in the protocol described in this document; or it may be specified in both the query
string and in the protocol.
</p>

					</div5>
    					<div5 id="resolve-dataset">
						<head>Resolving an Ambiguous RDF Dataset</head>

<p>
In the case where both the query and the protocol specify an RDF dataset, but not the identical RDF dataset, the dataset
specified in the protocol <strong>must</strong> be the RDF dataset consumed by <code>SparqlProtocol</code>'s XXQUERYXX operation.
</p>

					</div5>
					<div5 id="reject-dataset">
						<head>Rejecting Query Requests to RDF Datasets</head>

<p>
A <a href="#conformant-sparql-protocol-service">conformant SPARQL Protocol service</a> <strong>may</strong> provide a default RDF
dataset against which SPARQL query requests are executed in cases where there is no RDF dataset specified in the protocol or in the
query request. A <a href="#conformant-sparql-protocol-service">conformant SPARQL Protocol service</a>
<strong>may</strong> refuse to process any query request that does not specify an RDF dataset. Finally, a <a
href="#conformant-sparql-protocol-service">conformant SPARQL Protocol</a> service <strong>may</strong> refuse to process any
query request against any specified RDF dataset. See @@sec@@ XXQUERYXX Fault Messages, <a
href="#query-req-refused-fault"><code>QueryRequestRefused</code></a>.
</p>

					</div5>
					<div5 id="base-iri">
						<head>Determining the Base IRI</head>

<p>
The <code>BASE</code> keyword in the query string defines the Base IRI used to resolve relative IRIs
per <a href="http://www.ietf.org/rfc/rfc3986.txt">Uniform Resource Identifier (URI): Generic Syntax</a>
[<a href="#rfc3986">RFC3986</a>] section 5.1.1, "Base URI Embedded in Content". Section 5.1.2, "Base URI from the Encapsulating
Entity" defines how the Base IRI may come from an encapsulating document, such as a SOAP envelope with an xml:base directive. The
SPARQL Protocol does not dereference query URIs so section 5.1.3 does not apply.  Finally, per section 5.1.4, SPARQL Protocol
services must define their own base URI, which <strong>may</strong> be the service invocation URI.
</p>

					</div5>
				</div4>
				<div4 id="query-out-message">
					<head>XXQUERYXX Out Message</head>

<p>
Abstractly, the contents of the Out Message of <code>SparqlProtocol</code>'s XXQUERYXX operation is an
instance of an XML Schema complex type, called <code>query-result</code> in Excerpt 1.2, composed of either:
</p>

<ol>
	<li>
	a <a href="http://www.w3.org/2001/sw/DataAccess/rf1/#defn-srd">SPARQL Results Document</a> [SRD] (for SPARQL 
	Query for RDF query forms <a href="http://www.w3.org/2001/sw/DataAccess/rq23/#select">SELECT</a>
	and <a href="http://www.w3.org/2001/sw/DataAccess/rq23/#ask">ASK</a>); or,
	</li>
	<li>
	an RDF graph [RDF-Concepts] serialized, for example, in the <a href="http://www.w3.org/TR/rdf-syntax-grammar/">RDF/XML
  	syntax</a> [RDF-Syntax], or an equivalent RDF graph serialization, for SPARQL Query for RDF query forms
	<a href="http://www.w3.org/2001/sw/DataAccess/rq23/#describe">DESCRIBE</a> and 
	<a href="http://www.w3.org/2001/sw/DataAccess/rq23/#construct">CONSTRUCT</a>).
	</li>
</ol>

<p>
The <code>query-result</code> type is defined in this W3C XML Schema fragment, from <a
href="http://www.w3.org/2007/SPARQL/protocol-types.xsd">protocol-types.xsd</a>:
</p>

<div class="excerpt"><pre>&lt;xs:element name="<b>query-result</b>">
      &lt;xs:annotation>
          &lt;xs:documentation>The type for serializing query results,
          either as XML or RDF/XML.&lt;/xs:documentation>
      &lt;/xs:annotation>
      &lt;xs:complexType>
          &lt;xs:choice>
              &lt;xs:element maxOccurs="1" ref="<b>vbr:sparql</b>"/>
              &lt;xs:element maxOccurs="1" ref="<b>rdf:RDF</b>"/>
          &lt;/xs:choice>
      &lt;/xs:complexType>
&lt;/xs:element></pre></div>

<p class="capt"><a name="excerpt-1.2">Excerpt 1.2 XML Schema fragment</a></p>

				   </div4>
				</div3>

				<div3 id="update-operation">
					<head>XXUPDATEXX operation</head>
				
<p>
The XXQUERYXX operation is described as an <a href="http://www.w3.org/TR/wsdl20-adjuncts/#in-out">In-Out
message exchange pattern</a>.
</p>
				<div4 id="update-In-Message">
					<head>XXUPDATEXX In Message</head>				
<p>
Abstractly, the contents of the In Message of <code>SparqlProtocol</code>'s XXUPDATEXX operation is an
instance of an XML Schema complex type, called <code>st:update-request</code>, composed of two further
parts: one <a href="http://www.w3.org/2009/sparql/docs/update-1.1/#sec_grammar">SPARQL update string</a>; and zero or one <a
href="http://www.w3.org/2001/sw/DataAccess/rq23/#rdfDataset">RDF dataset</a> descriptions. The SPARQL update string,
identified by one XXUPDATEXX type, is <a href="http://www.w3.org/2009/sparql/docs/query-1.1/#grammar">defined</a> by
[SPARQL] as "a sequence of characters in the language defined by the [SPARQLUpdate] grammar, starting with the SPARQLUpdate
production". The RDF dataset description is composed of zero or one default RDF graphs &#8212; composed by the RDF
merge of the RDF graphs identified by zero or more <code>default-graph-uri</code> types &#8212; and by zero or more
named RDF graphs, identified by zero or more <code>named-graph-uri</code> types. These correspond to the
<code>INTO</code>, <code>FROM</code> and <code>FROM NAMED</code> keywords in [SPARQLUpdate], respectively.
</p>
				</div4>
				<div4 id="update-Out-Message">
					<head>XXUPDATEXX Out Message</head>				
<p>
Abstractly, the contents of the Out Message of <code>SparqlProtocol</code>'s XXUPDATEXX operation is an
instance of an XML Schema complex type, called <code>update-result</code>.
</p>
<p>
Details TBD.
</p>
				</div4>
</div3>
				<div3 id="fault-messages">
					<head>Fault Messages</head>

<p>
[WSDL2-Adjuncts] defines several fault propagation rules which specify how operation faults and messages interact. The XXQUERYXX
operation employs the <a href="http://www.w3.org/TR/wsdl20-adjuncts/#fault-replacement">Fault Replaces Message</a> rule:
</p>

<blockquote>
Any message after the first in the pattern <strong>may</strong> be replaced with a fault message, which
<strong>must</strong> have identical direction. The fault message <strong>must</strong> be delivered to the same target node
as the message it replaces, unless otherwise specified by an extension or binding extension. If there is no path to this
node, the fault <strong>must</strong> be discarded.
</blockquote>

<p>
Thus, the XXQUERYXX operation contained in the <code>SparqlProtocol</code> interface may return, in place of
the <a href="#query-out-message">Out Message</a>, either the <code>MalformedQuery</code> message or the
<code>QueryRequestRefused</code> message, both of which are defined in this XML Schema fragment from <a
href="http://www.w3.org/2007/SPARQL/protocol-types.xsd">protocol-types.xsd</a>:
</p>

<div class="excerpt"><pre>&lt;xs:element type="xs:string" name="<b>fault-details</b>">
    &lt;xs:annotation>
      &lt;xs:documentation> This element contains human-readable information about the fault
        returned by the SPARQL query processing service.&lt;/xs:documentation>
    &lt;/xs:annotation>
  &lt;/xs:element>
    &lt;xs:element name="<b>malformed-query</b>">
      &lt;xs:complexType>
          &lt;xs:all>&lt;xs:element minOccurs="0" maxOccurs="1" ref="<b>st:fault-details</b>"/>&lt;/xs:all>
      &lt;/xs:complexType>
  &lt;/xs:element>
  &lt;xs:element name="<b>query-request-refused</b>">
      &lt;xs:complexType>
          &lt;xs:all>&lt;xs:element minOccurs="0" maxOccurs="1" ref="<b>st:fault-details</b>"/>&lt;/xs:all>
      &lt;/xs:complexType>
&lt;/xs:element></pre>
</div>

<p class="capt"><a name="excerpt-1.3">Excerpt 1.3 XML Schema fragment</a></p>


					<div4 id="malformed-query-fault">
						<head>MalformedQuery</head>

<p>
When the value of the XXQUERYXX type is not a legal sequence of characters in the language defined by the SPARQL grammar,
the <code>MalformedQuery</code> or <code>QueryRequestRefused</code> fault message <strong>must</strong> be returned. According
to the <a href="#fault-messages">Fault Replaces Message Rule</a>, if a WSDL fault is returned,
including <code>MalformedQuery</code>, an <a href="#query-out-message">Out Message</a> <strong>must not</strong> be
returned.
</p>

<p>
When the <code>MalformedQuery</code> fault message is returned, query processing services <strong>must</strong> include
explanatory, debugging, or other additional information for human consumption via the
<code>fault-details</code> type defined in Excerpt 1.3.
</p>

					</div4>
					<div4 id="query-req-refused-fault">
						<head>QueryRequestRefused</head>

<p>
This WSDL fault message <strong>should</strong> be returned when a client submits a request that the service refuses to
process. The <code>QueryRequestRefused</code> fault message neither indicates whether the server may or may not process a
subsequent, identical request or requests, nor does it constrain a <a href="#conformant-sparql-protocol-service">conformant
SPARQL service</a> from returning other HTTP status codes or HTTP headers as appropriate given the semantics of [HTTP].
</p>

<p>
When the <code>QueryRequestRefused</code> fault message is returned, query processing services <strong>must</strong> include
explanatory, debugging, or other additional information intended for human consumption via the
<code>fault-details</code> type defined in Excerpt 1.3.
</p>

					</div4>
				</div3>

			</div2>
			<div2 id="query-bindings-http">
				<head>HTTP Bindings</head>

<p>
The <code>SparqlProtocol</code> interface operations described thus far (XXQUERYXX and XXUPDATE) are abstract operations; they requires protocol
bindings to become invocable operations. This next section of this document describes HTTP 
bindings for these operations. A <a href="#conformant-sparql-protocol-service">conformant SPARQL Protocol service</a> <strong>must</strong> support
the <code>SparqlProtocol</code> interface; if a SPARQL Protocol service supports HTTP bindings, it
<strong>must</strong> support the bindings as described in <a
href="http://www.w3.org/2009/sparql/docs/protocol-1.1/protocol-query.wsdl">protocol-query.wsdl</a>. A SPARQL Protocol service <strong>may</strong> support
other interfaces. 
</p>

        <div3 id="http-bindings-query">
        <head>HTTP Bindings for SPARQL Query</head>
<p>
[WSDL2-Adjuncts] defines a means of binding abstract interface operations to HTTP. The HTTP bindings for the
XXQUERYXX operation (from <a href="http://www.w3.org/2009/sparql/docs/protocol-1.1/protocol-query.wsdl">protocol-query.wsdl</a>) are as follows:
</p>

<div class="excerpt">
<pre>&lt;!-- the HTTP GET binding for query operation --&gt;
 &lt;binding name="<b>queryHttpGet</b>" interface="tns:SparqlProtocol" 
	    type="http://www.w3.org/2006/01/wsdl/http"
	    whttp:version="1.1">

   &lt;fault ref="tns:MalformedQuery" whttp:code="400"/>
   &lt;fault ref="tns:QueryRequestRefused" whttp:code="500"/>

   &lt;operation ref="tns:query"
        wsdlx:safe="true"
		whttp:method="<b>GET</b>"
		whttp:faultSerialization="<b>*/*</b>"
		whttp:inputSerialization="<b>application/x-www-form-urlencoded</b>"
		whttp:outputSerialization="<b>application/sparql-results+xml, application/rdf+xml, */*</b>" />
 &lt;/binding>

 &lt;!-- the HTTP POST binding for query operation --&gt;
 &lt;binding name="<b>queryHttpPost</b>" interface="tns:SparqlProtocol"
		 type="http://www.w3.org/2006/01/wsdl/http"
		 whttp:version="1.1">
		
	  &lt;fault ref="tns:MalformedQuery" whttp:code="400"/>
	  &lt;fault ref="tns:QueryRequestRefused" whttp:code="500"/>
		
   &lt;operation ref="tns:query" 
        wsdlx:safe="true"
 		whttp:method="<b>POST</b>" 
		whttp:faultSerialization="<b>*/*</b>"
		whttp:inputSerialization="<b>application/x-www-form-urlencoded, application/xml</b>"
		whttp:outputSerialization="<b>application/sparql-results+xml, application/rdf+xml, */*</b>" />	
 &lt;/binding></pre>
 </div>

<p>
There are two HTTP bindings, <code>queryHttpGet</code> and <code>queryHttpPost</code>, both of which are described as bindings of
the <code>SparqlProtocol</code> interface. In each of these bindings, the two faults described
in <a href="#SparqlProtocol">SparqlProtocol </a> interface, <code>MalformedQuery</code> and <code>QueryRequestRefused</code>, are bound
to <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">HTTP status codes</a> <code>400 Bad Request</code> and
<code>500 Internal Server Error</code>, respectively [HTTP].
</p>

<p>
The <code>queryHttpGet</code> binding <strong>should</strong> be used except in cases where the URL-encoded query exceeds
practical limits, in which case the <code>queryHttpPost</code> binding <strong>should</strong> be used.
</p>

<p>
<strong>An Informative Note About Serialization Constraints.</strong> The output serialization of the
<code>queryHttpGet</code> and <code>queryHttpPost</code> bindings is intentionally under constrained in order to reflect the
variety of serialization types of RDF graphs. The fault serialization of <code>queryHttpGet</code> and
<code>queryHttpPost</code> is also intentionally under constrained. A <a
href="#conformant-sparql-protocol-service">conformant SPARQL Protocol service</a> can provide alternative WSDL interfaces
and bindings with different constraints.
</p>

					<div4 id="query-http-get-binding">
						<head>queryHttpGet</head>

<p>
This binding of the XXQUERYXX operation uses [HTTP] <code>GET</code> with the following serialization type constraints: the value
of <code>whttp:faultSerialization</code> is <code>*/*</code>; second, the value of
<code>whttp:inputSerialization</code> is <code>application/x-www-form-urlencoded</code> with UTF-8 encoding; and,
third, the <code>whttp:outputSerialization</code> is <code>application/sparql-results+xml</code> with UTF-8 encoding,
<code>application/rdf+xml</code> with UTF-8 encoding, and <code>*/*</code>. 
</p>

					</div4>
					<div4 id="query-http-post-binding">
						<head>queryHttpPost</head>

<p>
This binding of the XXQUERYXX operation uses [HTTP] <code>POST</code> with the following serialization type constraints: the
value of <code>whttp:faultSerialization</code> is <code>*/*</code>; second, the value of
<code>whttp:inputSerialization</code> is <code>application/x-www-form-urlencoded</code> with UTF-8 encoding and
<code>application/xml</code> with UTF-8 encoding; and, third, the <code>whttp:outputSerialization</code> is
<code>application/sparql-results+xml</code> with UTF-8 encoding, <code>application/rdf+xml</code> with UTF-8 encoding, and
<code>*/*</code>. 
</p>

					</div4>
				<div4 id="query-bindings-http-examples">
					<head>HTTP Examples for SPARQL Query</head>

<p>
The following abstract HTTP trace examples illustrate invocation of the XXQUERYXX operation under several different
scenarios. These example traces are abstracted from complete HTTP traces in three ways: (1) In each example the string
"<i>EncodedQuery</i>" represents the URL-encoded string equivalent of the SPARQL query given in the first block of each example; (2)
only partial response bodies, containing the query results, are displayed; (3) the URI values of <code>default-graph-uri</code>
and <code>named-graph-uri</code> are also not URL-encoded.
</p>

					<div5 id="select-svcsupplied">
						<head>SELECT with service-supplied RDF dataset</head>

<p>This SPARQL query</p>
<div id="div-select-svcsupplied">
<pre class="query">PREFIX dc: &lt;http://purl.org/dc/elements/1.1/> 
SELECT ?book ?who 
WHERE { ?book dc:creator ?who }</pre>

<p>is conveyed to the SPARQL query
service, <tt>http://www.example/sparql/</tt>, as illustrated in this
HTTP trace:</p>

<pre class="req">GET /sparql/?<b>query</b>=<i>EncodedQuery</i> HTTP/1.1
Host: www.example
User-agent: my-sparql-client/0.1</pre>

<p>That query against the service-supplied RDF dataset, executed by
that SPARQL query service, returns the following query result:</p>

<pre class="resp">HTTP/1.1 200 OK
Date: Fri, 06 May 2005 20:55:12 GMT
Server: Apache/1.3.29 (Unix) PHP/4.3.4 DAV/1.0.3
Connection: close
Content-Type: application/sparql-results+xml

&lt;?xml version="1.0"?>
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#">

 &lt;head>
   &lt;variable name="book"/>
   &lt;variable name="who"/>
 &lt;/head>
 &lt;results distinct="false" ordered="false">
   &lt;result>
     &lt;binding name="book">&lt;uri>http://www.example/book/book5&lt;/uri>&lt;/binding>
     &lt;binding name="who">&lt;bnode>r29392923r2922&lt;/bnode>&lt;/binding>
   &lt;/result>
...<span class="hide">
   &lt;result>
     &lt;binding name="book">&lt;uri>http://www.example/book/book6&lt;/uri>&lt;/binding>
     &lt;binding name="who">&lt;bnode>r8484882r49593&lt;/bnode>&lt;/binding>
   &lt;/result>
 &lt;/results></span>
&lt;/sparql> </pre>
</div>

					</div5>
					<div5 id="select-simple">
						<head>SELECT with simple RDF dataset</head>

<p>This SPARQL query</p>
<div id="div-select-simple">
<pre class="query">PREFIX dc: &lt;http://purl.org/dc/elements/1.1/> 
SELECT ?book ?who 
WHERE { ?book dc:creator ?who }</pre>

<p>is conveyed to the SPARQL query
service, <tt>http://www.other.example/sparql/</tt>, as illustrated in
this HTTP trace:</p>

<pre class="req">GET /sparql/?<b>query</b>=<i>EncodedQuery</i>&amp;<b>default-graph-uri</b>=http://www.other.example/books HTTP/1.1
Host: www.other.example
User-agent: my-sparql-client/0.1
</pre>

<p>That query &#8212; against the RDF dataset identified by the value
  of the <code>default-graph-uri</code>
  parameter, <tt>http://www.other.example/books</tt> &#8212; executed
  by that SPARQL query service, returns the following query
  result:</p>

<pre class="resp">HTTP/1.1 200 OK
Date: Fri, 06 May 2005 20:55:12 GMT
Server: Apache/1.3.29 (Unix) PHP/4.3.4 DAV/1.0.3
Connection: close
Content-Type: application/sparql-results+xml

&lt;?xml version="1.0"?>
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#">
 &lt;head>
   &lt;variable name="book"/>
   &lt;variable name="who"/>
 &lt;/head>
...<span class="hide">
 &lt;results distinct="false" ordered="false">
   &lt;result>
     &lt;binding name="book">&lt;uri>http://www.example/book/book2&lt;/uri>&lt;/binding>
     &lt;binding name="who">&lt;bnode>r1115396427r1133&lt;/bnode>&lt;/binding>
   &lt;/result>
   &lt;result>
     &lt;binding name="book">&lt;uri>http://www.example/book/book3&lt;/uri>&lt;/binding>
     &lt;binding name="who">&lt;bnode>r1115396427r1133&lt;/bnode>&lt;/binding>
   &lt;/result>
   &lt;result>
     &lt;binding name="book">&lt;uri>http://www.example/book/book1&lt;/uri>&lt;/binding>
     &lt;binding name="who">&lt;literal>J.K. Rowling&lt;/literal>&lt;/binding>
   &lt;/result>
 &lt;/results></span>
&lt;/sparql> </pre>
</div>

					</div5>
					<div5 id="construct-simple">
						<head>CONSTRUCT with simple RDF
    dataset and HTTP content negotiation</head>

<p>This SPARQL query</p>
<div id="div-construct-simple">
<pre class="query">PREFIX rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/>
PREFIX myfoaf: &lt;http://www.example/jose/foaf.rdf#>

CONSTRUCT { myfoaf:jose foaf:depiction &lt;http://www.example/jose/jose.jpg>.
            myfoaf:jose foaf:schoolHomepage &lt;http://www.edu.example/>.
            ?s ?p ?o.}
WHERE { ?s ?p ?o. myfoaf:jose foaf:nick "Jo".
       FILTER ( ! (?s = myfoaf:kendall &amp;&amp; ?p = foaf:knows &amp;&amp; ?o = myfoaf:edd ) 
              &amp;&amp; ! ( ?s = myfoaf:julia &amp;&amp; ?p = foaf:mbox &amp;&amp; ?o = &lt;mailto:julia@mail.example> )
	      &amp;&amp; ! ( ?s = myfoaf:julia &amp;&amp; ?p = rdf:type &amp;&amp; ?o = foaf:Person))
}</pre>

<p>is conveyed to the SPARQL query
service, <tt>http://www.example/sparql/</tt>, as illustrated in this
HTTP trace:</p>

<pre class="req">GET /sparql/?<b>query</b>=<i>EncodedQuery</i>&amp;<b>default-graph-uri</b>=http://www.example/jose-foaf.rdf HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Accept: text/turtle, application/rdf+xml</pre>

<p>With the response illustrated here:</p>

<pre class="resp">HTTP/1.1 200 OK
Date: Fri, 06 May 2005 20:55:11 GMT
Server: Apache/1.3.29 (Unix)
Connection: close
Content-Type: text/turtle

@prefix rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix foaf: &lt;http://xmlns.com/foaf/0.1/>.
@prefix myfoaf: &lt;http://www.example/jose/foaf.rdf#>.

myfoaf:jose foaf:name "Jose Jime&#241;ez";
	    foaf:depiction &lt;http://www.example/jose/jose.jpg>;
            foaf:nick "Jo";
...<span class="hide">
	    foaf:schoolHomepage &lt;http://www.edu.example/>;
            foaf:workplaceHomepage &lt;http://www.corp.example/>;
            foaf:homepage &lt;http://www.example/jose/>;
            foaf:knows myfoaf:juan;
	    rdf:type foaf:Person.

myfoaf:juan foaf:mbox &lt;mailto:juan@mail.example>;
	   rdf:type foaf:Person.</span></pre>

<p><em>Note:</em> registration for the media type <tt>text/turtle</tt> was started but not completed at the time of this
publication. Please see <a href="http://www.w3.org/TeamSubmission/turtle">http://www.w3.org/TeamSubmission/turtle</a> for the final
registered media type for the Turtle language.</p>
</div>

					</div5>
					<div5 id="ask-simple">
						<head>ASK with simple RDF dataset</head>

<p>This SPARQL query</p>
<div id="div-ask-simple">
<pre class="query">PREFIX dc: &lt;http://purl.org/dc/elements/1.1/> 
ASK WHERE { ?book dc:creator "J.K. Rowling"}</pre>

<p>is conveyed to the SPARQL query
service, <tt>http://www.example/sparql/</tt>, as illustrated in this
HTTP trace:</p>

<pre class="req">GET /sparql/?<b>query</b>=<i>EncodedQuery</i>&amp;<b>default-graph-uri</b>=http://www.example/books HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
</pre>

<p>With the response illustrated here:</p>

<pre class="resp">HTTP/1.1 200 OK
Date: Fri, 06 May 2005 20:48:25 GMT
Server: Apache/1.3.29 (Unix) PHP/4.3.4 DAV/1.0.3
Connection: close
Content-Type: application/sparql-results+xml

&lt;?xml version="1.0"?>
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#">
 &lt;head>&lt;/head>
 &lt;boolean>true&lt;/boolean>
&lt;/sparql></pre>
</div>

					</div5>
					<div5 id="describe-simple">
						<head>DESCRIBE with simple RDF dataset</head>

<p>This SPARQL query</p>
<div id="div-describe-simple">
<pre class="query">PREFIX books: &lt;http://www.example/book/>
DESCRIBE books:book6</pre>

<p>is conveyed to the SPARQL query
service, <tt>http://www.example/sparql/</tt>, as illustrated here:</p>

<pre class="req">GET /sparql/?<b>query</b>=<i>EncodedQuery</i>&amp;<b>default-graph-uri</b>=http://www.example/books HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1</pre>

<p>With the response illustrated here:</p>

<pre class="resp">HTTP/1.1 200 OK
Date: Wed, 03 Aug 2005 12:48:25 GMT
Server: Apache/1.3.29 (Unix) PHP/4.3.4 DAV/1.0.3
Connection: close
Content-Type:  application/rdf+xml

&lt;?xml version="1.0"?>
&lt;rdf:RDF ...<span class="hide">
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:books="http://www.example/book/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"</span>
  &lt;rdf:Description rdf:about="http://www.example/book/book6">
    &lt;dc:title>Example Book #6 &lt;/dc:title>
  &lt;/rdf:Description>
&lt;/rdf:RDF></pre>
</div>

					</div5>
					<div5 id="select-complex">
						<head>SELECT with complex RDF dataset</head>

<p>This SPARQL query</p>
<div id="div-select-complex">
<pre class="query">PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/>
PREFIX dc: &lt;http://purl.org/dc/elements/1.1/>

SELECT ?who ?g ?mbox
WHERE {  ?g dc:publisher ?who .
   GRAPH ?g { ?x foaf:mbox ?mbox }
}</pre>

<p>is conveyed to the SPARQL query service, http://www.example/sparql/,
  as illustrated here (with line breaks for legibility):</p>

<pre class="req">GET /sparql/?<b>query</b>=<i>EncodedQuery</i>&amp;<b>default-graph-uri</b>=http://www.example/publishers
&amp;<b>default-graph-uri</b>=http://www.example/morepublishers&amp;<b>named-graph-uri</b>=http://your.example/foaf-alice
&amp;<b>named-graph-uri</b>=http://www.example/foaf-bob&amp;<b>named-graph-uri</b>=http://www.example/foaf-susan
&amp;<b>named-graph-uri</b>=http://this.example/john/foaf
Host: www.example
User-agent: sparql-client/0.1</pre>

<p>With the response illustrated here:</p>

<pre class="resp">HTTP/1.1 200 OK
Date: Wed, 03 Aug 2005 12:48:25 GMT
Server: Apache/1.3.29 (Unix) PHP/4.3.4 DAV/1.0.3
Connection: close
Content-Type:  application/sparql-results+xml

&lt;?xml version="1.0"?>
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#">
  &lt;head>
    &lt;variable name="who"/>
    &lt;variable name="g"/>
    &lt;variable name="mbox"/>
  &lt;/head>
...<span class="hide">
  &lt;results ordered="false" distinct="false">
    &lt;result>
      &lt;binding name="who">
        &lt;literal>Alice&lt;/literal>
      &lt;/binding>
      &lt;binding name="g">
        &lt;uri>http://your.example/foaf-alice&lt;/uri>
      &lt;/binding>
      &lt;binding name="mbox">
        &lt;uri>mailto:alice@example.org&lt;/uri>
      &lt;/binding>
    &lt;/result>
    &lt;result>
      &lt;binding name="who">
        &lt;literal>Bob&lt;/literal>
      &lt;/binding>
      &lt;binding name="g">
        &lt;uri>http://www.example/foaf-bob&lt;/uri>
      &lt;/binding>
      &lt;binding name="mbox">
        &lt;uri>mailto:bob@work.example&lt;/uri>
      &lt;/binding>
    &lt;/result>
    &lt;result>
      &lt;binding name="who">
        &lt;literal>Susan&lt;/literal>
      &lt;/binding>
      &lt;binding name="g">
        &lt;uri>http://www.example/foaf-susan&lt;/uri>
      &lt;/binding>
      &lt;binding name="mbox">
        &lt;uri>mailto:susan@work.example&lt;/uri>
      &lt;/binding>
    &lt;/result>
    &lt;result>
      &lt;binding name="who">
        &lt;literal>John&lt;/literal>
      &lt;/binding>
      &lt;binding name="g">
        &lt;uri>http://this.example/john/foaf&lt;/uri>
      &lt;/binding>
      &lt;binding name="mbox">
        &lt;uri>mailto:john@home.example&lt;/uri>
      &lt;/binding>
    &lt;/result>
  &lt;/results></span>
&lt;/sparql></pre></div>

					</div5>
					<div5 id="select-queryonly">
						<head> SELECT with query-only RDF dataset</head>

<p>This SPARQL query</p>

<div id="div-select-queryonly">
<pre class="query">PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/>
PREFIX dc: &lt;http://purl.org/dc/elements/1.1/>

SELECT ?who ?g ?mbox
FROM &lt;http://www.example/publishers>
FROM NAMED &lt;http://www.example/alice>
FROM NAMED &lt;http://www.example/bob>
WHERE { ?g dc:publisher ?who .
        GRAPH ?g { ?x foaf:mbox ?mbox }
}</pre>

<p>is conveyed to the SPARQL query service, <tt>http://www.example/sparql/</tt>, as illustrated in this
HTTP trace:</p>

<pre class="req">GET /sparql/?<b>query</b>=<i>EncodedQuery</i> HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1</pre>

<p>With the response illustrated here:</p>

<pre class="resp">HTTP/1.1 200 OK
Date: Wed, 03 Aug 2005 12:48:25 GMT
Server: Apache/1.3.29 (Unix) PHP/4.3.4 DAV/1.0.3
Connection: close
Content-Type: application/sparql-results+xml

&lt;?xml version="1.0"?>
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#">
...<span class="hide">
  &lt;head>
    &lt;variable name="who"/>
    &lt;variable name="g"/>
    &lt;variable name="mbox"/>
  &lt;/head>
  &lt;results ordered="false" distinct="false">
    &lt;result>
      &lt;binding name="who">
      	&lt;literal>Bob Hacker&lt;/literal>
      &lt;/binding>
      &lt;binding name="g">
	&lt;uri>http://www.example/bob&lt;/uri>
      &lt;/binding>
      &lt;binding name="mbox">
        &lt;uri>mailto:bob@oldcorp.example&lt;/uri>
      &lt;/binding>
    &lt;/result>
    &lt;result>
      &lt;binding name="who">
	&lt;literal>Alice Hacker&lt;/literal>
      &lt;/binding>
      &lt;binding name="g">
	&lt;uri>http://www.example/alice&lt;/uri>
      &lt;/binding>
      &lt;binding name="mbox">
	&lt;uri>mailto:alice@work.example&lt;/uri>
      &lt;/binding>
    &lt;/result>
  &lt;/results></span>
&lt;/sparql></pre>
</div>

					</div5>
					<div5 id="select-ambiguous">
						<head>SELECT with ambiguous RDF dataset</head>
<div id="div-select-ambiguous">

<p>This SPARQL query</p>

<pre class="query">PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/>
PREFIX dc: &lt;http://purl.org/dc/elements/1.1/>

SELECT ?who ?g ?mbox
FROM &lt;http://www.example/publishers>
FROM NAMED &lt;http://www.example/john>
FROM NAMED &lt;http://www.example/susan>
WHERE { ?g dc:publisher ?who .
        GRAPH ?g { ?x foaf:mbox ?mbox }
}</pre>

<p>is conveyed to the SPARQL query
service, <tt>http://www.example/sparql/</tt>, as illustrated in this
HTTP trace:</p>

<pre class="req">GET /sparql/?<b>query</b>=<i>EncodedQuery</i>&amp;<b>default-graph-uri</b>=http://www.example/morepublishers
&amp;<b>named-graph-uri</b>=http://www.example/bob&amp;<b>named-graph-uri</b>=http://www.example/alice HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1</pre>

<p>This protocol operation contains an ambiguous RDF dataset: the dataset specified in the query is different than the one
specified in the protocol (by way of <code>default-graph-uri</code> and <code>named-graph-uri</code> parameters). A
conformant SPARQL Protocol service must resolve this ambiguity by executing the query against the RDF dataset specified in
the protocol:</p>

<pre class="resp">HTTP/1.1 200 OK
Date: Wed, 03 Aug 2005 12:48:25 GMT
Server: Apache/1.3.29 (Unix) PHP/4.3.4 DAV/1.0.3
Connection: close
Content-Type: application/sparql-results+xml

&lt;?xml version="1.0"?>
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#">
  &lt;head>
    &lt;variable name="who"/>
    &lt;variable name="g"/>
    &lt;variable name="mbox"/>
  &lt;/head>
  &lt;results ordered="false" distinct="false"><!-- ...<span class="hide">
    &lt;result>
      &lt;binding name="who">
	&lt;literal>John Hacker&lt;/literal>
      &lt;/binding>
      &lt;binding name="g">
	&lt;uri>http://www.example/john&lt;/uri>
      &lt;/binding>
      &lt;binding name="mbox">
	&lt;uri>mailto:john@home.example&lt;/uri>
      &lt;/binding>
    &lt;/result>
    &lt;result>
      &lt;binding name="who">
	&lt;literal>Susan Hacker&lt;/literal>
      &lt;/binding>
      &lt;binding name="g">
	&lt;uri>http://www.example/susan&lt;/uri>
      &lt;/binding>
      &lt;binding name="mbox">
	&lt;uri>mailto:susan@work.example&lt;/uri>
      &lt;/binding>
    &lt;/result>
</span> -->
    &lt;result>
      &lt;binding name="who">
      	&lt;literal>Bob Hacker&lt;/literal>
      &lt;/binding>
      &lt;binding name="g">
	&lt;uri>http://www.example/bob&lt;/uri>
      &lt;/binding>
      &lt;binding name="mbox">
        &lt;uri>mailto:bob@oldcorp.example&lt;/uri>
      &lt;/binding>
    &lt;/result>
    &lt;result>
      &lt;binding name="who">
	&lt;literal>Alice Hacker&lt;/literal>
      &lt;/binding>
      &lt;binding name="g">
	&lt;uri>http://www.example/alice&lt;/uri>
      &lt;/binding>
      &lt;binding name="mbox">
	&lt;uri>mailto:alice@work.example&lt;/uri>
      &lt;/binding>
    &lt;/result>
  &lt;/results>
&lt;/sparql></pre>
</div>

					</div5>
					<div5 id="select-malformed">
						<head> SELECT with malformed query fault</head>

<p>This syntactically invalid SPARQL query</p>
<div id="div-select-malformed">

<pre class="query">PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/>
SELECT ?name
WHERE { ?x foaf:name ?name
ORDER BY ?name }</pre>

<p>is conveyed to the SPARQL query
service, <tt>http://www.example/sparql/</tt>, as illustrated in this
HTTP trace:</p>

<pre class="req">GET /sparql/?<b>query</b>=<i>EncodedQuery</i>&amp;<b>default-graph-uri</b>=http://www.example/morepublishers HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1</pre>

<p>With the response &#8212; the <code>MalformedQuery</code> fault
  replacing the Out Message, as per <a href="#SparqlProtocol">@@sec@@
  SparqlProtocol</a> &#8212; illustrated here:</p>

<pre class="resp">HTTP/1.1 400 Bad Request
Date: Wed, 03 Aug 2005 12:48:25 GMT
Server: Apache/1.3.29 (Unix) PHP/4.3.4 DAV/1.0.3
Connection: close
Content-Type: text/plain; charset=UTF-8

4:syntax error, unexpected ORDER, expecting '}'</pre>
</div>

					</div5>
					<div5 id="select-refused">
						<head> SELECT with query request refused fault</head>

<p>This SPARQL query</p>

<div id="div-select-refused">
<pre class="query">PREFIX bio: &lt;http://bio.example/schema/#>
SELECT ?valence
FROM &lt;http://another.example/protein-db.rdf&gt;
WHERE { ?x bio:protein ?valence }
ORDER BY ?valence</pre>

<p>is conveyed to the SPARQL query
service, <tt>http://www.example/sparql/</tt>, as illustrated in this
HTTP trace:</p>

<pre class="req">GET /sparql/?<b>query</b>=<i>EncodedQuery</i>&amp;<b>default-graph-uri</b>=http://another.example/protein-db.rdf HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1</pre>

<p>With the response &#8212; the <code>QueryRequestRefused</code>
  fault replacing the Out Message, as per <a href="#SparqlProtocol">@@sec@@
  SparqlProtocol</a> &#8212; illustrated here:</p>

<pre class="resp">HTTP/1.1 500 Internal Server Error
Date: Wed, 03 Aug 2005 12:48:25 GMT
Server: Apache/1.3.29 (Unix) PHP/4.3.4 DAV/1.0.3
Connection: close
Content-Type: text/html; charset=UTF-8

&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
&lt;html>
&lt;head>
&lt;title>SPARQL Processing Service: Query Request Refused&lt;/title>
&lt;/head>
&lt;body>
&lt;p> Query Request Refused: your request could not be processed because 
 &lt;code>http://another.example/protein-db.rdf&lt;/code> could not be retrieved within 
 the time alloted.&lt;/p>
&lt;/body>
&lt;/html></pre>
</div>

					</div5>
					<div5 id="select-longpost">
						<head> Very long SELECT query using POST binding</head>

<p>Some SPARQL queries, perhaps machine generated, may be longer than
  can be reliably conveyed by way of the HTTP GET binding described in
  <a href="#query-bindings-http">@@sec@@ HTTP Bindings</a>. In those cases
  the POST binding described in @@sec@@ may be used. This SPARQL query</p>

<div id="div-select-longpost">

<pre class="query">PREFIX : &lt;http://www.w3.org/2002/12/cal/icaltzd#>
PREFIX Chi: &lt;http://www.w3.org/2002/12/cal/test/Chiefs.ics#>
PREFIX New: &lt;http://www.w3.org/2002/12/cal/tzd/America/New_York#>
PREFIX XML: &lt;http://www.w3.org/2001/XMLSchema#>

SELECT ?summary
WHERE {
    {
	Chi:D603E2AC-C1C9-11D6-9446-003065F198AC     a :Vevent;
         :dtend "2002-09-08T16:00:00"^^New:tz;
         :dtstamp "2002-09-06T03:09:27Z"^^XML:dateTime;
         :dtstart "2002-09-08T13:00:00"^^New:tz;
         :summary ?summary;
         :uid "D603E2AC-C1C9-11D6-9446-003065F198AC" .
   	}
	UNION
    {
	Chi:D603E90B-C1C9-11D6-9446-003065F198AC     a :Vevent;
         :dtend "2002-09-15T16:00:00"^^New:tz;
         :dtstamp "2002-09-06T03:10:19Z"^^XML:dateTime;
         :dtstart "2002-09-15T13:00:00"^^New:tz;
         :summary ?summary;
         :uid "D603E90B-C1C9-11D6-9446-003065F198AC" .
   	}
	UNION
    {
	Chi:D603ED6E-C1C9-11D6-9446-003065F198AC     a :Vevent;
         :dtend "2002-09-22T16:00:00"^^New:tz;
         :dtstamp "2002-09-06T03:11:05Z"^^XML:dateTime;
         :dtstart "2002-09-22T13:00:00"^^New:tz;
         :summary ?summary;
         :uid "D603ED6E-C1C9-11D6-9446-003065F198AC" .
   	}
	UNION
    {
	Chi:D603F18C-C1C9-11D6-9446-003065F198AC     a :Vevent;
         :dtend "2002-09-29T16:00:00"^^New:tz;
         :dtstamp "2002-09-06T03:15:46Z"^^XML:dateTime;
         :dtstart "2002-09-29T13:00:00"^^New:tz;
         :summary ?summary;
         :uid "D603F18C-C1C9-11D6-9446-003065F198AC" .
   	}
	UNION
    {
	Chi:D603F5B7-C1C9-11D6-9446-003065F198AC     a :Vevent;
         :dtend "2002-11-04"^^XML:date;
         :dtstamp "2002-09-06T03:12:53Z"^^XML:dateTime;
         :dtstart "2002-11-03"^^XML:date;
         :summary ?summary;
         :uid "D603F5B7-C1C9-11D6-9446-003065F198AC" .
   	}
	UNION
    {
	Chi:D603F9D7-C1C9-11D6-9446-003065F198AC     a :Vevent;
         :dtend "2002-11-10T20:15:00"^^New:tz;
         :dtstamp "2002-09-06T03:14:12Z"^^XML:dateTime;
         :dtstart "2002-11-10T17:15:00"^^New:tz;
         :summary ?summary;
         :uid "D603F9D7-C1C9-11D6-9446-003065F198AC" .
    }
	UNION
    {
	Chi:D604022C-C1C9-11D6-9446-003065F198AC     a :Vevent;
         :dtend "2002-11-17T17:00:00"^^New:tz;
         :dtstamp "2002-09-06T03:14:51Z"^^XML:dateTime;
         :dtstart "2002-11-17T14:00:00"^^New:tz;
         :summary ?summary;
         :uid "D604022C-C1C9-11D6-9446-003065F198AC" .
    }
	UNION
    {
	Chi:D604065C-C1C9-11D6-9446-003065F198AC     a :Vevent;
         :dtend "2002-10-06T19:05:00"^^New:tz;
         :dtstamp "2002-09-06T03:16:54Z"^^XML:dateTime;
         :dtstart "2002-10-06T16:05:00"^^New:tz;
         :summary ?summary;
         :uid "D604065C-C1C9-11D6-9446-003065F198AC" .
    }
	UNION
    {
	Chi:D6040A7E-C1C9-11D6-9446-003065F198AC     a :Vevent;
         :dtend "2002-10-13T19:15:00"^^New:tz;
         :dtstamp "2002-09-06T03:17:51Z"^^XML:dateTime;
         :dtstart "2002-10-13T16:15:00"^^New:tz;
         :summary ?summary;
         :uid "D6040A7E-C1C9-11D6-9446-003065F198AC" .
    }
	UNION
    {
	Chi:D6040E96-C1C9-11D6-9446-003065F198AC     a :Vevent;
         :dtend "2002-10-20T16:00:00"^^New:tz;
         :dtstamp "2002-09-06T03:18:32Z"^^XML:dateTime;
         :dtstart "2002-10-20T13:00:00"^^New:tz;
         :summary ?summary;
         :uid "D6040E96-C1C9-11D6-9446-003065F198AC" .
    }
	UNION
    {
	Chi:D6041270-C1C9-11D6-9446-003065F198AC     a :Vevent;
         :dtend "2002-10-27T17:00:00"^^New:tz;
         :dtstamp "2002-09-06T03:19:15Z"^^XML:dateTime;
         :dtstart "2002-10-27T14:00:00"^^New:tz;
         :summary ?summary;
         :uid "D6041270-C1C9-11D6-9446-003065F198AC" .
    }
	UNION
    {
	Chi:D6041673-C1C9-11D6-9446-003065F198AC     a :Vevent;
         :dtend "2002-11-24T20:05:00"^^New:tz;
         :dtstamp "2002-09-06T03:22:09Z"^^XML:dateTime;
         :dtstart "2002-11-24T17:05:00"^^New:tz;
         :summary ?summary;
         :uid "D6041673-C1C9-11D6-9446-003065F198AC" .
    }
	UNION
    {
	Chi:D6041A73-C1C9-11D6-9446-003065F198AC     a :Vevent;
         :dtend "2002-12-01T17:00:00"^^New:tz;
         :dtstamp "2002-09-06T03:22:52Z"^^XML:dateTime;
         :dtstart "2002-12-01T14:00:00"^^New:tz;
         :summary ?summary;
         :uid "D6041A73-C1C9-11D6-9446-003065F198AC" .
    }
	UNION
    {
	Chi:D60421EF-C1C9-11D6-9446-003065F198AC     a :Vevent;
         :dtend "2002-12-08T17:00:00"^^New:tz;
         :dtstamp "2002-09-06T03:24:04Z"^^XML:dateTime;
         :dtstart "2002-12-08T14:00:00"^^New:tz;
         :summary ?summary;
         :uid "D60421EF-C1C9-11D6-9446-003065F198AC" .
    }
	UNION
    {
	Chi:D6042660-C1C9-11D6-9446-003065F198AC     a :Vevent;
         :dtend "2002-12-15T20:05:00"^^New:tz;
         :dtstamp "2002-09-06T03:25:03Z"^^XML:dateTime;
         :dtstart "2002-12-15T17:05:00"^^New:tz;
         :summary ?summary;
         :uid "D6042660-C1C9-11D6-9446-003065F198AC" .
    }
	UNION
    {
	Chi:D6042A93-C1C9-11D6-9446-003065F198AC     a :Vevent;
         :dtend "2002-12-22T17:00:00"^^New:tz;
         :dtstamp "2002-09-06T03:25:47Z"^^XML:dateTime;
         :dtstart "2002-12-22T14:00:00"^^New:tz;
         :summary ?summary;
         :uid "D6042A93-C1C9-11D6-9446-003065F198AC" .
    }
	UNION
    {
	Chi:D6042EDF-C1C9-11D6-9446-003065F198AC     a :Vevent;
         :dtend "2002-12-28T21:00:00"^^New:tz;
         :dtstamp "2002-09-06T03:26:51Z"^^XML:dateTime;
         :dtstart "2002-12-28T18:00:00"^^New:tz;
         :summary ?summary;
         :uid "D6042EDF-C1C9-11D6-9446-003065F198AC" .
    }
}</pre>

<p>is conveyed to the SPARQL query
service, <tt>http://www.example/sparql/</tt>, as illustrated in this
HTTP trace:</p>

<pre class="req">POST /sparql/ HTTP/1.1
Host: www.example
User-agent: sparql-client/0.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 9461

<b>query</b>=<i>EncodedQuery</i>&amp;<b>default-graph-uri</b>=http://another.example/calendar.rdf</pre>

<p>With the response illustrated here:</p>

<pre class="resp">HTTP/1.1 200 OK
Date: Wed, 03 Aug 2005 12:48:25 GMT
Server: Apache/1.3.29 (Unix) PHP/4.3.4 DAV/1.0.3
Connection: close
Content-Type: application/sparql-results+xml

&lt;?xml version="1.0"?>
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#">
    &lt;head>
        &lt;variable name="summary"/>
    &lt;/head>
    &lt;results ordered="false" distinct="false">
        &lt;result>
            &lt;binding name="summary">
                &lt;literal>Chiefs vs. Cleveland @ Cleveland Stadium&lt;/literal>
            &lt;/binding>
        &lt;/result>
        &lt;result>
            &lt;binding name="summary">
                &lt;literal>Chiefs vs. Jacksonville @ Arrowhead Stadium&lt;/literal>
            &lt;/binding>
        &lt;/result>
        &lt;result>
            &lt;binding name="summary">
                &lt;literal>Chiefs vs. New England @ Gillette Stadium&lt;/literal>
            &lt;/binding>
        &lt;/result>
        ...<span class="hide">
        &lt;result>
            &lt;binding name="summary">
                &lt;literal>Chiefs vs. Miami @ Arrowhead Stadium&lt;/literal>
            &lt;/binding>
        &lt;/result>
        &lt;result>
            &lt;binding name="summary">
                &lt;literal>BYE&lt;/literal>
            &lt;/binding>
        &lt;/result>
        &lt;result>
            &lt;binding name="summary">
                &lt;literal>Chiefs vs. San Francisco @ 49ers Stadium at Candlestick Point&lt;/literal>
            &lt;/binding>
        &lt;/result>
        &lt;result>
            &lt;binding name="summary">
                &lt;literal>Chiefs vs. Buffalo @ Arrowhead Stadium&lt;/literal>
            &lt;/binding>
        &lt;/result>
        &lt;result>
            &lt;binding name="summary">
                &lt;literal>Chiefs vs. NY Jets @ Giants Stadium&lt;/literal>
            &lt;/binding>
        &lt;/result>
        &lt;result>
            &lt;binding name="summary">
                &lt;literal>Chiefs vs. San Diego @ Qualcomm Stadium&lt;/literal>
            &lt;/binding>
        &lt;/result>
        &lt;result>
            &lt;binding name="summary">
                &lt;literal>Chiefs vs. Denver @ Arrowhead Stadium&lt;/literal>
            &lt;/binding>
        &lt;/result>
        &lt;result>
            &lt;binding name="summary">
                &lt;literal>Chiefs vs. Oakland @ Arrowhead Stadium&lt;/literal>
            &lt;/binding>
        &lt;/result>
        &lt;result>
            &lt;binding name="summary">
                &lt;literal>Chiefs vs. Seattle @ Seahawks Stadium&lt;/literal>
            &lt;/binding>
        &lt;/result>
        &lt;result>
            &lt;binding name="summary">
                &lt;literal>Chiefs vs. Arizona @ Arrowhead Stadium&lt;/literal>
            &lt;/binding>
        &lt;/result>
        &lt;result>
            &lt;binding name="summary">
                &lt;literal>Chiefs vs. St. Louis @ Arrowhead Stadium&lt;/literal>
            &lt;/binding>
        &lt;/result>
        &lt;result>
            &lt;binding name="summary">
                &lt;literal>Chiefs vs. Denver @ INVESCO Field at Mile High&lt;/literal>
            &lt;/binding>
        &lt;/result>
        &lt;result>
            &lt;binding name="summary">
                &lt;literal>Chiefs vs. San Diego @ Arrowhead Stadium&lt;/literal>
            &lt;/binding>
        &lt;/result></span>
        &lt;result>
            &lt;binding name="summary">
                &lt;literal>Chiefs vs. Oakland @ Network Associates Coliseum&lt;/literal>
            &lt;/binding>
        &lt;/result>
    &lt;/results>
&lt;/sparql></pre>
</div>

					</div5>
					<div5 id="select-kanji">
						<head>SELECT with internationalization</head>

<p>SPARQL queries may include internationalized characters or character sets. This SPARQL query</p>

<div id="div-select-kanji">
	<pre class="query">PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/>
PREFIX 食: &lt;http://www.w3.org/2001/sw/DataAccess/tests/data/i18n/kanji.ttl#>
SELECT ?name ?food 
WHERE { [ foaf:name ?name ; 食:食べる ?food ] . }</pre>
	
	<p>is conveyed to the SPARQL query service, <tt>http://www.example/sparql/</tt>, as illustrated in this HTTP trace:</p>
	
	<pre class="req">GET /sparql/?<b>query</b>=<i>EncodedQuery</i>
Host: www.example
User-agent: sparql-client/0.1</pre>
	
	<pre class="resp">HTTP/1.1 200 OK
Date: Wed, 03 Aug 2005 12:48:25 GMT
Server: Apache/1.3.29 (Unix)
Connection: close
Content-Type: application/sparql-results+xml

&lt;?xml version="1.0"?>
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#">
...
&lt;/sparql></pre>
<span class="todo" todotext="Put in internationalized results" tododate="2009-Oct-20">...</span>
</div>

					</div5>
					<div5 id="select-post-xml">
						<head>SELECT with queryHttpPost binding and XML input</head>

<ednote><edtext>The current SPARQL Working Group does not intend to standardize an XML serialization of SPARQL queries at this point in time, and this section may be removed from the specification.</edtext></ednote>
<p>In some future version <a href="http://www.w3.org/2001/sw/DataAccess/sparqlx.rnc">SPARQL queries could be serialized as XML</a> and conveyed to
a SPARQL query service by way of HTTP <code>POST</code>. This SPARQL query</p>

<div id="div-select-post-xml">
	<pre class="query">&lt;?xml version="1.0"?>
&lt;rdf-query xmlns="http://example.org/SparqlX/">
 &lt;select>&lt;variable name="book"/>&lt;variable name="who"/>&lt;/select>
 &lt;query-pattern>
	&lt;triple-pattern>
		&lt;subject>&lt;variable name="book"/>&lt;/subject>
		&lt;predicate>&lt;uri>http://purl.org/dc/elements/1.1/creator&lt;/uri>&lt;/predicate>
		&lt;object>&lt;variable name="who"/>&lt;/object>
	&lt;/triple-pattern>
 &lt;/query-pattern>
&lt;/rdf-query></pre>
	
	<p>is conveyed to the SPARQL query
	service, <tt>http://www.example/sparql/</tt>, as illustrated in this
	HTTP trace:</p>

	<pre class="req">POST /sparql/ HTTP/1.1
Host: www.example
User-agent: my-sparql-client/0.1
Content-type: <b>application/xml</b>

&lt;?xml version="1.0"?>
&lt;rdf-query xmlns="http://example.org/SparqlX/">
&lt;select>&lt;variable name="book"/>&lt;variable name="who"/>&lt;/select>
&lt;query-pattern>
&lt;triple-pattern>
	&lt;subject>&lt;variable name="book"/>&lt;/subject>
	&lt;predicate>&lt;uri>http://purl.org/dc/elements/1.1/creator&lt;/uri>&lt;/predicate>
	&lt;object>&lt;variable name="who"/>&lt;/object>
&lt;/triple-pattern>
&lt;/query-pattern>
&lt;/rdf-query></pre>

	<p>That query against the service-supplied RDF dataset, executed by
	that SPARQL query service, returns the following query result:</p>

	<pre class="resp">HTTP/1.1 200 OK
Date: Fri, 06 May 2005 20:55:12 GMT
Server: Apache/1.3.29 (Unix) PHP/4.3.4 DAV/1.0.3
Connection: close
Content-Type: application/sparql-results+xml

&lt;?xml version="1.0"?>
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#">

 &lt;head>
   &lt;variable name="book"/>
   &lt;variable name="who"/>
 &lt;/head>
 &lt;results distinct="false" ordered="false">
   &lt;result>
     &lt;binding name="book">&lt;uri>http://www.example/book/book5&lt;/uri>&lt;/binding>
     &lt;binding name="who">&lt;bnode>r29392923r2922&lt;/bnode>&lt;/binding>
   &lt;/result>
...<span class="hide">
   &lt;result>
     &lt;binding name="book">&lt;uri>http://www.example/book/book6&lt;/uri>&lt;/binding>
     &lt;binding name="who">&lt;bnode>r8484882r49593&lt;/bnode>&lt;/binding>
   &lt;/result>
 &lt;/results></span>
&lt;/sparql> </pre>
	
</div>

					</div5>
                    </div4>
				      </div3>
                      <div3>
                        <head>HTTP Bindings for SPARQL Update</head>
                      <div4>
                        <head>HTTP Examples for SPARQL Update</head>
                        <ednote><edtext>This is a placeholder for example HTTP interactions for sending SPARQL 1.1 Update commands via HTTP POST.</edtext></ednote>
                        <p>@@</p>
                      </div4>
                      </div3>
				    </div2>
			<div2 id="query-bindings-other">
				<head>Other Bindings</head>

<p>
[WSDL2-Adjuncts] defines a means of binding abstract interface
operations to to other transports such as SOAP. Any implementation of this specification is at liberty to provide alternative 
bindings. 
</p>
            </div2>
		</div1>
		<div1 id="policy">
			<head>Policy Considerations</head>

			<div2 id="policy-security">
				<head>Security</head>

<ednote><edtext>The editors note that security concerns for issuing SPARQL 1.1 Update commands over the protocol should be addressed.</edtext></ednote>

<p>There are at least two possible sources of denial-of-service attacks against SPARQL protocol services. First, under-constrained
queries can result in very large numbers of results, which may require large expenditures of computing resources to process,
assemble, or return. Another possible source are queries containing very complex &#8212; either because of resource size, the number
of resources to be retrieved, or a combination of size and number &#8212; RDF dataset descriptions, which the service may be unable
to assemble without significant expenditure of resources, including bandwidth, CPU, or secondary storage. In some cases such
expenditures may effectively constitute a denial-of-service attack. A SPARQL protocol service <strong>may</strong> place
restrictions on the resources that it retrieves or on the rate at which external resources are retrieved. There may be other sources
of denial-of-service attacks against SPARQL query processing services.
</p>

<p>Since a SPARQL protocol service may make HTTP requests of other origin servers on behalf of its clients, it may be used as a
vector of attacks against other sites or services. Thus, SPARQL protocol services may effectively act as proxies for third-party
clients. Such services <strong>may</strong> place restrictions on the resources that they retrieve or on the rate at which external
resources can be retrieved. SPARQL protocol services <strong>may</strong> log client requests in such a way as to facilitate tracing
them with regard to third-party origin servers or services.</p>

<p>SPARQL protocol services <strong>may</strong> choose to detect these and other costly, or otherwise unsafe, queries, impose time
or memory limits on queries, or impose other restrictions to reduce the service's (and other service's) vulnerability to
denial-of-service attacks. They also <strong>may</strong> <a href="#fault-messages">refuse to process such query requests</a>. </p>

<p>Different IRIs may have the same appearance. Characters in different scripts may look similar (a Cyrillic "о" may appear similar
to a Latin "o"). A character followed by combining characters may have the same visual representation as another character (LATIN
SMALL LETTER E followed by COMBINING ACUTE ACCENT has the same visual representation as LATIN SMALL LETTER E WITH ACUTE). Users of
SPARQL must take care to construct queries with IRIs that match the IRIs in the data. Further information about matching of similar
characters can be found in <a href="http://www.unicode.org/reports/tr36/">Unicode Security Considerations</a> [UNISEC]
and <a href="http://www.ietf.org/rfc/rfc3987.txt">Internationalized Resource Identifiers (IRIs)</a> [RFC3987] Section 8.</p>

			</div2>
		</div1>
		<div1 id="conformance">
			<head>Conformance</head>

<p>The status of the parts of SPARQL 1.1 Protocol for RDF (this document) is as follows:</p>

<ul>
	<li>Section 1 Introduction: <strong>normative</strong></li>
	<li>Section 2 SPARQL Protocol: <strong>normative</strong>, except for the paragraph (in 2.2 HTTP Bindings) labeled "<strong>An Informative Note About Serialization Constraints</strong>", which is <strong>informative</strong>.</li>
	<li>Subsection 2.2.1 HTTP Examples: <strong>informative</strong></li>
	<li>Section 3: Policy Considerations: <strong>normative</strong></li>
	<li>Section 4: Conformance: <strong>normative</strong></li>
	<li>Section 5.1: Normative References: <strong>normative</strong></li>
	<li>Section 5.2: Informative References: <strong>informative</strong></li>
	<li>Section 6: Acknowledgments: <strong>informative</strong></li>
</ul>

<p>Further, both <a href="http://www.w3.org/2009/docs/sparql/protocol-1.1/protocol-query.wsdl">protocol-query.wsdl</a> and <a href="http://www.w3.org/2007/SPARQL/protocol-types.xsd">protocol-types.xsd</a> are <strong>normative</strong>.</p>

<p>A <a name="conformant-sparql-protocol-service">conformant SPARQL Protocol service</a>:</p>

<ol>
	<li><strong>must</strong> implement one or more operations of the <code>SparqlProtocol</code> interface;</li>
	<li><strong>may</strong> implement HTTP bindings of the XXQUERYXX operation of the <code>SparqlProtocol</code> interface;</li>
	<li><strong>may</strong> implement HTTP bindings of the XXUPDATEXX operation of the <code>SparqlProtocol</code> interface;</li>
	<li><strong>must</strong> implement HTTP bindings of XXQUERYXX and XXUPDATEXX in the way described in this document ("SPARQL 1.1 Protocol for RDF"), in <a href="http://www.w3.org/2009/sparql/docs/protocol-1.1/protocol-query.wsdl">protocol-query.wsdl</a>, and <a href="http://www.w3.org/2009/sparql/docs/protocol-1.1/protocol-types.xsd">protocol-types.xsd</a>;</li>
	<li><strong>may</strong> implement other interfaces, bindings of the operations of those interfaces, or bindings of the XXQUERYXX and XXUPDATEXX operations other than the normative HTTP bindings described by SPARQL 1.1 Protocol for RDF; and</li>
	<li><strong>must</strong> be consistent with the normative constraints (indicated by [RFC 2119] keywords) described in <a href="#policy">3. Policy Considerations</a>.</li>
</ol>

		</div1>
        <div1 id="changes">
            <head>Changes Since Previous Recommendation</head>
            <p>This specification extends and updates the <a href="http://www.w3.org/TR/2008/REC-rdf-sparql-protocol-20080115/">SPARQL Protocol for RDF of January, 2008</a>. The significant changes are:</p>
            <ul>
              <li>Change the name of the one protocol interface from SparqlQuery to SparqlProtocol</li>
              <li>Define an Update operation for issuing SPARQL Update commands</li>
              <li>Define HTTP bindings for the Update operation</li>
              <li>Removed the section on SOAP bindings, and referred to other WSDL bindings in general</li>
              <li>Updated conformance criteria to align with the removal of the normative SOAP bindings</li>
            </ul>
        </div1>
	</body>
	<back>
		<!-- &SGML; -->
		<!-- &Biblio; -->
		<div1 id="sec-bibliography">
			<head>References</head>
			<div2 id="sec-existing-stds">
				<head>Normative References</head>
				<blist>
					<bibl id="IANA" href="http://www.iana.org/assignments/character-sets" key="IANA-CHARSETS">(Internet
Assigned Numbers Authority) <titleref>Official Names for Character Sets</titleref>,
ed. Keld Simonsen et al.</bibl>
					<bibl id="rfc2119" href="http://www.ietf.org/rfc/rfc2119.txt" key="IETF RFC 2119">IETF
(Internet Engineering Task Force). <titleref>RFC 2119: Key words for use in RFCs to Indicate Requirement Levels</titleref>.
Scott Bradner, 1997.</bibl>
					<bibl id="RFC1766" href="ftp://ftp.isi.edu/in-notes/bcp/bcp47.txt" key="IETF BCP 47" diff="chg"><loc role="erratumref" href="E01"/>IETF
						(Internet Engineering Task Force). <titleref>BCP 47, consisting of RFC 4646: Tags for Identifying Languages, and RFC 4647: Matching of Language Tags</titleref>,
						A. Phillips, M. Davis. 2006.</bibl>
					<bibl id="rfc3986" href="http://www.ietf.org/rfc/rfc3986.txt" key="IETF RFC 3986">IETF (Internet Engineering Task Force). <titleref>RFC 3986: Uniform Resource Identifier (URI): Generic Syntax</titleref>. T. Berners-Lee, R. Fielding, L. Masinter. 2005.</bibl>
					<bibl id="ISO10646" key="ISO/IEC 10646">ISO (International
Organization for Standardization). <titleref>ISO/IEC 10646-1:2000. Information
technology &mdash; Universal Multiple-Octet Coded Character Set (UCS) &mdash;
Part 1: Architecture and Basic Multilingual Plane</titleref> and <titleref>ISO/IEC 10646-2:2001.
Information technology &mdash; Universal Multiple-Octet Coded Character Set (UCS) &mdash; Part 2:
Supplementary Planes</titleref>, as, from time to time, amended, replaced by a new edition or
expanded by the addition of new parts. [Geneva]: International Organization for Standardization.
(See <loc href="http://www.iso.org/iso/home.htm">http://www.iso.org/iso/home.htm</loc> for the latest version.)</bibl>
					<bibl id="ISO10646-2000" key="ISO/IEC 10646:2000">ISO (International
Organization for Standardization). <titleref>ISO/IEC 10646-1:2000. Information
technology &mdash; Universal Multiple-Octet Coded Character Set (UCS) &mdash;
Part 1: Architecture and Basic Multilingual Plane.</titleref> [Geneva]: International
Organization for Standardization, 2000.</bibl>
					<bibl id="Unicode" key="Unicode">The Unicode Consortium. <emph>The Unicode
Standard, Version <phrase diff="chg"><loc role="erratumref" href="E11"/>5.0.0,</phrase></emph> <phrase diff="del"><loc role="erratumref" href="E11"/>Reading, Mass.: Addison-Wesley Developers Press,
1996</phrase><phrase diff="add"><loc role="erratumref" href="E11"/>defined by: The Unicode Standard, Version 5.0 (Boston, MA,
Addison-Wesley, 2007. ISBN 0-321-48091-0)</phrase>.</bibl>
	  <bibl id="unipart15" key="UnicodeNormal" href="http://unicode.org/reports/tr15/">The Unicode
Consortium. <titleref>Unicode normalization forms</titleref>.  Mark Davis and
Martin Durst.  2008.</bibl>
					<bibl id="Unicode3" key="Unicode3" diff="del"><loc role="erratumref" href="E11"/>The Unicode
Consortium. <emph>The Unicode Standard, Version 3.2</emph>, defined by:
<emph>The Unicode Standard, Version 3.0</emph> (Reading, MA,
Addison-Wesley, 2000. ISBN 0-201-61633-5), as amended by the <emph>Unicode
Standard Annex #27: Unicode 3.1</emph>
(<loc href="http://www.unicode.org/reports/tr27/">http://www.unicode.org/reports/tr27</loc>) and the <emph>Unicode Standard Annex #28: Unicode
3.2</emph>
(<loc href="http://www.unicode.org/reports/tr28/">http://www.unicode.org/reports/tr28</loc>).</bibl>
				</blist>
			</div2>
			<div2 id="null">
				<!--
ID made "null" to match its previous value in the First
Edition; it's odd, but if there's no set value, the stylesheet
currently generates an odd string that would be backwards
incompatible with any references anyone might have made before.
-->
				<head>Other References</head>
				<blist>
					<bibl id="Aho" key="Aho/Ullman">Aho, Alfred V., Ravi Sethi, and Jeffrey D.
Ullman. <titleref>Compilers: Principles, Techniques, and Tools</titleref>.
Reading: Addison-Wesley, 1986, rpt. corr. 1988.</bibl>
					<bibl id="ABK" href="ftp://ftp.informatik.uni-freiburg.de/documents/papers/brueggem/habil.ps" key="Brüggemann-Klein">Brüggemann-Klein,
Anne. <titleref>Formal Models in Document Processing</titleref>. Habilitationsschrift. Faculty
of Mathematics at the University of Freiburg, 1993.</bibl>
					<bibl id="ABKDW" key="Brüggemann-Klein and Wood">Brüggemann-Klein,
Anne, and Derick Wood. <titleref>Deterministic Regular Languages</titleref>.
Universität Freiburg, Institut für Informatik, Bericht 38, Oktober 1991. Extended
abstract in A. Finkel, M. Jantzen, Hrsg., STACS 1992, S. 173-184. Springer-Verlag,
Berlin 1992. Lecture Notes in Computer Science 577. Full version titled <titleref>One-Unambiguous
Regular Languages</titleref> in Information and Computation 140 (2): 229-253,
February 1998.</bibl>
					<bibl id="Clark" href="http://www.w3.org/TR/NOTE-sgml-xml-971215" key="Clark">James Clark.
<titleref>Comparison of SGML and XML</titleref>.</bibl>
					<bibl id="IANA-LANGCODES" href="http://www.iana.org/assignments/language-subtag-registry" key="IANA-LANGCODES" diff="chg"><loc role="erratumref" href="E01"/>(Internet
Assigned Numbers Authority) <titleref>Registry of Language Tags</titleref></bibl>
					<bibl id="RFC2141" href="http://www.ietf.org/rfc/rfc2141.txt" key="IETF RFC 2141">IETF
(Internet Engineering Task Force). <titleref>RFC 2141: URN Syntax</titleref>, ed.
R. Moats. 1997. </bibl>
					<bibl id="rfc2376" href="http://www.ietf.org/rfc/rfc3023.txt" key="IETF RFC 3023">IETF
(Internet Engineering Task Force). <titleref>RFC 3023: XML Media Types</titleref>.
eds. M. Murata, S. St.Laurent, D. Kohn. 2001.</bibl>
					<bibl id="rfc2781" href="http://www.ietf.org/rfc/rfc2781.txt" key="IETF RFC 2781">IETF
(Internet Engineering Task Force). <titleref>RFC 2781: UTF-16, an encoding
of ISO 10646</titleref>, ed. P. Hoffman, F. Yergeau. 2000.</bibl>
					<bibl id="ISO639" key="ISO 639">(International Organization for Standardization).
<titleref>ISO 639:1988 (E).
Code for the representation of names of languages.</titleref> [Geneva]: International
Organization for Standardization, 1988.</bibl>
					<bibl id="ISO3166" key="ISO 3166">(International Organization for Standardization).
<titleref>ISO 3166-1:1997
(E). Codes for the representation of names of countries and their subdivisions &mdash;
Part 1: Country codes</titleref> [Geneva]: International Organization for
Standardization, 1997.</bibl>
					<bibl id="ISO8879" key="ISO 8879">ISO (International Organization for Standardization). <titleref>ISO
8879:1986(E). Information processing &mdash; Text and Office Systems &mdash;
Standard Generalized Markup Language (SGML).</titleref> First edition &mdash;
1986-10-15. [Geneva]: International Organization for Standardization, 1986. </bibl>
					<bibl id="ISO10744" key="ISO/IEC 10744">ISO (International Organization for
Standardization). <titleref>ISO/IEC 10744-1992 (E). Information technology &mdash;
Hypermedia/Time-based Structuring Language (HyTime). </titleref> [Geneva]:
International Organization for Standardization, 1992. <emph>Extended Facilities
Annexe.</emph> [Geneva]: International Organization for Standardization, 1996. </bibl>
					<bibl id="websgml" href="http://www.sgmlsource.com/8879/n0029.htm" key="WEBSGML">ISO
(International Organization for Standardization). <titleref>ISO 8879:1986
TC2. Information technology &mdash; Document Description and Processing Languages</titleref>.
[Geneva]: International Organization for Standardization, 1998.</bibl>
					<bibl id="xml-names" href="http://www.w3.org/TR/xml-names/" key="XML Names">Tim Bray,
Dave Hollander, and Andrew Layman, editors. <titleref>Namespaces in XML</titleref>.
Textuality, Hewlett-Packard, and Microsoft. World Wide Web Consortium, 1999.</bibl>
				</blist>
			</div2>
		</div1>
		<div1 id="sec-cvsLog">
			<head>CVS History</head>
			<div2 id="sec-cvsLog-meat">
			  <pre>
$Log: Overview.xml,v $
Revision 1.12  2009/10/21 02:25:37  lfeigenb
fix links
add .wsdl and .xsd

Revision 1.10  2009/10/20 20:21:47  lfeigenb
fixed placement of table

Revision 1.9  2009/10/20 19:10:19  lfeigenb
Fixed and added support for markup that was previously unsupported by our XSLTs.

Future SPARQL-specific customizations should go in shared/sparql.xsl

Revision 1.8  2009/10/20 18:13:47  lfeigenb
Factored out shared XML spec files into docs/shared

Revision 1.7  2009/10/20 16:24:01  lfeigenb
remove extra 1.1 ; DAWG -> SPARQL WG ; add note about security for update

Revision 1.6  2009/10/20 05:58:28  lfeigenb
Make all changes and updates suggested in

http://lists.w3.org/Archives/Public/public-rdf-dawg/2009OctDec/0204.html

Revision 1.5  2009/10/15 22:37:08  lfeigenb
Changes in preparation of FPWD as per http://www.w3.org/2009/sparql/meeting/2009-10-13

Revision 1.4  2009/10/03 00:15:20  lfeigenb
fixed xml tags

Revision 1.3  2009/10/03 00:13:19  lfeigenb
Initial updates by SimonKJ

Revision 1.2  2009/09/28 22:55:59  eric
- some leftover noise from the port

Revision 1.1  2009/09/28 22:30:46  eric
CREATED
			  </pre>
			</div2>
		</div1>
	</back>
</spec>
