Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing createNeighbors to omit redundant genus in equivalence axiom… #177

Merged
merged 3 commits into from Apr 25, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -1202,6 +1202,17 @@ public OWLShuntGraph getNeighbors(OWLObject x) {
/**
* Retrieve direct neighbors of x in a shunt graph.
*
* This includes:
*
* 1. X SubClassOf Y ==> X is_a Y
* 2. X SubClassOf R some Y ==> X R Y
* 3. X EquivalentTo G and R1 some Y1 and ... => X R1 Y1
*
* Note that 3 will generally be unnecessary as most ontologies include the robot
* relax and reason step (or their equivalent), guaranteeing the basic graph to be complete.
* We leave this in for now, because not all ontologies will include this step.
* We don't expect redundancies, as we omit the genus G
*
* @param x
* @return shunt graph
*/
Expand Down Expand Up @@ -1244,10 +1255,17 @@ private OWLShuntGraph createNeighbors(OWLObject x, int edgeLimit) {
else if (ce instanceof OWLObjectIntersectionOf) {
OWLObjectIntersectionOf intersection = (OWLObjectIntersectionOf) ce;
for(OWLClassExpression op : intersection.getOperands()) {
addShuntNodeAndEdge(cls, op, shunt, nodes);
if (edgeLimit > 0 && shunt.edges.size() >= edgeLimit) {
return shunt;
}

// only include anonymoys operands. For example, if we have
// `X EquivalentTo G and R1 some Y1 and ... Rn some Yn`, then
// we want to ignore the G as it will be redundant, assuming
// reasoning has been performed over the ontology
if (op.isAnonymous()) {
addShuntNodeAndEdge(cls, op, shunt, nodes);
if (edgeLimit > 0 && shunt.edges.size() >= edgeLimit) {
return shunt;
}
}
}
}
}
Expand Down