while(!resourceIsUnique){
String tmpValue = value.replace("@newID@",Long.toString(++lastID));
res = model.createResource(tmpValue);
//Check if Namespace is already in use:
ResourceSelector rSel = new ResourceSelector(res);
StmtIterator stmtIt = model.listStatements(rSel);
if(!stmtIt.hasNext())
resourceIsUnique = true;
}
} else{
res = model.createResource(value);
ResourceSelector rSel = new ResourceSelector(res);
StmtIterator stmtIt = model.listStatements(rSel);
if(stmtIt.hasNext())
//Resource exist, cancel operation
throw new ImporterException("Resource '" + value + "' already exists");
}