JDBMEquivalenceLookup jdbmLookup = lookups.get(rl);
if (jdbmLookup == null) {
continue;
}
SkinnyUUID uuid = jdbmLookup.lookup(val);
if (uuid != null) {
uuids.add(uuid);
}
}
}
// Establish set of UUIDs relevant for the proto-network
Set<SkinnyUUID> pnUUIDs = new HashSet<SkinnyUUID>();
ParameterTable paramTbl = network.getParameterTable();
TableParameter[] paramArr = paramTbl.getTableParameterArray();
for (final TableParameter tp : paramArr) {
if (!validParameter(tp)) {
continue;
}
TableNamespace namespace = tp.getNamespace();
String value = tp.getValue();
String rl = namespace.getResourceLocation();
JDBMEquivalenceLookup jdbmLookup = lookups.get(rl);
if (jdbmLookup == null) {
continue;
}
SkinnyUUID uuid = jdbmLookup.lookup(value);
if (uuid != null) {
pnUUIDs.add(uuid);
}
}
// Two sets of UUIDs have been established at this point.
// The first set, uuids, is the set based on the genes.
// The second set, pnUUIDs, is the set based on the proto-network.
// Make uuids the intersection of the two: (uuids ∩ pnUUIDs)
uuids.retainAll(pnUUIDs);
final Set<Statement> toPrune = new HashSet<Statement>();
int pruned = 0;
// Pruning is simply a matter of iterating all statements in genes...
GENES: for (final Statement stmt : genes) {
List<Parameter> parameters = stmt.getAllParameters();
// ... and all parameters in each statement...
for (final Parameter p : parameters) {
if (!validParameter(p)) {
continue;
}
Namespace ns = p.getNamespace();
String val = p.getValue();
String rl = ns.getResourceLocation();
// ... do we have set membership?
JDBMEquivalenceLookup jdbmLookup = lookups.get(rl);
if (jdbmLookup == null) {
continue;
}
SkinnyUUID uuid = jdbmLookup.lookup(val);
// Check for set membership, uuid ∊ uuids
if (uuids.contains(uuid)) {
// This indicates equivalent parameters are being
// used by both document and network. This