// subjects are not bNodes and don't match
return false;
}
}
else { // subj1 instanceof BNode
BNode mappedBNode = bNodeMapping.get(subj1);
if (mappedBNode != null) {
// bNode 'subj1' was already mapped to some other bNode
if (!subj2.equals(mappedBNode)) {
// 'subj1' and 'subj2' do not match
return false;
}
}
else {
// 'subj1' was not yet mapped. we need to check if 'subj2' is a
// possible mapping candidate
if (bNodeMapping.containsValue(subj2)) {
// 'subj2' is already mapped to some other value.
return false;
}
}
}
Value obj1 = st1.getObject();
Value obj2 = st2.getObject();
if (!(obj1 instanceof BNode)) {
if (!obj1.equals(obj2)) {
// objects are not bNodes and don't match
return false;
}
}
else { // obj1 instanceof BNode
BNode mappedBNode = bNodeMapping.get(obj1);
if (mappedBNode != null) {
// bNode 'obj1' was already mapped to some other bNode
if (!obj2.equals(mappedBNode)) {
// 'obj1' and 'obj2' do not match