public class RelationShorthandTest extends OboFormatTestBasics {
@Test
public void testConvert() {
// PARSE TEST FILE, CONVERT TO OWL, AND WRITE TO OWL FILE
OWLOntology ontology = convert(parseOBOFile("relation_shorthand_test.obo"));
// TEST CONTENTS OF OWL ONTOLOGY
Set<OWLSubClassOfAxiom> scas = ontology
.getAxioms(AxiomType.SUBCLASS_OF);
boolean ok = false;
for (OWLSubClassOfAxiom sca : scas) {
OWLClassExpression sup = sca.getSuperClass();
if (sup instanceof OWLObjectSomeValuesFrom) {
OWLObjectProperty p = (OWLObjectProperty) ((OWLObjectSomeValuesFrom) sup)
.getProperty();
OWLClass v = (OWLClass) ((OWLObjectSomeValuesFrom) sup)
.getFiller();
if (p.getIRI().toString()
.equals("http://purl.obolibrary.org/obo/BFO_0000051")
&& v.getIRI()
.toString()
.equals("http://purl.obolibrary.org/obo/GO_0004055")) {
ok = true;
}
}
}
assertTrue(ok);
scas = ontology.getAxioms(AxiomType.SUBCLASS_OF);
ok = false;
for (OWLSubClassOfAxiom sca : scas) {
OWLClassExpression sup = sca.getSuperClass();
if (sup instanceof OWLObjectSomeValuesFrom) {
OWLObjectProperty p = (OWLObjectProperty) ((OWLObjectSomeValuesFrom) sup)