ORTHO_STATEMENT: for (final Statement orthoStmt : orthoStmts) {
// rule out invalid or non-orthologous statements
if (validOrthologousStatement(orthoStmt)) {
// break down subject
final Term sub = orthoStmt.getSubject();
final FunctionEnum subf = sub.getFunctionEnum();
final List<Parameter> subp = sub.getParameters();
final Parameter subjectParam = subp.get(0);
// break down object
final Term obj = orthoStmt.getObject().getTerm();
final FunctionEnum objf = obj.getFunctionEnum();
final List<Parameter> objp = obj.getParameters();
final Parameter objectParam = objp.get(0);
// lookup exact match of subject term
if (pnterms.contains(sub)) {
pnterms.add(obj);
continue;
}
// find UUID for subject parameter
SkinnyUUID uuid = paramcache.get(subjectParam);
if (uuid == null) {
final Namespace ns = subjectParam.getNamespace();
final JDBMEquivalenceLookup lookup = lookups.get(ns
.getResourceLocation());
if (lookup == null) {
continue;
}
uuid = lookup.lookup(subjectParam.getValue());
paramcache.put(subjectParam, uuid);
}
// if there is a proto network term with this UUID contained, then
// this orthologous statement intersects the proto network, continue
if (uuid != null) {
Set<Integer> tids = uuidterms.get(uuid);
if (hasItems(tids)) {
for (final Integer tid : tids) {
final Term t = tt.getIndexedTerms().get(tid);
if (t.getFunctionEnum() == subf) {
pnterms.add(sub);
pnterms.add(t);
pnterms.add(obj);
continue ORTHO_STATEMENT;
}
}
}
}
// lookup exact match of object term
if (pnterms.contains(obj)) {
pnterms.add(sub);
continue;
}
// find UUID for object parameter
uuid = paramcache.get(objectParam);
if (uuid == null) {
final Namespace ns = objectParam.getNamespace();
final JDBMEquivalenceLookup lookup = lookups.get(ns
.getResourceLocation());
if (lookup == null) {
continue;
}
uuid = lookup.lookup(objectParam.getValue());
paramcache.put(objectParam, uuid);
}
// if there is a proto network term with this UUID contained, then
// this orthologous statement intersects the proto network, continue
if (uuid != null) {
Set<Integer> tids = uuidterms.get(uuid);
if (hasItems(tids)) {
for (final Integer tid : tids) {
final Term t = tt.getIndexedTerms().get(tid);
if (t.getFunctionEnum() == objf) {
pnterms.add(obj);
pnterms.add(t);
pnterms.add(sub);
continue ORTHO_STATEMENT;