drobilla / serd

A lightweight C library for RDF syntax
https://gitlab.com/drobilla/serd
ISC License
88 stars 16 forks source link

Bug: serd_reader_read_chunk does not support NQuads #42

Closed mcb5637 closed 1 year ago

mcb5637 commented 1 year ago

The following code does not properly read NQuads (Graph is always null):

auto* r = serd_reader_new(...);
serd_reader_start_source_stream(...);
while (serd_reader_read_chunk(...) ...) {...};

(Reading a file directly via serd_reader_read_file_handle works, but reading via a simple adaptor from a c++ std::istream to serd_reader_read_chunk does not)

Possible cause: serd_reader_read_chunk calls read_statement which calls read_n3_statement direcly, without checking the readers syntax mode.

drobilla commented 1 year ago

Fixed in 4196ab792, thanks.

Please let me know if this is working as expected in your situation.

mcb5637 commented 1 year ago

Yes, does work now. Thanks for the fast fix.