DanglingReferenceCheck 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; check(owlClass, graph, out, pp); } } return out; } DanglingReferenceCheck(); @Override Collection<CheckWarning> check(OWLGraphWrapper graph, Collection<OWLObject> allOwlObjects); static final String SHORT_HAND; }
@Test public void testDanglingReference() throws Exception { ParserWrapper parser = new ParserWrapper(); IRI iri = IRI.create(getResource("verification/dangling_references.obo").getAbsoluteFile()) ; OWLGraphWrapper graph = parser.parseToOWLGraph(iri.toString()); DanglingReferenceCheck check = new DanglingReferenceCheck(); Collection<CheckWarning> warnings = check.check(graph, graph.getAllOWLObjects()); assertEquals(1, warnings.size()); CheckWarning warning = warnings.iterator().next(); assertTrue(warning.getIris().contains(IRI.create("http: }