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

SPARQL tests rooted at sparql #90

Merged
merged 2 commits into from
Feb 17, 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 15 additions & 0 deletions sparql/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SPARQL Test Suite

Community maintained at https://github.com/w3c/rdf-tests/sparql

This area contains the SPARQL test suites
with updates agreed by the community.

* [sparql12](sparql12/) -- coming soon!
* [sparql11](sparql11/)
* [sparql10](sparql10/)

The original test from the working groups are:

* [sparql10](sparql10/) -- RDF Data Access WG (DAWG) -- http://www.w3.org/2001/sw/DataAccess/
* [sparql11](sparql11/) -- SPARQL WG -- https://www.w3.org/groups/wg/sparql
21 changes: 21 additions & 0 deletions sparql/sparql10/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
All tests materials are licensed under the W3C Software Notice and License, as follows:
____________________________________
W3C� SOFTWARE NOTICE AND LICENSE
http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231

This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license. By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.

Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:

1. The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
2. Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
3. Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)

THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION 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 SOFTWARE OR DOCUMENTATION.

The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.

____________________________________

16 changes: 16 additions & 0 deletions sparql/sparql10/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Data Access Working Group SPARQL Query Language test suite reorganization

This directory contains restructured copies of tests from
the DAWG test suite (available at
http://www.w3.org/2001/sw/DataAccess/tests/data/). The purpose of this
restructuring is to enhance usability, clear away obsolete tests and
provide an up-to-date, consistent and easy to use suite of test cases
that SPARQL query language implementors can use to evaluate their
implementation.


The Working Group decided
(http://lists.w3.org/Archives/Public/public-rdf-dawg/2007JulSep/att-0096/21-dawg-minutes.html#item05)
on 21 Aug 2007 that the tests as-is constitute a test suite that the group will
use to generate an implementation report for the SPARQL Query Language for
RDF.
112 changes: 112 additions & 0 deletions sparql/sparql10/algebra-expressions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
I. LeftJoin(BGP(..),{..})
II. Join(BGP(..),Graph(varOrIRI,{..}))
III. Join(BGP(..),Union(..,..))
IV. Graph(varOrIRI,{..})
V. LeftJoin({},{..})
VI. Union(..,..)
VII. BGP(..)
Join(I.,I.) => Join(LeftJoin(BGP(..),{..}),LeftJoin(BGP(..),{..}))
Union(I.,I.) => Union(LeftJoin(BGP(..),{..}),LeftJoin(BGP(..),{..}))
LeftJoin(I.,I.) => LeftJoin(LeftJoin(BGP(..),{..}),LeftJoin(BGP(..),{..}))
Join(I.,II.) => Join(LeftJoin(BGP(..),{..}),Join(BGP(..),Graph(varOrIRI,{..})))
Union(I.,II.) => Union(LeftJoin(BGP(..),{..}),Join(BGP(..),Graph(varOrIRI,{..})))
LeftJoin(I.,II.) => LeftJoin(LeftJoin(BGP(..),{..}),Join(BGP(..),Graph(varOrIRI,{..})))
Join(I.,III.) => Join(LeftJoin(BGP(..),{..}),Join(BGP(..),Union(..,..)))
Union(I.,III.) => Union(LeftJoin(BGP(..),{..}),Join(BGP(..),Union(..,..)))
LeftJoin(I.,III.) => LeftJoin(LeftJoin(BGP(..),{..}),Join(BGP(..),Union(..,..)))
Join(I.,IV.) => Join(LeftJoin(BGP(..),{..}),Graph(varOrIRI,{..}))
Union(I.,IV.) => Union(LeftJoin(BGP(..),{..}),Graph(varOrIRI,{..}))
LeftJoin(I.,IV.) => LeftJoin(LeftJoin(BGP(..),{..}),Graph(varOrIRI,{..}))
Join(I.,V.) => Join(LeftJoin(BGP(..),{..}),LeftJoin({},{..}))
Union(I.,V.) => Union(LeftJoin(BGP(..),{..}),LeftJoin({},{..}))
LeftJoin(I.,V.) => LeftJoin(LeftJoin(BGP(..),{..}),LeftJoin({},{..}))
Join(I.,VI.) => Join(LeftJoin(BGP(..),{..}),Union(..,..))
Union(I.,VI.) => Union(LeftJoin(BGP(..),{..}),Union(..,..))
LeftJoin(I.,VI.) => LeftJoin(LeftJoin(BGP(..),{..}),Union(..,..))
Join(I.,VII.) => Join(LeftJoin(BGP(..),{..}),BGP(..))
Union(I.,VII.) => Union(LeftJoin(BGP(..),{..}),BGP(..))
LeftJoin(I.,VII.) => LeftJoin(LeftJoin(BGP(..),{..}),BGP(..))
LeftJoin(II.,I.) => LeftJoin(Join(BGP(..),Graph(varOrIRI,{..})),LeftJoin(BGP(..),{..}))
Join(II.,II.) => Join(Join(BGP(..),Graph(varOrIRI,{..})),Join(BGP(..),Graph(varOrIRI,{..})))
Union(II.,II.) => Union(Join(BGP(..),Graph(varOrIRI,{..})),Join(BGP(..),Graph(varOrIRI,{..})))
LeftJoin(II.,II.) => LeftJoin(Join(BGP(..),Graph(varOrIRI,{..})),Join(BGP(..),Graph(varOrIRI,{..})))
Join(II.,III.) => Join(Join(BGP(..),Graph(varOrIRI,{..})),Join(BGP(..),Union(..,..)))
Union(II.,III.) => Union(Join(BGP(..),Graph(varOrIRI,{..})),Join(BGP(..),Union(..,..)))
LeftJoin(II.,III.) => LeftJoin(Join(BGP(..),Graph(varOrIRI,{..})),Join(BGP(..),Union(..,..)))
Join(II.,IV.) => Join(Join(BGP(..),Graph(varOrIRI,{..})),Graph(varOrIRI,{..}))
Union(II.,IV.) => Union(Join(BGP(..),Graph(varOrIRI,{..})),Graph(varOrIRI,{..}))
LeftJoin(II.,IV.) => LeftJoin(Join(BGP(..),Graph(varOrIRI,{..})),Graph(varOrIRI,{..}))
Join(II.,V.) => Join(Join(BGP(..),Graph(varOrIRI,{..})),LeftJoin({},{..}))
Union(II.,V.) => Union(Join(BGP(..),Graph(varOrIRI,{..})),LeftJoin({},{..}))
LeftJoin(II.,V.) => LeftJoin(Join(BGP(..),Graph(varOrIRI,{..})),LeftJoin({},{..}))
Join(II.,VI.) => Join(Join(BGP(..),Graph(varOrIRI,{..})),Union(..,..))
Union(II.,VI.) => Union(Join(BGP(..),Graph(varOrIRI,{..})),Union(..,..))
LeftJoin(II.,VI.) => LeftJoin(Join(BGP(..),Graph(varOrIRI,{..})),Union(..,..))
Join(II.,VII.) => Join(Join(BGP(..),Graph(varOrIRI,{..})),BGP(..))
Union(II.,VII.) => Union(Join(BGP(..),Graph(varOrIRI,{..})),BGP(..))
LeftJoin(II.,VII.) => LeftJoin(Join(BGP(..),Graph(varOrIRI,{..})),BGP(..))
LeftJoin(III.,I.) => LeftJoin(Join(BGP(..),Union(..,..)),LeftJoin(BGP(..),{..}))
LeftJoin(III.,II.) => LeftJoin(Join(BGP(..),Union(..,..)),Join(BGP(..),Graph(varOrIRI,{..})))
Join(III.,III.) => Join(Join(BGP(..),Union(..,..)),Join(BGP(..),Union(..,..)))
Union(III.,III.) => Union(Join(BGP(..),Union(..,..)),Join(BGP(..),Union(..,..)))
LeftJoin(III.,III.) => LeftJoin(Join(BGP(..),Union(..,..)),Join(BGP(..),Union(..,..)))
Join(III.,IV.) => Join(Join(BGP(..),Union(..,..)),Graph(varOrIRI,{..}))
Union(III.,IV.) => Union(Join(BGP(..),Union(..,..)),Graph(varOrIRI,{..}))
LeftJoin(III.,IV.) => LeftJoin(Join(BGP(..),Union(..,..)),Graph(varOrIRI,{..}))
Join(III.,V.) => Join(Join(BGP(..),Union(..,..)),LeftJoin({},{..}))
Union(III.,V.) => Union(Join(BGP(..),Union(..,..)),LeftJoin({},{..}))
LeftJoin(III.,V.) => LeftJoin(Join(BGP(..),Union(..,..)),LeftJoin({},{..}))
Join(III.,VI.) => Join(Join(BGP(..),Union(..,..)),Union(..,..))
Union(III.,VI.) => Union(Join(BGP(..),Union(..,..)),Union(..,..))
LeftJoin(III.,VI.) => LeftJoin(Join(BGP(..),Union(..,..)),Union(..,..))
Join(III.,VII.) => Join(Join(BGP(..),Union(..,..)),BGP(..))
Union(III.,VII.) => Union(Join(BGP(..),Union(..,..)),BGP(..))
LeftJoin(III.,VII.) => LeftJoin(Join(BGP(..),Union(..,..)),BGP(..))
LeftJoin(IV.,I.) => LeftJoin(Graph(varOrIRI,{..}),LeftJoin(BGP(..),{..}))
LeftJoin(IV.,II.) => LeftJoin(Graph(varOrIRI,{..}),Join(BGP(..),Graph(varOrIRI,{..})))
LeftJoin(IV.,III.) => LeftJoin(Graph(varOrIRI,{..}),Join(BGP(..),Union(..,..)))
Join(IV.,IV.) => Join(Graph(varOrIRI,{..}),Graph(varOrIRI,{..}))
Union(IV.,IV.) => Union(Graph(varOrIRI,{..}),Graph(varOrIRI,{..}))
LeftJoin(IV.,IV.) => LeftJoin(Graph(varOrIRI,{..}),Graph(varOrIRI,{..}))
Join(IV.,V.) => Join(Graph(varOrIRI,{..}),LeftJoin({},{..}))
Union(IV.,V.) => Union(Graph(varOrIRI,{..}),LeftJoin({},{..}))
LeftJoin(IV.,V.) => LeftJoin(Graph(varOrIRI,{..}),LeftJoin({},{..}))
Join(IV.,VI.) => Join(Graph(varOrIRI,{..}),Union(..,..))
Union(IV.,VI.) => Union(Graph(varOrIRI,{..}),Union(..,..))
LeftJoin(IV.,VI.) => LeftJoin(Graph(varOrIRI,{..}),Union(..,..))
Join(IV.,VII.) => Join(Graph(varOrIRI,{..}),BGP(..))
Union(IV.,VII.) => Union(Graph(varOrIRI,{..}),BGP(..))
LeftJoin(IV.,VII.) => LeftJoin(Graph(varOrIRI,{..}),BGP(..))
LeftJoin(V.,I.) => LeftJoin(LeftJoin({},{..}),LeftJoin(BGP(..),{..}))
LeftJoin(V.,II.) => LeftJoin(LeftJoin({},{..}),Join(BGP(..),Graph(varOrIRI,{..})))
LeftJoin(V.,III.) => LeftJoin(LeftJoin({},{..}),Join(BGP(..),Union(..,..)))
LeftJoin(V.,IV.) => LeftJoin(LeftJoin({},{..}),Graph(varOrIRI,{..}))
Join(V.,V.) => Join(LeftJoin({},{..}),LeftJoin({},{..}))
Union(V.,V.) => Union(LeftJoin({},{..}),LeftJoin({},{..}))
LeftJoin(V.,V.) => LeftJoin(LeftJoin({},{..}),LeftJoin({},{..}))
Join(V.,VI.) => Join(LeftJoin({},{..}),Union(..,..))
Union(V.,VI.) => Union(LeftJoin({},{..}),Union(..,..))
LeftJoin(V.,VI.) => LeftJoin(LeftJoin({},{..}),Union(..,..))
Join(V.,VII.) => Join(LeftJoin({},{..}),BGP(..))
Union(V.,VII.) => Union(LeftJoin({},{..}),BGP(..))
LeftJoin(V.,VII.) => LeftJoin(LeftJoin({},{..}),BGP(..))
LeftJoin(VI.,I.) => LeftJoin(Union(..,..),LeftJoin(BGP(..),{..}))
LeftJoin(VI.,II.) => LeftJoin(Union(..,..),Join(BGP(..),Graph(varOrIRI,{..})))
LeftJoin(VI.,III.) => LeftJoin(Union(..,..),Join(BGP(..),Union(..,..)))
LeftJoin(VI.,IV.) => LeftJoin(Union(..,..),Graph(varOrIRI,{..}))
LeftJoin(VI.,V.) => LeftJoin(Union(..,..),LeftJoin({},{..}))
Join(VI.,VI.) => Join(Union(..,..),Union(..,..))
Union(VI.,VI.) => Union(Union(..,..),Union(..,..))
LeftJoin(VI.,VI.) => LeftJoin(Union(..,..),Union(..,..))
Join(VI.,VII.) => Join(Union(..,..),BGP(..))
Union(VI.,VII.) => Union(Union(..,..),BGP(..))
LeftJoin(VI.,VII.) => LeftJoin(Union(..,..),BGP(..))
LeftJoin(VII.,I.) => LeftJoin(BGP(..),LeftJoin(BGP(..),{..}))
LeftJoin(VII.,II.) => LeftJoin(BGP(..),Join(BGP(..),Graph(varOrIRI,{..})))
LeftJoin(VII.,III.) => LeftJoin(BGP(..),Join(BGP(..),Union(..,..)))
LeftJoin(VII.,IV.) => LeftJoin(BGP(..),Graph(varOrIRI,{..}))
LeftJoin(VII.,V.) => LeftJoin(BGP(..),LeftJoin({},{..}))
LeftJoin(VII.,VI.) => LeftJoin(BGP(..),Union(..,..))
Join(VII.,VII.) => Join(BGP(..),BGP(..))
Union(VII.,VII.) => Union(BGP(..),BGP(..))
LeftJoin(VII.,VII.) => LeftJoin(BGP(..),BGP(..))
5 changes: 5 additions & 0 deletions sparql/sparql10/algebra/data-1.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@prefix : <http://example/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

:x :p "1"^^xsd:integer .

11 changes: 11 additions & 0 deletions sparql/sparql10/algebra/data-2.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@prefix : <http://example/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

:x :p "1"^^xsd:integer .
:x :p "2"^^xsd:integer .
:x :p "3"^^xsd:integer .
:x :p "4"^^xsd:integer .

:x :q "1"^^xsd:integer .
:x :q "2"^^xsd:integer .
:x :q "3"^^xsd:integer .
4 changes: 4 additions & 0 deletions sparql/sparql10/algebra/filter-nested-1.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PREFIX : <http://example/>

SELECT ?v
{ :x :p ?v . FILTER(?v = 1) }
16 changes: 16 additions & 0 deletions sparql/sparql10/algebra/filter-nested-1.srx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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#" >
<head>
<variable name="v"/>
</head>
<results>
<result>
<binding name="v">
<literal datatype="http://www.w3.org/2001/XMLSchema#integer">1</literal>
</binding>
</result>
</results>
</sparql>
4 changes: 4 additions & 0 deletions sparql/sparql10/algebra/filter-nested-2.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PREFIX : <http://example/>

SELECT ?v
{ :x :p ?v . { FILTER(?v = 1) } }
11 changes: 11 additions & 0 deletions sparql/sparql10/algebra/filter-nested-2.srx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?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#" >
<head>
<variable name="v"/>
</head>
<results>
</results>
</sparql>
7 changes: 7 additions & 0 deletions sparql/sparql10/algebra/filter-placement-1.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
PREFIX : <http://example/>

SELECT ?v
{
?s :p ?v .
FILTER (?v = 2)
}
16 changes: 16 additions & 0 deletions sparql/sparql10/algebra/filter-placement-1.srx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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#" >
<head>
<variable name="v"/>
</head>
<results>
<result>
<binding name="v">
<literal datatype="http://www.w3.org/2001/XMLSchema#integer">2</literal>
</binding>
</result>
</results>
</sparql>
7 changes: 7 additions & 0 deletions sparql/sparql10/algebra/filter-placement-2.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
PREFIX : <http://example/>

SELECT ?v
{
FILTER (?v = 2)
?s :p ?v .
}
16 changes: 16 additions & 0 deletions sparql/sparql10/algebra/filter-placement-2.srx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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#" >
<head>
<variable name="v"/>
</head>
<results>
<result>
<binding name="v">
<literal datatype="http://www.w3.org/2001/XMLSchema#integer">2</literal>
</binding>
</result>
</results>
</sparql>
9 changes: 9 additions & 0 deletions sparql/sparql10/algebra/filter-placement-3.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PREFIX : <http://example/>

SELECT ?v ?w
{
FILTER (?v = 2)
FILTER (?w = 3)
?s :p ?v .
?s :q ?w .
}
20 changes: 20 additions & 0 deletions sparql/sparql10/algebra/filter-placement-3.srx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?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#" >
<head>
<variable name="v"/>
<variable name="w"/>
</head>
<results>
<result>
<binding name="v">
<literal datatype="http://www.w3.org/2001/XMLSchema#integer">2</literal>
</binding>
<binding name="w">
<literal datatype="http://www.w3.org/2001/XMLSchema#integer">3</literal>
</binding>
</result>
</results>
</sparql>
9 changes: 9 additions & 0 deletions sparql/sparql10/algebra/filter-scope-1.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PREFIX : <http://example/>

SELECT *
{
:x :p ?v .
{ :x :q ?w
OPTIONAL { :x :p ?v2 FILTER(?v = 1) }
}
}
Loading