lang = Lang.RDFXML ;
String base = "http://example/upload-base/" ;
// We read into a in-memory graph, then (if successful) update the dataset.
// This isolates errors.
Sink<Triple> sink = new SinkTriplesToGraph(graphTmp) ;
LangRIOT parser = RiotReader.createParserTriples(stream, lang, base, sink) ;
parser.getProfile().setHandler(errorHandler) ;
try {
parser.parse() ;
}
catch (RiotException ex) { errorBadRequest("Parse error: "+ex.getMessage()) ; }
finally { sink.close() ; }
tripleCount = graphTmp.size() ;
//DatasetGraph dsgTmp = DatasetGraphFactory.create(graphTmp) ;
}
}