ObsoleteClassInSignature extends AbstractCheck { @Override public Collection<CheckWarning> check(OWLGraphWrapper graph, Collection<OWLObject> allOwlObjects) { OWLPrettyPrinter pp = new OWLPrettyPrinter(graph); List<CheckWarning> out = new ArrayList<CheckWarning>(); for (OWLObject owlObject : allOwlObjects) { if (owlObject instanceof OWLClass) { OWLClass owlClass = (OWLClass) owlObject; if (graph.isObsolete(owlClass) == false) { check(owlClass, graph, out, pp); } } } return out; } ObsoleteClassInSignature(); @Override Collection<CheckWarning> check(OWLGraphWrapper graph, Collection<OWLObject> allOwlObjects); static final String SHORT_HAND; }
@Test public void testCheckOWLGraphWrapperCollectionOfOWLObject() throws Exception { ParserWrapper parser = new ParserWrapper(); IRI iri = IRI.create(getResource("verification/obsolete_class_in_signature.obo").getAbsoluteFile()); OWLGraphWrapper graph = parser.parseToOWLGraph(iri.toString()); ObsoleteClassInSignature check = new ObsoleteClassInSignature(); Collection<CheckWarning> warnings = check.check(graph, graph.getAllOWLObjects()); assertEquals(2, warnings.size()); final IRI offendingIRI = IRI.create("http: for (CheckWarning warning : warnings) { assertTrue(warning.getIris().contains(offendingIRI)); } }