parser = new TurtleParser(is, new ConsoleTripleHandler(),
documentSource.getDocumentIRI());
}
OWLRDFConsumerAdapter consumer = new OWLRDFConsumerAdapter(
ontology, configuration);
TurtleDocumentFormat format = new TurtleDocumentFormat();
consumer.setOntologyFormat(format);
consumer.startModel(documentSource.getDocumentIRI());
parser.setTripleHandler(consumer);
parser.parseDocument();
PrefixManager prefixManager = parser.getPrefixManager();
for (String prefixName : prefixManager.getPrefixNames()) {
format.setPrefix(prefixName,
prefixManager.getPrefix(prefixName));
}
return format;
} catch (ParseException e) {
throw new TurtleParserException(e);