String baseURI = "http://example/base" ;
// It is always better to use an InputStream, rather than a Java Reader.
// The parsers will do the necessary character set conversion.
in = new FileInputStream("data.trig") ;
LangRIOT parser = RiotReader.createParser(in, RDFLanguages.TRIG, "http://example/base", noWhere) ;
// Access the setup of the RIOT built-in parsers.
// Parser to first error or warning.
ErrorHandler errHandler = ErrorHandlerFactory.errorHandlerStrict ;
// Now enable stricter checking, even N-TRIPLES must have absolute URIs.
ParserProfile profile = RiotLib.profile(baseURI, true, true, errHandler) ;
// Just set the error handler.
parser.getProfile().setHandler(errHandler) ;
// Or replace the whole parser profile.
parser.setProfile(profile) ;
// Do the work.
parser.parse() ;
}