not Rob but my 2 cents..... I think that when we read turtle documents if there is an error the triples we have already read and left in the graph/model (yes, transactions can change this). Shouldn't all parsers follow the same pattern?
Currently that pattern seems to be: read until eof or error and process what was read. Unless I am wrong about the above, I think that the JSON parser should return the json object that was parsed before the junk. Claude On Sat, Oct 3, 2015 at 7:21 PM, Andy Seaborne <[email protected]> wrote: > 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 > -- I like: Like Like - The likeliest place on the web <http://like-like.xenei.com> LinkedIn: http://www.linkedin.com/in/claudewarren
