AFAIK, that doesn't work for all kind of errors. Some are categorized as "fatal", in which case the parser stops immediately. In any case you could write your own parser that skips those. IIRC, there were at least two discussion here on the mailing list some years ago how to keep track of those bad triples [1] . Don't remember of the second thread.
There are different error handlers, probably only configurable via Java API: ErrorHandlerFactory.errorHandlerWarn + ParserProfileStd + RiotParsers.createIteratorNTriples Clearly things might have been changed (I know that Rob Vesse did something for the CLI). Probably there is a simpler way, but that's what I remember and I don't have a computer at hand right now. Cheers, Lorenz [1] https://mail-archives.apache.org/mod_mbox/jena-users/201610.mbox/%[email protected]%3e On 27.04.2018 13:49, Jean-Marc Vanel wrote: > Hi Laura, > > I would do this: > > - consider the .nt as a ttl file > - run riot with a base URI > - remove the bad lines with grep -v > > Example: > cat relative.ttl > <rel> <p> "v" . > java -$CP riotcmd.riot --base=http://nogood.net/ > /home/jmv/data/TESTS/relative.ttl > <http://nogood.net/rel> <http://nogood.net/p> "v" . > > > 2018-04-27 13:10 GMT+02:00 Laura Morales <[email protected]>: > >> Here's the problem: I'm downloading a few .nt from the Internet and they >> contain some bad triples. "Bad" means that they are syntactically correct >> but logically incorrect; for example they contain triples with relative >> URLs instead of absolute, or maybe they contain an empty subject like this >> <>. I don't know if it's possible to ask RIOT to treat these as Warnings >> instead of Errors, but if I use RIOT --validate it only reports then as >> errors. >> Before you say anything, I know that the original sources should be fixed >> and that it's not RIOT's job to fix any errors. But I don't really have >> control over those graphs, so I was wondering if it's possible to use RIOT >> as some sort of filter like this >> >> 1. read next triple >> 2. if logically correct, append to output >> if logically incorrect, do not append to output >> > >
