Browse Source

Fix bug parsing TriG graphs with several squashed trailing dots

zrythm_meson
David Robillard 4 years ago
parent
commit
cb231f4767
  1. 3
      NEWS
  2. 4
      src/n3.c
  3. 7
      tests/good/manifest.ttl
  4. 3
      tests/good/test-several-eaten-dots.nq
  5. 6
      tests/good/test-several-eaten-dots.trig

3
NEWS

@ -4,8 +4,9 @@ serd (0.30.1) unstable; @@ -4,8 +4,9 @@ serd (0.30.1) unstable;
* Fix resolving some URIs against base URIs with no trailing slash
* Fix colliding blank nodes when parsing TriG
* Fix missing parse error messages
* Fix parsing TriG graphs with several squashed trailing dots
-- David Robillard <d@drobilla.net> Sun, 11 Nov 2018 11:42:57 +0100
-- David Robillard <d@drobilla.net> Sun, 17 Mar 2019 15:16:31 +0100
serd (0.30.0) stable;

4
src/n3.c

@ -1314,11 +1314,11 @@ read_directive(SerdReader* reader) @@ -1314,11 +1314,11 @@ read_directive(SerdReader* reader)
static bool
read_wrappedGraph(SerdReader* reader, ReadContext* ctx)
{
bool ate_dot = false;
char s_type = 0;
TRY_RET(eat_byte_check(reader, '{'));
read_ws_star(reader);
while (peek_byte(reader) != '}') {
bool ate_dot = false;
char s_type = 0;
ctx->subject = 0;
Ref subj = read_subject(reader, *ctx, &ctx->subject, &s_type);
if (!subj && ctx->subject) {

7
tests/good/manifest.ttl

@ -40,6 +40,7 @@ @@ -40,6 +40,7 @@
<#test-list-subject>
<#test-list>
<#test-long-string>
<#test-several-eaten-dots>
<#test-no-spaces>
<#test-non-curie-uri>
<#test-num>
@ -239,6 +240,12 @@ @@ -239,6 +240,12 @@
mf:action <test-long-string.ttl> ;
mf:result <test-long-string.nt> .
<#test-several-eaten-dots>
rdf:type rdft:TestTrigEval ;
mf:name "test-several-eaten-dots" ;
mf:action <test-several-eaten-dots.trig> ;
mf:result <test-several-eaten-dots.nq> .
<#test-no-spaces>
rdf:type rdft:TestTurtleEval ;
mf:name "test-no-spaces" ;

3
tests/good/test-several-eaten-dots.nq

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
<https://example.com/s> <https://example.com/p1> <https://example.com/o1> <https://example.com/g> .
<https://example.com/s> <https://example.com/p1> <https://example.com/o2> <https://example.com/g> .
<https://example.com/s> <https://example.com/p2> <https://example.com/o3> <https://example.com/g> .

6
tests/good/test-several-eaten-dots.trig

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
prefix : <https://example.com/>
:g {
:s :p1 :o1.
:s :p1 :o2; :p2 :o3.
}
Loading…
Cancel
Save