Upgrading the dependency for jsonld-java to 0.7.0 picks up a bug fix
(jsonld-java issue 144) that Jena has a workaround for.
The issue is that the Jackson JSON parser does not flag trailing junk.
It reads the JSON object and stops there. Worse, it creates a buffered
reader so the caller can't handle the stream afterwards.
---------------
{
"@id" : "http://example/s",
"http://example/p" : "str"
}
xxxxxxxxxxxxxxx
---------------
Jena (JsonLdReader) contains code taken from jsonld-java and modified to
run the Jackson JSON parser, produce triples and then check for trailing
junk. The detect end of junk was contributed back to the project. PR 145.
jsonld-java treats it more systematically.
If the JSON is syntactically bad in the {}, no triples merge. The
process is completely read the JSON object then let the RDF conversion
run. Bad object -> no RDF at all.
If there is trailing junk, it is detected before passing up the JSON
object so trailing junk, no triples unlike Jena currently.
I had hoped to remove the workaround and not duplicate jsonld-java code.
Elephas testing is impacted. It is sensitive to the "JSON object,
trailing junk, triples" vs "JSON object, triples, trailing junk"
differences.
Unless there is a specific reason to support that behaviour, I'd like to
switch to jsonld-java behaviour.
(Rob) Thoughts?
Andy
[1] https://github.com/jsonld-java/jsonld-java/issues/144