@Test public void test() throws Exception { ParserWrapper parser = new ParserWrapper(); IRI iri = IRI.create(getResource("verification/altid_in_signature.obo").getAbsoluteFile()); OWLGraphWrapper graph = parser.parseToOWLGraph(iri.toString()); AltIdInSignature check = new AltIdInSignature(); 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)); assertFalse(warning.isFatal()); } }
@Override public Collection<CheckWarning> check(OWLGraphWrapper graph, Collection<OWLObject> allOwlObjects) { OWLPrettyPrinter pp = new OWLPrettyPrinter(graph); List<CheckWarning> out = new ArrayList<CheckWarning>(); Map<String, OWLObject> altIds = graph.getAllOWLObjectsByAltId(); for (OWLObject owlObject : allOwlObjects) { if (owlObject instanceof OWLClass) { OWLClass owlClass = (OWLClass) owlObject; if (graph.isObsolete(owlClass) == false) { check(owlClass, graph, altIds, out, pp); } } } return out; }
AltIdInSignature extends AbstractCheck { @Override public Collection<CheckWarning> check(OWLGraphWrapper graph, Collection<OWLObject> allOwlObjects) { OWLPrettyPrinter pp = new OWLPrettyPrinter(graph); List<CheckWarning> out = new ArrayList<CheckWarning>(); Map<String, OWLObject> altIds = graph.getAllOWLObjectsByAltId(); for (OWLObject owlObject : allOwlObjects) { if (owlObject instanceof OWLClass) { OWLClass owlClass = (OWLClass) owlObject; if (graph.isObsolete(owlClass) == false) { check(owlClass, graph, altIds, out, pp); } } } return out; } }
AltIdInSignature extends AbstractCheck { @Override public Collection<CheckWarning> check(OWLGraphWrapper graph, Collection<OWLObject> allOwlObjects) { OWLPrettyPrinter pp = new OWLPrettyPrinter(graph); List<CheckWarning> out = new ArrayList<CheckWarning>(); Map<String, OWLObject> altIds = graph.getAllOWLObjectsByAltId(); for (OWLObject owlObject : allOwlObjects) { if (owlObject instanceof OWLClass) { OWLClass owlClass = (OWLClass) owlObject; if (graph.isObsolete(owlClass) == false) { check(owlClass, graph, altIds, out, pp); } } } return out; } AltIdInSignature(); }
AltIdInSignature extends AbstractCheck { @Override public Collection<CheckWarning> check(OWLGraphWrapper graph, Collection<OWLObject> allOwlObjects) { OWLPrettyPrinter pp = new OWLPrettyPrinter(graph); List<CheckWarning> out = new ArrayList<CheckWarning>(); Map<String, OWLObject> altIds = graph.getAllOWLObjectsByAltId(); for (OWLObject owlObject : allOwlObjects) { if (owlObject instanceof OWLClass) { OWLClass owlClass = (OWLClass) owlObject; if (graph.isObsolete(owlClass) == false) { check(owlClass, graph, altIds, out, pp); } } } return out; } AltIdInSignature(); @Override Collection<CheckWarning> check(OWLGraphWrapper graph, Collection<OWLObject> allOwlObjects); }
AltIdInSignature extends AbstractCheck { @Override public Collection<CheckWarning> check(OWLGraphWrapper graph, Collection<OWLObject> allOwlObjects) { OWLPrettyPrinter pp = new OWLPrettyPrinter(graph); List<CheckWarning> out = new ArrayList<CheckWarning>(); Map<String, OWLObject> altIds = graph.getAllOWLObjectsByAltId(); for (OWLObject owlObject : allOwlObjects) { if (owlObject instanceof OWLClass) { OWLClass owlClass = (OWLClass) owlObject; if (graph.isObsolete(owlClass) == false) { check(owlClass, graph, altIds, out, pp); } } } return out; } AltIdInSignature(); @Override Collection<CheckWarning> check(OWLGraphWrapper graph, Collection<OWLObject> allOwlObjects); static final String SHORT_HAND; }