public void addData(InputStream dataStream, String baseURI, RDFFormat format, boolean verifyData, AdminListener listener) throws IOException, AccessDeniedException
{
try
{
Parser parser = null;
Map noParams = new HashMap();
if(format.equals(RDFFormat.TURTLE))
{
parser = new TurtleParser();
}
else if(format.equals(RDFFormat.RDFXML))
{
parser = new RdfXmlParser();
}
else if(format.equals(RDFFormat.NTRIPLES))
{
parser = new NTriplesParser();
}
else return;
parser.setDatatypeHandling(Parser.DT_IGNORE); // TODO find out what this is doing
StatementHandler sh = new StatementHandler()
{
public void handleStatement(Resource subj, URI pred, Value obj)
{
addSingleStatement(subj, pred, obj);
}
};
parser.setStatementHandler(sh);
parser.parse(dataStream, baseURI);
dataStream.close();
}
catch (Exception e)
{
System.out.println(e.getMessage());