}
public void extract(URI uri, String filePath)
throws IOException, ExtractionException, TripleHandlerException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
final TripleHandler tHandler = new RDFXMLWriter(baos);
final ExtractionContext extractionContext = new ExtractionContext("rdf-jsonld", uri);
final ExtractionResult result = new ExtractionResultImpl(extractionContext, extractor, tHandler);
extractor.setStopAtFirstError(false);
try {
extractor.run(
ExtractionParameters.newDefault(),
extractionContext,
this.getClass().getResourceAsStream(filePath),
result
);
} finally {
logger.debug(baos.toString());
tHandler.close();
result.close();
}
}