[redland-dev] Parsing ntriples from a string

DeeJay-G615 deejay at g615.co.uk
Thu Aug 17 03:56:38 UTC 2006


Ok, I've spent the last day trying to debug this and I finally have some 
results.

I have no problems parsing rdf content, my Haskell version of example2.c 
works fine. I also have had no issues with n-triples accessed from 
URI's. Works fine with 
http://www.w3.org/2000/10/rdf-tests/rdfcore/amp-in-url/test001.nt.

However I seem to have run into major issues when trying to parse 
n-triples from strings. When I copy the the triple from the URL above I 
can neither parse it to a stream or into a model. The ntriples triple is 
"<http://example/q?abc=1&def=2> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#value> \"xxx\" ."

If I pass a null as a base URI, redland fails internally and indicates 
with the return value (null for the stream version and !=0 for the model 
version), but it doesn't call the logging callback.

If I pass a valid URI as the base URI the procedure returns normally but 
calls the logging function with code = 0, level = ERROR, facility = 
PARSER, message = "Junk at end of input.\""

I have found this to be the case with both 
librdf_parser_parse_string_as_stream and 
librdf_parser_parse_string_into_model. Using the counted string versions 
don't make any difference.

I am using the 1.0.3 Win32 Dev version. (I lament not being at home with 
my linux desktop).

Thanks, DeeJay


More information about the redland-dev mailing list