aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-05-25 21:59:11 +0200
committerDavid Robillard <d@drobilla.net>2018-05-25 22:00:19 +0200
commit85dd5c18ff8b78fbd73062498bad563e76c22645 (patch)
treeaa8524c83fbf1b0c02f329f93352ac9bc3d9e301
parent0179f024aafea7f49a5abb459fa12a4ab2495b99 (diff)
downloadserd-85dd5c18ff8b78fbd73062498bad563e76c22645.tar.gz
serd-85dd5c18ff8b78fbd73062498bad563e76c22645.tar.bz2
serd-85dd5c18ff8b78fbd73062498bad563e76c22645.zip
Fix reported error when reading statements with only a blank node
-rw-r--r--NEWS1
-rw-r--r--src/n3.c2
-rw-r--r--tests/good/manifest.nt64
-rw-r--r--tests/good/manifest.ttl9
4 files changed, 45 insertions, 31 deletions
diff --git a/NEWS b/NEWS
index 3126d8b2..101aaeea 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
serd (0.29.3) unstable;
+ * Fix reported error when reading statements with only a blank node
* Fix parsing local names that end with escaped dots
* Add serdi option to write ASCII output
* Make serdi guess input syntax from extension if unspecified
diff --git a/src/n3.c b/src/n3.c
index fd00360b..bb8d4d9d 100644
--- a/src/n3.c
+++ b/src/n3.c
@@ -1214,7 +1214,7 @@ read_triples(SerdReader* reader, ReadContext ctx, bool* ate_dot)
switch (peek_byte(reader)) {
case '.':
*ate_dot = eat_byte_safe(reader, '.');
- return r_err(reader, SERD_ERR_BAD_SYNTAX, "syntax error\n");
+ return false;
case '}':
return false;
}
diff --git a/tests/good/manifest.nt b/tests/good/manifest.nt
index 1096208f..f39d21c1 100644
--- a/tests/good/manifest.nt
+++ b/tests/good/manifest.nt
@@ -29,62 +29,64 @@ _:b13 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw
_:b13 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b14 .
_:b14 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-blank-cont> .
_:b14 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b15 .
-_:b15 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-blankdot> .
+_:b15 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-blank-in-list> .
_:b15 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b16 .
-_:b16 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-blank-in-list> .
+_:b16 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-blank-node-statement> .
_:b16 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b17 .
-_:b17 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-bom> .
+_:b17 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-blankdot> .
_:b17 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b18 .
-_:b18 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-cr> .
+_:b18 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-bom> .
_:b18 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b19 .
-_:b19 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-delete> .
+_:b19 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-cr> .
_:b19 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b20 .
-_:b20 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-digit-start-pname> .
+_:b20 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-delete> .
_:b20 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b21 .
-_:b21 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-empty> .
+_:b21 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-digit-start-pname> .
_:b21 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b22 .
-_:b22 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-eof-at-page-end> .
+_:b22 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-empty> .
_:b22 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b23 .
-_:b23 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-escapes> .
+_:b23 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-eof-at-page-end> .
_:b23 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b24 .
-_:b24 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-ext-namedblank-iri> .
+_:b24 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-escapes> .
_:b24 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b25 .
-_:b25 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-ext-namedblank-prefix> .
+_:b25 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-ext-namedblank-iri> .
_:b25 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b26 .
-_:b26 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-id> .
+_:b26 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-ext-namedblank-prefix> .
_:b26 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b27 .
-_:b27 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-lang> .
+_:b27 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-id> .
_:b27 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b28 .
-_:b28 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-list-in-blank> .
+_:b28 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-lang> .
_:b28 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b29 .
-_:b29 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-list-subject> .
+_:b29 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-list-in-blank> .
_:b29 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b30 .
-_:b30 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-list> .
+_:b30 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-list-subject> .
_:b30 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b31 .
-_:b31 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-long-string> .
+_:b31 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-list> .
_:b31 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b32 .
-_:b32 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-no-spaces> .
+_:b32 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-long-string> .
_:b32 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b33 .
-_:b33 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-num> .
+_:b33 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-no-spaces> .
_:b33 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b34 .
-_:b34 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-out-of-range-unicode> .
+_:b34 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-num> .
_:b34 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b35 .
-_:b35 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-prefix> .
+_:b35 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-out-of-range-unicode> .
_:b35 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b36 .
-_:b36 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-pretty> .
+_:b36 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-prefix> .
_:b36 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b37 .
-_:b37 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-rel> .
+_:b37 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-pretty> .
_:b37 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b38 .
-_:b38 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-semi-dot> .
+_:b38 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-rel> .
_:b38 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b39 .
-_:b39 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-uri-escape> .
+_:b39 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-semi-dot> .
_:b39 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b40 .
-_:b40 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-uri> .
+_:b40 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-uri-escape> .
_:b40 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b41 .
-_:b41 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-utf8-uri> .
+_:b41 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-uri> .
_:b41 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b42 .
-_:b42 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#UTF-8> .
-_:b42 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:b42 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-utf8-uri> .
+_:b42 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b43 .
+_:b43 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://drobilla.net/sw/serd/tests/good/manifest.ttl#UTF-8> .
+_:b43 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
<http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-14> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/rdftest#TestTurtleEval> .
<http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-14> <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#name> "test-14" .
<http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-14> <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#action> <http://drobilla.net/sw/serd/tests/good/test-14.ttl> .
@@ -148,6 +150,10 @@ _:b42 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/
<http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-blank-in-list> <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#name> "test-blank-in-list" .
<http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-blank-in-list> <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#action> <http://drobilla.net/sw/serd/tests/good/test-blank-in-list.ttl> .
<http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-blank-in-list> <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#result> <http://drobilla.net/sw/serd/tests/good/test-blank-in-list.nt> .
+<http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-blank-node-statement> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/rdftest#TestTurtleEval> .
+<http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-blank-node-statement> <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#name> "test-blank-node-statement" .
+<http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-blank-node-statement> <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#action> <http://drobilla.net/sw/serd/tests/good/test-blank-node-statement.ttl> .
+<http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-blank-node-statement> <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#result> <http://drobilla.net/sw/serd/tests/good/test-blank-node-statement.nt> .
<http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-bom> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/rdftest#TestTurtleEval> .
<http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-bom> <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#name> "test-bom" .
<http://drobilla.net/sw/serd/tests/good/manifest.ttl#test-bom> <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#action> <http://drobilla.net/sw/serd/tests/good/test-bom.ttl> .
diff --git a/tests/good/manifest.ttl b/tests/good/manifest.ttl
index 026da87d..e3299aad 100644
--- a/tests/good/manifest.ttl
+++ b/tests/good/manifest.ttl
@@ -21,8 +21,9 @@
<#test-bad-utf8>
<#test-base-query>
<#test-blank-cont>
- <#test-blankdot>
<#test-blank-in-list>
+ <#test-blank-node-statement>
+ <#test-blankdot>
<#test-bom>
<#test-cr>
<#test-delete>
@@ -146,6 +147,12 @@
mf:action <test-blank-in-list.ttl> ;
mf:result <test-blank-in-list.nt> .
+<#test-blank-node-statement>
+ rdf:type rdft:TestTurtleEval ;
+ mf:name "test-blank-node-statement" ;
+ mf:action <test-blank-node-statement.ttl> ;
+ mf:result <test-blank-node-statement.nt> .
+
<#test-bom>
rdf:type rdft:TestTurtleEval ;
mf:name "test-bom" ;