I try to remove an existing individual from my RDF file, but I always get a NullPointerException. The Individual I am getting is there, because I can print out a property. Can someone please tell me what I have done wrong?
final static String SN = "http://vaceta.pavo.uberspace.de/RDF/social-media.owl#";
InputStream in = context.getResourceAsStream("WEB-INF/resources/social-media.rdf");
OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
model.read(in, null);
in.close();
Individual user01 = model.getIndividual(SN + "User01");
model.remove(user01, null, (RDFNode) null);
model.remove(null, null, user01);
output = new FileOutputStream(context.getRealPath("/")+"WEB-INF/resources/social-media.rdf");
model.writeAll(output, "RDF/XML", null);
output.close();
stacktrace: