StmtIterator stmtIt = model.listStatements(rSel);
if(stmtIt.hasNext())
//Resource exist, cancel operation
throw new ImporterException("Resource '" + value + "' already exists");
}
NamedResource newRes = new NamedResource("@res:" + name + "@",res);
knownResources.add(newRes);
}
} else if (mode == ImportMode.EDIT){
//Find Resources that ought to be edited
ni = XPathAPI.selectNodeIterator(doc,"/importMapping/edit/editResource");
while((curNode = ni.nextNode())!=null){
String name = XPathAPI.selectSingleNode(curNode,"name/text()").getNodeValue();
String value = XPathAPI.selectSingleNode(curNode,"value/text()").getNodeValue();
Resource res = model.getResource(value);
NamedResource newRes = new NamedResource("@res:" + name + "@",res);
knownResources.add(newRes);
//Delete all statements containing the resources that will be edited
for(NamedResource nRes:knownResources)
Util.deleteStatements(model,nRes.getRes());