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

Ensures SPARQL 1.2 follows RDF 1.1 #159

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions sparql/sparql12/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ <h2>
<li>
<a href='lang-basedir/index.html' inlist='true' property='mf:include'>lang-basedir/</a>
</li>
<li>
<a href='rdf11/index.html' inlist='true' property='mf:include'>rdf11/</a>
</li>
<li>
<a href='syntax-triple-terms-negative/index.html' inlist='true' property='mf:include'>syntax-triple-terms-negative/</a>
</li>
Expand Down
1 change: 1 addition & 0 deletions sparql/sparql12/manifest.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ trs:manifest rdf:type mf:Manifest ;
<syntax-triple-terms-negative/manifest.ttl>
<syntax-triple-terms-positive/manifest.ttl>
<lang-basedir/manifest.ttl>
<rdf11/manifest.ttl>
) .
164 changes: 164 additions & 0 deletions sparql/sparql12/rdf11/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
<!DOCTYPE html>
<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#'>
<head>
<meta content='text/html;charset=utf-8' http-equiv='Content-Type'>
<meta content='width=device-width, initial-scale=1.0' name='viewport'>
<link href='https://www.w3.org/StyleSheets/TR/base' rel='stylesheet' type='text/css'>
<style>
body: {bacground-image: none;}
dl.editor>dd {
margin: 0 0 0 40px;
}
dl.test-detail {
padding: 0.5em;
}
dl.test-detail>dt {
float: left;
clear: left;
text-align: right;
font-weight: bold;
color: green;
}
dl.test-detail>dt:after {content: ": "}
dl.test-detail>dd {
margin: 0 0 0 110px;
padding: 0 0 0.5em 0;
}
dl.test-description>dt {margin-top: 2em;}
dd {margin-left: 0;}
dd code {display: inline;}
footer {text-align: center;}
</style>
<title>
RDF 1.1 literals handling
</title>
<style>
em.rfc2119 {
text-transform: lowercase;
font-variant: small-caps;
font-style: normal;
color: #900;
}
a.testlink {
color: inherit;
text-decoration: none;
}
a.testlink:hover {
text-decoration: underline;
}
.warning {color: orange;}
.error {color: red;}
</style>
</head>
<body resource='../grouping#manifest' typeof='mf:Manifest'>
<p>
<a href='http://www.w3.org/'>
<img alt='W3C' height='48' src='http://www.w3.org/Icons/w3c_home' width='72'>
</a>
</p>
<h1 property='rdfs:label'>RDF 1.1 literals handling</h1>
<p><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2010 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>, <a href="http://www.ercim.org/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>, and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p>
<hr title='Separator for header'>
<div>
<h2 id='abstract'>Abstract</h2>
<p property='rdfs:comment'>
</p>
<p>This page describes SPARQL 1.2 test suite of the W3C RDF-star Working Group.</p>
<h3 id="contributing-tests">Contributing Tests</h3>
<p>The test manifests and entries are built automatically from <a href="manifest.ttl">manifest.ttl</a> using a Rake task. Tests may be contributed via pull request to <a href="https://github.com/w3c/rdf-tests">https://github.com/w3c/rdf-tests</a> with suitable changes to the <a href="manifest.ttl">manifest.ttl</a> and referenced files.</p>
<h3 id="distribution">Distribution</h3>
<p>Distributed under both the <a href="http://www.w3.org/Consortium/Legal/2008/04-testsuite-license">W3C Test Suite License</a> and the <a href="http://www.w3.org/Consortium/Legal/2008/03-bsd-license">W3C 3-clause BSD License</a>. To contribute to a W3C Test Suite, see the <a href="http://www.w3.org/2004/10/27-testcases">policies and contribution forms</a>.</p>
<h3 id="disclaimer">Disclaimer</h3>
<p>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.</p>
</div>
<div>
<h2>
Test Descriptions
</h2>
<dl class='test-description'>
<dt id='langstring-datatype'>
<a class='testlink' href='#langstring-datatype'>
langstring-datatype:
</a>
<span about='../grouping#langstring-datatype' property='mf:name'>DATATYPE on rdf:langString</span>
</dt>
<dd inlist='true' property='mf:entry' resource='../grouping#langstring-datatype' typeof='mf:QueryEvaluationTest'>
<div property='rdfs:comment'>
<p>plain literals with a language tag have a rdf:langString datatype</p>
</div>
<dl class='test-detail'>
<dt>type</dt>
<dd>mf:QueryEvaluationTest</dd>
<dt>approval</dt>
<dd property='mf:approval' resource=''></dd>
<dt>action</dt>
<dd>
<dl class='test-detail' property='mf:action' resource=''>
</dl>
</dd>
<dt>result</dt>
<dd>
<a href='langstring-datatype.srj' property='mf:result'>langstring-datatype.srj</a>
</dd>
</dl>
</dd>
<dt id='plain-string-datatype'>
<a class='testlink' href='#plain-string-datatype'>
plain-string-datatype:
</a>
<span about='../grouping#plain-string-datatype' property='mf:name'>DATATYPE on plain string literal</span>
</dt>
<dd inlist='true' property='mf:entry' resource='../grouping#plain-string-datatype' typeof='mf:QueryEvaluationTest'>
<div property='rdfs:comment'>
<p>plain literals without a language tag have the xsd:string datatype</p>
</div>
<dl class='test-detail'>
<dt>type</dt>
<dd>mf:QueryEvaluationTest</dd>
<dt>approval</dt>
<dd property='mf:approval' resource=''></dd>
<dt>action</dt>
<dd>
<dl class='test-detail' property='mf:action' resource=''>
</dl>
</dd>
<dt>result</dt>
<dd>
<a href='plain-string-datatype.srj' property='mf:result'>plain-string-datatype.srj</a>
</dd>
</dl>
</dd>
<dt id='plain-string-same'>
<a class='testlink' href='#plain-string-same'>
plain-string-same:
</a>
<span about='../grouping#plain-string-same' property='mf:name'>xsd:string and plain literals are the same</span>
</dt>
<dd inlist='true' property='mf:entry' resource='../grouping#plain-string-same' typeof='mf:QueryEvaluationTest'>
<div property='rdfs:comment'>
<p>xsd:string literals are the same as literals without datatypes</p>
</div>
<dl class='test-detail'>
<dt>type</dt>
<dd>mf:QueryEvaluationTest</dd>
<dt>approval</dt>
<dd property='mf:approval' resource=''></dd>
<dt>action</dt>
<dd>
<dl class='test-detail' property='mf:action' resource=''>
</dl>
</dd>
<dt>result</dt>
<dd>
<a href='plain-string-same.srj' property='mf:result'>plain-string-same.srj</a>
</dd>
</dl>
</dd>
</dl>
</div>
<footer>
<p><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright ©</a> 2015 <a href="http://www.w3.org/">W3C</a>® (<a href="http://www.csail.mit.edu/">MIT</a>, <a href="http://www.ercim.org/">ERCIM</a>, <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>). W3C® <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p>
</footer>
</body>
</html>
1 change: 1 addition & 0 deletions sparql/sparql12/rdf11/langstring-datatype.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SELECT (DATATYPE("foo"@en) AS ?dt) WHERE {}
12 changes: 12 additions & 0 deletions sparql/sparql12/rdf11/langstring-datatype.srj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"head": {
"vars": [ "dt" ]
},
"results": {
"bindings": [
{
"dt": { "type": "uri", "value": "http://www.w3.org/1999/02/22-rdf-syntax-ns#langString" }
}
]
}
}
37 changes: 37 additions & 0 deletions sparql/sparql12/rdf11/manifest.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix : <https://w3c.github.io/rdf-tests/sparql/sparql12/grouping#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
@prefix qt: <http://www.w3.org/2001/sw/DataAccess/tests/test-query#> .
@prefix dawgt: <http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#> .

