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

Update data-r2 to be SPARQL 1.1 compatible #83

Merged
merged 2 commits into from
Feb 5, 2023
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
9 changes: 7 additions & 2 deletions sparql11/data-r2/basic/term-6.rq
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
PREFIX : <http://example.org/ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

# DOT is part of the decimal.
SELECT * { :x ?p 456. }
# SPARQL 1.0 - abbreviated decimal did not need to have digit after the DOT.

# Updated for SPARQL 1.1 (RDF 1.1, XSD 1.1)
SELECT * { :x ?p "456."^^xsd:decimal }

# SPARQL 1.0 : DOT is part of the decimal.
## SELECT * { :x ?p 456. }
10 changes: 8 additions & 2 deletions sparql11/data-r2/basic/term-7.rq
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
PREFIX : <http://example.org/ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
# Duplicate of term-6.rq

# DOT is part of the decimal.
SELECT * { :x ?p 456. . }
# SPARQL 1.0 - abbreviated decimal did not need to have digit after the DOT.

# Updated for SPARQL 1.1 (RDF 1.1, XSD 1.1)
SELECT * { :x ?p "456."^^xsd:decimal }

# SPARQL 1.0 : DOT is part of the decimal.
## SELECT * { :x ?p 456. }
46 changes: 14 additions & 32 deletions sparql11/data-r2/distinct/distinct-all.srx
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
<?xml version="1.0"?>
<sparql
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xs="http://www.w3.org/2001/XMLSchema#"
xmlns="http://www.w3.org/2005/sparql-results#" >
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
<head>
<variable name="v"/>
</head>
<results>
<result>
<binding name="v">
<literal datatype="http://www.w3.org/2001/XMLSchema#string">ABC</literal>
<literal datatype="http://www.w3.org/2001/XMLSchema#decimal">01.0</literal>
</binding>
</result>
<result>
<binding name="v">
<literal datatype="http://www.w3.org/2001/XMLSchema#float">1.3e0</literal>
<literal xml:lang="en"></literal>
</binding>
</result>
<result>
<binding name="v">
<literal datatype="http://www.w3.org/2001/XMLSchema#string">abc</literal>
<literal></literal>
</binding>
</result>
<result>
Expand All @@ -29,47 +26,47 @@
</result>
<result>
<binding name="v">
<literal xml:lang="en">ABC</literal>
<literal datatype="http://www.w3.org/2001/XMLSchema#integer">01</literal>
</binding>
</result>
<result>
<binding name="v">
<literal datatype="http://www.w3.org/2001/XMLSchema#integer">+1</literal>
<literal>ABC</literal>
</binding>
</result>
<result>
<binding name="v">
<literal datatype="http://www.w3.org/2001/XMLSchema#decimal">01.0</literal>
<literal datatype="http://www.w3.org/2001/XMLSchema#decimal">1.0</literal>
</binding>
</result>
<result>
<binding name="v">
<literal>ABC</literal>
<literal datatype="http://www.w3.org/2001/XMLSchema#decimal">+1.0</literal>
</binding>
</result>
<result>
<binding name="v">
<literal datatype="http://www.w3.org/2001/XMLSchema#integer">01</literal>
<literal datatype="http://www.w3.org/2001/XMLSchema#double">1.0e0</literal>
</binding>
</result>
<result>
<binding name="v">
<literal datatype="http://www.w3.org/2001/XMLSchema#string"></literal>
<literal datatype="http://www.w3.org/2001/XMLSchema#float">1.3e0</literal>
</binding>
</result>
<result>
<binding name="v">
<literal datatype="http://www.w3.org/2001/XMLSchema#double">1.0e0</literal>
<literal datatype="http://www.w3.org/2001/XMLSchema#integer">+1</literal>
</binding>
</result>
<result>
<binding name="v">
<literal datatype="http://www.w3.org/2001/XMLSchema#decimal">+1.0</literal>
<literal xml:lang="en">ABC</literal>
</binding>
</result>
<result>
<binding name="v">
<literal xml:lang="en">abc</literal>
<literal>abc</literal>
</binding>
</result>
<result>
Expand All @@ -79,12 +76,7 @@
</result>
<result>
<binding name="v">
<literal xml:lang="en"></literal>
</binding>
</result>
<result>
<binding name="v">
<literal datatype="http://www.w3.org/2001/XMLSchema#decimal">1.0</literal>
<literal xml:lang="en">abc</literal>
</binding>
</result>
<result>
Expand All @@ -97,15 +89,5 @@
<uri>http://example/z1</uri>
</binding>
</result>
<result>
<binding name="v">
<literal>abc</literal>
</binding>
</result>
<result>
<binding name="v">
<literal></literal>
</binding>
</result>
</results>
</sparql>
28 changes: 5 additions & 23 deletions sparql11/data-r2/distinct/distinct-str.srx
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
<?xml version="1.0"?>
<sparql
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xs="http://www.w3.org/2001/XMLSchema#"
xmlns="http://www.w3.org/2005/sparql-results#" >
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
<head>
<variable name="v"/>
</head>
<results>
<result>
<binding name="v">
<literal datatype="http://www.w3.org/2001/XMLSchema#string">ABC</literal>
</binding>
</result>
<result>
<binding name="v">
<literal datatype="http://www.w3.org/2001/XMLSchema#string">abc</literal>
<literal xml:lang="en"></literal>
</binding>
</result>
<result>
<binding name="v">
<literal xml:lang="en">ABC</literal>
<literal></literal>
</binding>
</result>
<result>
Expand All @@ -29,17 +21,7 @@
</result>
<result>
<binding name="v">
<literal datatype="http://www.w3.org/2001/XMLSchema#string"></literal>
</binding>
</result>
<result>
<binding name="v">
<literal xml:lang="en">abc</literal>
</binding>
</result>
<result>
<binding name="v">
<literal xml:lang="en"></literal>
<literal xml:lang="en">ABC</literal>
</binding>
</result>
<result>
Expand All @@ -49,7 +31,7 @@
</result>
<result>
<binding name="v">
<literal></literal>
<literal xml:lang="en">abc</literal>
</binding>
</result>
</results>
Expand Down
20 changes: 11 additions & 9 deletions sparql11/data-r2/expr-builtin/result-datatype-2.srx
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
<?xml version="1.0"?>
<sparql
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xs="http://www.w3.org/2001/XMLSchema#"
xmlns="http://www.w3.org/2005/sparql-results#" >
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
<head>
<variable name="x"/>
</head>
<results ordered="false" distinct="false">
<results>
<result>
<binding name="x">
<uri>http://example/x1</uri>
<uri>http://example/x4</uri>
</binding>
</result>
<result>
<binding name="x">
<uri>http://example/x2</uri>
<uri>http://example/x5</uri>
</binding>
</result>
<result>
<binding name="x">
<uri>http://example/x4</uri>
<uri>http://example/x3</uri>
</binding>
</result>
<result>
<binding name="x">
<uri>http://example/x5</uri>
<uri>http://example/x2</uri>
</binding>
</result>
<result>
<binding name="x">
<uri>http://example/x1</uri>
</binding>
</result>
</results>
Expand Down
13 changes: 11 additions & 2 deletions sparql11/data-r2/optional-filter/manifest.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@
rdfs:label "OPTIONAL FILTER" ;
rdfs:comment "OPTIONAL with inner and outer FILTERs" ;
mf:entries
(:dawg-optional-filter-001 :dawg-optional-filter-002 :dawg-optional-filter-003 :dawg-optional-filter-004 :dawg-optional-filter-005-simplified :dawg-optional-filter-005-not-simplified).

