Skip to content

Commit

Permalink
Only report the top-level unaligned classes.
Browse files Browse the repository at this point in the history
As per request (see
INCATools/ontology-development-kit#1175), when
producing a report, it should only list the *top-level* unaligned
classes, not their descendants.
  • Loading branch information
gouttegd committed Feb 5, 2025
1 parent 37460fe commit 50919b3
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ public void performOperation(CommandState state, CommandLine line) throws Except
}
}
if ( !aligned ) {
unalignedClasses.add(klass);
// Report only top-level classes (whose only parent is owl:Thing)
if ( ancestors.size() == 1 ) {
unalignedClasses.add(klass);
}
}
}
}
Expand All @@ -134,7 +137,7 @@ public void performOperation(CommandState state, CommandLine line) throws Except
}

if ( !unalignedClasses.isEmpty() ) {
logger.error("Ontology contains {} unaligned class(es)", unalignedClasses.size());
logger.error("Ontology contains {} top-level unaligned class(es)", unalignedClasses.size());
System.exit(1);
}
}
Expand Down

0 comments on commit 50919b3

Please sign in to comment.