summaryrefslogtreecommitdiff
path: root/test/DAWG
diff options
context:
space:
mode:
authorGunnar Aastrand Grimnes <gromgull@gmail.com>2013-07-27 22:56:26 +0200
committerGunnar Aastrand Grimnes <gromgull@gmail.com>2013-07-27 22:59:05 +0200
commitfffe435b855120ddc530ddb149090661ad99fd13 (patch)
tree50af657603b546497757dcc9f589342b690b9f0e /test/DAWG
parent5f7ee692192acb94a0d484e10a4a0beec5beedde (diff)
downloadrdflib-fffe435b855120ddc530ddb149090661ad99fd13.tar.gz
fixed sparql parser bug with pnames followed by a dot
Previously, bugs would occur when triple-patterne did not have whitespace between a pname and the terminating dot: ?s ?p foaf:knows. would parse into a uriref of "http://xmlns.com/foaf/0.1/knows." The optional clause of the PN_LOCAL production was in the wrong place, fixing it was non-trivial, since pyparsing cannot backtrack. I replaced the whole production with a regex, parsing pnames should now also be much faster (not that it matters greatly) Thanks to balkian on irc for spotting!
Diffstat (limited to 'test/DAWG')
-rw-r--r--test/DAWG/rdflib/manifest.ttl16
-rw-r--r--test/DAWG/rdflib/whitespacedot.rq7
2 files changed, 19 insertions, 4 deletions
diff --git a/test/DAWG/rdflib/manifest.ttl b/test/DAWG/rdflib/manifest.ttl
index dcefceed..63b884ad 100644
--- a/test/DAWG/rdflib/manifest.ttl
+++ b/test/DAWG/rdflib/manifest.ttl
@@ -10,10 +10,11 @@
<> a mf:Manifest ;
rdfs:label "RDFLib Extra SPARQL tests" ;
mf:entries
- (
- :unicode
- :nestedbnode
- ) .
+ (
+ :unicode
+ :nestedbnode
+ :whitespacedot
+ ) .
:opt-subquery rdf:type mf:QueryEvaluationTest ;
@@ -45,3 +46,10 @@
[ qt:query <nestedbnode.rq> ] ;
mf:result <nestedbnode.srx>
.
+
+:whitespacedot rdf:type mf:PositiveSyntaxTest11 ;
+ mf:name "Dot without whitespace after triple-pattern";
+ dawgt:approval dawgt:Approved ;
+ dawgt:approvedBy <http://gromgull.net/me> ;
+ mf:action <whitespacedot.rq>
+ .
diff --git a/test/DAWG/rdflib/whitespacedot.rq b/test/DAWG/rdflib/whitespacedot.rq
new file mode 100644
index 00000000..f6552ca6
--- /dev/null
+++ b/test/DAWG/rdflib/whitespacedot.rq
@@ -0,0 +1,7 @@
+prefix : <urn:p:>
+select * where {
+ ?s ?p ?o.
+ ?s ?p "".
+ ?s ?p <urn:a>.
+ ?s ?p :a.
+}