(
:dawg-optional-filter-001
:dawg-optional-filter-002
:dawg-optional-filter-003
:dawg-optional-filter-004
## Ambiguity in SPARQL 1.0
##:dawg-optional-filter-005-simplified
## Preferred reading and SPARQL 1.1:
:dawg-optional-filter-005-not-simplified
).

:dawg-optional-filter-001 a mf:QueryEvaluationTest ;
mf:name "OPTIONAL-FILTER" ;
rdfs:comment "FILTER inside an OPTIONAL does not block an entire solution" ;
Expand Down
7 changes: 6 additions & 1 deletion sparql11/data-r2/syntax-sparql1/syntax-lit-08.rq
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
BASE <http://example.org/>
PREFIX : <#>
SELECT * WHERE { :x :p 123. . }

## Legal in SPARQL 1.0
##SELECT * WHERE { :x :p 123. . }

## SPARQL 1.1 (and RDF 1.1 Turtle, and XSD 1.1).
SELECT * WHERE { :x :p 123.0 . }
4 changes: 3 additions & 1 deletion sparql11/data-r2/syntax-sparql2/syntax-esc-04.rq
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
PREFIX : <http://example/>
SELECT *
WHERE { <\u0078> :\u0070 ?xx\u0078 }
## Community: \ u escapes in URIs and strings only.
## U+0078 is 'x'
WHERE { <\u0078> :p "xx\u0078" }
4 changes: 2 additions & 2 deletions sparql11/data-r2/syntax-sparql2/syntax-esc-05.rq
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PREFIX : <http://example/>
SELECT *
# Comments can contain \ u
## Community: \ u escapes in URIs and strings only.
# <\u0078> :\u0070 ?xx\u0078
WHERE { <\u0078> :\u0070 ?xx\u0078 }
WHERE { <\u0078> :p "xx\u0078" }