}
if (key != null && value != null) {
String id = null;
GraphObject existingNode = null;
try {
// UUID is globally unique
if (key.equals(GraphObject.id)) {
//return true; // trust uniqueness
existingNode = StructrApp.getInstance().get(value.toString());
//existingNode = StructrApp.getInstance().nodeQuery(AbstractNode.class).and(key, value).getFirst();
} else {
existingNode = StructrApp.getInstance().nodeQuery(AbstractNode.class).and(key, value).getFirst();
}
} catch (FrameworkException fex) {
// handle error
}
if (existingNode != null) {
GraphObject foundNode = existingNode;
if (foundNode.getId() != object.getId()) {
id = foundNode.getUuid();
errorBuffer.add(object.getType(), new UniqueToken(id, key, value));
return false;
}