@Override
protected void setNamespaceInternal(String prefix, String name) throws SailException {
try {
// check if the namespace prefix already exists; if yes and unequal, then delete first
KiWiNamespace result = databaseConnection.loadNamespaceByPrefix(prefix);
if(result != null) {
if(!result.getUri().equals(name)) {
databaseConnection.deleteNamespace(result);
databaseConnection.storeNamespace(new KiWiNamespace(prefix,name));
}
} else {
databaseConnection.storeNamespace(new KiWiNamespace(prefix,name));
}
} catch (SQLException e) {
throw new SailException("database error while updating namespace",e);
}
}