Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support directional language-tagged strings, Closes #39 #40

Merged
merged 4 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,19 @@ <h2>Definition</h2>
<h3>Document Element</h3>
<p>The <a href="#defn-srd">SPARQL Results Document</a> begins with <code>sparql</code> document element in the <code>http://www.w3.org/2005/sparql-results#</code> namespace, written as follows:</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#"&gt;
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#"
xmlns:its="http://www.w3.org/2005/11/its"
its:version="1.0"&gt;
Tpt marked this conversation as resolved.
Show resolved Hide resolved
...
&lt;/sparql&gt;
</pre>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would maybe state that other its:version values are ok to not make migrating to new its version a breaking change in future versions of XML query results.

<p>Inside the <code>sparql</code> element are two sub-elements, <code>head</code> and a results element (either <code>results</code> or <code>boolean</code>) which must appear in that order.</p>
<p>If no literals with base direction appear in the results, the <code>sparql</code> document element may be simplified as follows.</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#"&gt;
...
&lt;/sparql&gt;
</pre>
</section>

<section id="head">
Expand All @@ -407,7 +415,9 @@ <h3>Header</h3>
<p>Inside the <code>head</code> element, the ordered sequence of variable names chosen are used to create empty child elements <code>variable</code> with the variable name as the value of an
attribute <code>name</code> giving a document like this:</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#"&gt;
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#"
xmlns:its="http://www.w3.org/2005/11/its"
its:version="1.0"&gt;

&lt;head&gt;
&lt;variable name="x"/&gt;
Expand All @@ -426,7 +436,9 @@ <h3>Header</h3>
metadata about the query results. The relative URI is resolved against the in-scope base URI which is usually the query results format document URI. <code>link</code> elements must appear after any
<code>variable</code> elements that are present.</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#"&gt;
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#"
xmlns:its="http://www.w3.org/2005/11/its"
its:version="1.0"&gt;

&lt;head&gt;
...
Expand All @@ -448,7 +460,9 @@ <h4>Variable Binding Results</h4>
<p>For each <a data-cite="SPARQL12-QUERY#defn_sparqlSolutionMapping">Query Solution</a> in the query results, a <code>result</code> child-element of
<code>results</code> is added giving a document like:</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#"&gt;
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#"
xmlns:its="http://www.w3.org/2005/11/its"
its:version="1.0"&gt;
... head ...

&lt;results&gt;
Expand All @@ -466,7 +480,9 @@ <h4>Variable Binding Results</h4>
<p>Each binding inside a solution is written as an element <code>binding</code> as a child of <code>result</code> with the query variable name as the value of the <code>name</code> attribute. So
for a result binding two variables <em>x</em> and <em>hpage</em> it would look like:</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#"&gt;
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#"
xmlns:its="http://www.w3.org/2005/11/its"
its:version="1.0"&gt;
&lt;head&gt;
&lt;variable name="x"/&gt;
&lt;variable name="hpage"/&gt;
Expand All @@ -493,8 +509,10 @@ <h4>Variable Binding Results</h4>
<dd><code>&lt;binding&gt;&lt;uri&gt;</code><em>U</em><code>&lt;/uri&gt;&lt;/binding&gt;</code></dd>
<dt>RDF Literal <em>S</em><br></dt>
<dd><code>&lt;binding&gt;&lt;literal&gt;</code><em>S</em><code>&lt;/literal&gt;&lt;/binding&gt;</code></dd>
<dt>RDF Literal <em>S</em> with language <em>L</em><br></dt>
<dt>RDF Literal <em>S</em> with language <em>L</em> without base direction<br></dt>
<dd><code>&lt;binding&gt;&lt;literal xml:lang="</code><em>L</em><code>"&gt;</code><em>S</em><code>&lt;/literal&gt;&lt;/binding&gt;</code></dd>
<dt>RDF Literal <em>S</em> with language <em>L</em> with base direction <em>L</em><br></dt>
<dd><code>&lt;binding&gt;&lt;literal xml:lang="</code><em>L</em><code>" its:base="</code><em>B</em><code>"&gt;</code><em>S</em><code>&lt;/literal&gt;&lt;/binding&gt;</code></dd>
<dt>RDF Typed Literal <em>S</em> with datatype URI <em>D</em><br></dt>
<dd><code>&lt;binding&gt;&lt;literal datatype="</code><em>D</em><code>"&gt;</code><em>S</em><code>&lt;/literal&gt;&lt;/binding&gt;</code></dd>
<dt>Blank Node label <em>I</em><br></dt>
Expand All @@ -514,7 +532,9 @@ <h4>Variable Binding Results</h4>
graph.</p>
<p>An example of a query solution encoded in this format is as follows:</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#"&gt;
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#"
xmlns:its="http://www.w3.org/2005/11/its"
its:version="1.0"&gt;

&lt;head&gt;
&lt;variable name="x"/&gt;
Expand Down Expand Up @@ -551,7 +571,9 @@ <h4>Variable Binding Results</h4>
</pre>
<p>An example of a query solution that includes quoted triples is as follows:</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#"&gt;
&lt;sparql xmlns="http://www.w3.org/2005/sparql-results#"
xmlns:its="http://www.w3.org/2005/11/its"
its:version="1.0"&gt;

&lt;head&gt;
&lt;variable name="x"/&gt;
Expand Down
4 changes: 3 additions & 1 deletion spec/output-quoted.srx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version="1.0"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/sw/DataAccess/rf1/result2.xsd">
xsi:schemaLocation="http://www.w3.org/2001/sw/DataAccess/rf1/result2.xsd"
xmlns:its="http://www.w3.org/2005/11/its"
its:version="1.0">

<head>
<variable name="x"/>
Expand Down
4 changes: 3 additions & 1 deletion spec/output.srx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version="1.0"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/sw/DataAccess/rf1/result2.xsd">
xsi:schemaLocation="http://www.w3.org/2001/sw/DataAccess/rf1/result2.xsd"
xmlns:its="http://www.w3.org/2005/11/its"
its:version="1.0">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move to 2.0? (same with output-quoted.srx).


<head>
<variable name="x"/>
Expand Down
Loading