:manifest rdf:type mf:Manifest ;
rdfs:label "RDF 1.1 literals handling" ;
mf:entries
(
:langstring-datatype
:plain-string-datatype
:plain-string-same
) .


:langstring-datatype rdf:type mf:QueryEvaluationTest ;
mf:name "DATATYPE on rdf:langString";
rdfs:comment "plain literals with a language tag have a rdf:langString datatype" ;
dawgt:approval dawgt:Proposed ;
mf:action [ qt:query <langstring-datatype.rq> ] ;
mf:result <langstring-datatype.srj> .

:plain-string-datatype rdf:type mf:QueryEvaluationTest ;
mf:name "DATATYPE on plain string literal";
rdfs:comment "plain literals without a language tag have the xsd:string datatype" ;
Comment on lines +20 to +27
Copy link
Member

Choose a reason for hiding this comment

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

It seems like these rdfs:comment should be phrased alike, either have a ... datatype or have the ... datatype. I'm inclined toward the latter.

dawgt:approval dawgt:Proposed ;
mf:action [ qt:query <plain-string-datatype.rq> ] ;
mf:result <plain-string-datatype.srj> .

:plain-string-same rdf:type mf:QueryEvaluationTest ;
mf:name "xsd:string and plain literals are the same";
rdfs:comment "xsd:string literals are the same as literals without datatypes" ;
dawgt:approval dawgt:Proposed ;
mf:action [ qt:query <plain-string-same.rq> ] ;
mf:result <plain-string-same.srj> .
1 change: 1 addition & 0 deletions sparql/sparql12/rdf11/plain-string-datatype.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SELECT (DATATYPE("foo") AS ?dt) WHERE {}
12 changes: 12 additions & 0 deletions sparql/sparql12/rdf11/plain-string-datatype.srj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"head": {
"vars": [ "dt" ]
},
"results": {
"bindings": [
{
"dt": { "type": "uri", "value": "http://www.w3.org/2001/XMLSchema#string" }
}
]
}
}
2 changes: 2 additions & 0 deletions sparql/sparql12/rdf11/plain-string-same.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK { FILTER(sameTerm("foo", "foo"^^xsd:string)) }
4 changes: 4 additions & 0 deletions sparql/sparql12/rdf11/plain-string-same.srj
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"head": {},
"boolean": true
}