Concept disease = f.createNamedConcept("Disease");
Concept heartDisease = f.createNamedConcept("HeartDisease");
Concept criticalDisease = f.createNamedConcept("CriticalDisease");
// The factory can also be used to create roles
Role actsOn = f.createNamedRole("acts-on");
Role partOf = f.createNamedRole("part-of");
Role contIn = f.createNamedRole("cont-in");
Role hasLoc = f.createNamedRole("has-loc");
// Finally, the factory can be used to create axioms
Concept lhs = endocardium;
Concept rhs = f.createConjunction(
tissue,
f.createExistential((NamedRole) contIn, heartWall),
f.createExistential((NamedRole) contIn, heartValve)
);
baseAxioms.add(f.createConceptInclusion(lhs, rhs));
lhs = heartWall;
rhs = f.createConjunction(
bodyWall,
f.createExistential((NamedRole) partOf, heart)
);
baseAxioms.add(f.createConceptInclusion(lhs, rhs));
lhs = heartValve;
rhs = f.createConjunction(
bodyValve,
f.createExistential((NamedRole) partOf, heart)
);
baseAxioms.add(f.createConceptInclusion(lhs, rhs));
lhs = endocarditis;
rhs = f.createConjunction(
inflammation,
f.createExistential((NamedRole) hasLoc, endocardium)
);
baseAxioms.add(f.createConceptInclusion(lhs, rhs));
lhs = inflammation;
rhs = f.createConjunction(
disease,
f.createExistential(actsOn, tissue)
);
baseAxioms.add(f.createConceptInclusion(lhs, rhs));
lhs = f.createConjunction(
heartDisease,
f.createExistential(hasLoc, heartValve)
);
rhs = criticalDisease;
baseAxioms.add(f.createConceptInclusion(lhs, rhs));
// There is no direct support in the API to create an equivalence axiom
// so it has to be created using two concept inclusion axioms
lhs = heartDisease;
rhs = f.createConjunction(
disease,
f.createExistential(hasLoc, heart)
);
baseAxioms.add(f.createConceptInclusion(lhs, rhs));
baseAxioms.add(f.createConceptInclusion(rhs, lhs));
Role[] rlhs = new Role[]{partOf, partOf};
Role rrhs = partOf;
baseAxioms.add(f.createRoleInclusion(rlhs, rrhs));
rlhs = new Role[]{partOf};
rrhs = contIn;
baseAxioms.add(f.createRoleInclusion(rlhs, rrhs));