Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Support integer^^uri-ref

Adds tests for this fix

Fixes Issue #0000519
http://bugs.librdf.org/mantis/view.php?id=519
  • Loading branch information...
commit 7398d9466177eb20a8e5ea27613828a4a4394454 1 parent da1a5e5
@dajobe authored
View
14 src/sparql_parser.y
@@ -2759,6 +2759,20 @@ RDFLiteral: STRING
dt_uri, NULL /* dt_qname */);
rasqal_free_literal($3);
}
+| NumericLiteral HATHAT IRIref
+{
+ if($1) {
+ raptor_uri* dt_uri = raptor_uri_copy(rasqal_literal_as_uri($3));
+ const unsigned char *str = $1->string;
+ $1->string = NULL;
+
+ $$ = rasqal_new_string_literal(((rasqal_query*)rq)->world, str,
+ NULL /* language */,
+ dt_uri, NULL /* dt_qname */);
+ }
+ rasqal_free_literal($3);
+ rasqal_free_literal($1);
+}
;
View
22 tests/sparql/bugs/519-result.ttl
@@ -0,0 +1,22 @@
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rs: <http://www.w3.org/2001/sw/DataAccess/tests/result-set#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+[] rdf:type rs:ResultSet ;
+ rs:resultVariable "a" ;
+ rs:resultVariable "b" ;
+ rs:resultVariable "c" ;
+ rs:resultVariable "d" ;
+ rs:solution [ rs:binding [ rs:variable "a" ;
+ rs:value <http://example.org/resource/a>
+ ] ;
+ rs:binding [ rs:variable "b" ;
+ rs:value <http://example.org/resource/b>
+ ] ;
+ rs:binding [ rs:variable "c" ;
+ rs:value <http://example.org/resource/c>
+ ] ;
+ rs:binding [ rs:variable "d" ;
+ rs:value <http://example.org/resource/d>
+ ]
+ ] .
View
9 tests/sparql/bugs/519.rq
@@ -0,0 +1,9 @@
+PREFIX : <http://example.org/resource/>
+
+SELECT *
+WHERE {
+ ?a :prop "1"^^<http://www.w3.org/2001/XMLSchema#int> .
+ ?b :prop 2^^<http://www.w3.org/2001/XMLSchema#int> .
+ ?c :prop "3"^^<http://www.w3.org/2001/XMLSchema#integer> .
+ ?d :prop 4^^<http://www.w3.org/2001/XMLSchema#integer> .
+}
View
6 tests/sparql/bugs/519.ttl
@@ -0,0 +1,6 @@
+@prefix : <http://example.org/resource/> .
+
+:a :prop "1"^^<http://www.w3.org/2001/XMLSchema#int> .
+:b :prop "2"^^<http://www.w3.org/2001/XMLSchema#int> .
+:c :prop "3"^^<http://www.w3.org/2001/XMLSchema#integer> .
+:d :prop "4"^^<http://www.w3.org/2001/XMLSchema#integer> .
View
9 tests/sparql/bugs/Makefile.am
@@ -23,19 +23,20 @@ MANIFEST_FILES= \
manifest.ttl
BUG_DATA_FILES= \
-352.ttl 353.ttl 354.nt 459.ttl
+352.ttl 353.ttl 354.nt 459.ttl 519.ttl
SPARQL_TEST_FILES= \
-352.rq 353.rq 354.rq 459.rq
+352.rq 353.rq 354.rq 459.rq 519.rq
SPARQL_TEST_NAMES= \
-352 353 354 459
+352 353 354 459 519
SPARQL_RESULT_FILES= \
352-result.ttl \
353-result.ttl \
354-result.ttl \
-459-result.ttl
+459-result.ttl \
+519-result.ttl
EXTRA_DIST= \
$(MANIFEST_FILES) \
View
9 tests/sparql/bugs/manifest.ttl
@@ -43,5 +43,14 @@
mf:result <459-result.ttl>
]
+ [ mf:name "519" ;
+ rdfs:comment
+ "Handling integer^^URI data" ;
+ mf:action
+ [ qt:query <519.rq> ;
+ qt:data <519.ttl> ] ;
+ mf:result <519-result.ttl>
+ ]
+
# End of tests
).
Please sign in to comment.
Something went wrong with that request. Please try again.