value = graph.getValue(pair.second.getObject());
}
type = graph.getPossibleType(pair.second.getObject(), L0.Literal);
- Resource pred = pair.second.getPredicate();
- if (getChanges().getComparable().containsRight(pred))
- pred = getChanges().getComparable().getLeft(pred);
+ Resource pred = _getPredicate();
if (value != null) {
graph.deny(s, pred);
if (type != null) {
}
applied = true;
} else if (graph.isInstanceOf(pair.second.getObject(), L0.SCLValue)) {
- Resource pred = pair.second.getPredicate();
+ Resource pred = _getPredicate();
graph.deny(s, pred);
Resource valueResource = graph.newResource();
graph.claim(valueResource, L0.InstanceOf, graph.getSingleObject(pair.second.getObject(), L0.InstanceOf));
} else {
Resource type = graph.getPossibleType(pair.second.getObject(), L0.Value);
if (type != null && graph.hasStatement(type, L0.Enumeration, type)) {
- Resource pred = pair.second.getPredicate();
+ Resource pred = _getPredicate();
graph.deny(s, pred);
graph.claim(s, pred, pair.second.getObject());
applied = true;
}
+ private Resource _getPredicate() {
+ Resource pred = pair.second.getPredicate();
+ if (getChanges().getComparable().containsRight(pred))
+ pred = getChanges().getComparable().getLeft(pred);
+ return pred;
+ }
+
/**
* Sets selected state.
* @param select
} else if (op.isDelete()){
addNode(g, op.getResource(), null);
} else if (op.isChange()) {
- Resource l = getChanges().getComparable().containsLeft(op.getResource()) ? op.getResource() :getChanges().getComparable().getLeft(op.getResource());
- Resource r = getChanges().getComparable().containsRight(op.getResource()) ? op.getResource() :getChanges().getComparable().getRight(op.getResource());
+ Resource o = op.getResource();
+ Resource l = getChanges().getComparable().containsLeft(o) ? o :getChanges().getComparable().getLeft(o);
+ Resource r = getChanges().getComparable().containsRight(o) ? o :getChanges().getComparable().getRight(o);
addNode(g, l, r);
}
}