This may or may not be close to what you are looking for, but you might try something like oaj.riot.RDFDataMgr::parse with a wrapper around oaj.riot.system.StreamRDFLib::graph. You can subclass oaj.riot.system.StreamRDFWrapper for that. Then you have tuple-level control over the process and can throw exceptions or execute side-effects as desired.
--- A. Soroka The University of Virginia Library > On Jul 8, 2016, at 1:46 PM, Martynas Jusevičius <marty...@graphity.org> wrote: > > Hey, > > I have implemented an RDF/POST parser which extends ReaderRIOTBase: > https://github.com/AtomGraph/Core/blob/master/src/main/java/org/graphity/core/riot/lang/RDFPostReader.java > > It silently accepts broken URIs, so I want the behavior to depend on > ParserProfile, and throw exceptions in case of strict error handler. > > I'm reading Model using Model.read(InputStream in, String base, String > lang), so the question is: how do I set the (strict) error handler > before reading it? > > Also, what is the difference/connection between ErrorHandler and > RDFErrorHandler? > https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/riot/system/ErrorHandler.html > https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/RDFErrorHandler.html > > Thanks, > > Martynas > atomgraph.com