Skip to content

Commit

Permalink
SPARQL 1.1: Adds tests for inverse properties inside NegatedPropertyTest
Browse files Browse the repository at this point in the history
This feature is in the specification but not covered by the testsuite
  • Loading branch information
Tpt authored and afs committed May 24, 2023
1 parent 9d70ac9 commit 610f046
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 0 deletions.
17 changes: 17 additions & 0 deletions sparql/sparql11/property-path/manifest.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
:pp37

:values_and_path
:nps_inverse
:nps_direct_and_inverse
) .


Expand Down Expand Up @@ -294,3 +296,18 @@
[ qt:query <values_and_path.rq> ;
qt:data <empty.ttl> ] ;
mf:result <values_and_path.srx> .

:nps_inverse rdf:type mf:QueryEvaluationTest ;
mf:name "Negated Property Set with inverse properties" ;
mf:action
[ qt:query <nps_inverse.rq> ;
qt:data <nps_inverse.ttl> ] ;
mf:result <nps_inverse.srx> .


:nps_direct_and_inverse rdf:type mf:QueryEvaluationTest ;
mf:name "Negated Property Set with both direct and inverse properties" ;
mf:action
[ qt:query <nps_direct_and_inverse.rq> ;
qt:data <nps_direct_and_inverse.ttl> ] ;
mf:result <nps_direct_and_inverse.srx> .
4 changes: 4 additions & 0 deletions sparql/sparql11/property-path/nps_direct_and_inverse.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PREFIX ex: <http://example.org/>
SELECT ?s ?o WHERE {
?s !(ex:pd|^ex:pr) ?o
}
25 changes: 25 additions & 0 deletions sparql/sparql11/property-path/nps_direct_and_inverse.srx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
<head>
<variable name="s"/>
<variable name="o"/>
</head>
<results>
<result>
<binding name="s">
<uri>http://example.org/od</uri>
</binding>
<binding name="o">
<uri>http://example.org/sd</uri>
</binding>
</result>
<result>
<binding name="s">
<uri>http://example.org/sr</uri>
</binding>
<binding name="o">
<uri>http://example.org/or</uri>
</binding>
</result>
</results>
</sparql>
3 changes: 3 additions & 0 deletions sparql/sparql11/property-path/nps_direct_and_inverse.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@prefix ex: <http://example.org/> .
ex:sd ex:pd ex:od .
ex:sr ex:pr ex:or .
4 changes: 4 additions & 0 deletions sparql/sparql11/property-path/nps_inverse.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PREFIX ex: <http://example.org/>
SELECT ?s ?o WHERE {
?s !^ex:pr ?o
}
17 changes: 17 additions & 0 deletions sparql/sparql11/property-path/nps_inverse.srx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
<head>
<variable name="s"/>
<variable name="o"/>
</head>
<results>
<result>
<binding name="s">
<uri>http://example.org/od</uri>
</binding>
<binding name="o">
<uri>http://example.org/sd</uri>
</binding>
</result>
</results>
</sparql>
3 changes: 3 additions & 0 deletions sparql/sparql11/property-path/nps_inverse.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@prefix ex: <http://example.org/> .
ex:sd ex:pd ex:od .
ex:sr ex:pr ex:or .

0 comments on commit 610f046

Please sign in to comment.