Skip to content

Commit

Permalink
SPARQL CONCAT(): test the empty and single cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Tpt authored and afs committed May 19, 2023
1 parent 8849d6c commit 9d70ac9
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions sparql/sparql11/functions/concat-empty.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SELECT (CONCAT() AS ?str) WHERE {}
9 changes: 9 additions & 0 deletions sparql/sparql11/functions/concat-empty.srx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
<head>
<variable name="str"/>
</head>
<results>
<result><binding name="str"><literal></literal></binding></result>
</results>
</sparql>
4 changes: 4 additions & 0 deletions sparql/sparql11/functions/concat-single.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PREFIX : <http://example.org/>
SELECT (CONCAT(?str1) AS ?str) WHERE {
:s6 :str ?str1 .
}
11 changes: 11 additions & 0 deletions sparql/sparql11/functions/concat-single.srx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
<head>
<variable name="str"/>
</head>
<results>
<result>
<binding name="str"><literal>abc</literal></binding>
</result>
</results>
</sparql>
18 changes: 18 additions & 0 deletions sparql/sparql11/functions/manifest.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
:round01
:concat01
:concat02
:concat-empty
:concat-single
:substring01
:substring01-non-bmp
:substring02
Expand Down Expand Up @@ -222,6 +224,22 @@
mf:result <concat02.srx> ;
.

:concat-empty rdf:type mf:QueryEvaluationTest ;
mf:name "CONCAT() without parameter" ;
mf:feature sparql:concat ;
mf:action
[ qt:query <concat-empty.rq> ;
qt:data <data.ttl> ] ;
mf:result <concat-empty.srx> .

:concat-single rdf:type mf:QueryEvaluationTest ;
mf:name "CONCAT() with a single parameter" ;
mf:feature sparql:concat ;
mf:action
[ qt:query <concat-single.rq> ;
qt:data <data.ttl> ] ;
mf:result <concat-single.srx> .

:substring01 rdf:type mf:QueryEvaluationTest ;
mf:name "SUBSTR() (3-argument)" ;
mf:feature sparql:substr ;
Expand Down

0 comments on commit 9d70ac9

Please sign in to comment.