assertTrue(profile.checkOntology(func).isInProfile());
}
@Test
public void shouldManchBeEquivalent() throws OWLOntologyCreationException {
OWLOntology manch = loadOntologyFromString(MANCHESTER,
IRI.create("urn:primer#manchester"),
new ManchesterSyntaxDocumentFormat());
assertTrue(profile.checkOntology(manch).getViolations().isEmpty());
// XXX Manchester OWL Syntax does not support GCIs
// the input adopts a trick to semantically get around this, by
// asserting a new named class equivalent to the right hand side of the
// GCI and subclass of the left hand side
// Rectifying this to be able to assert equality, and using a different
// ontology
// so that the equality test does not skip gcis because of the format
OWLClass x = df.getOWLClass(IRI
.create("http://example.com/owl/families/X"));
Set<OWLClassAxiom> axioms = manch.getAxioms(x, EXCLUDED);
manch.getOWLOntologyManager().removeAxioms(manch, axioms);
OWLClass female = df.getOWLClass(IRI
.create("http://example.com/owl/families/Female"));
OWLClassExpression oneOf = df.getOWLObjectOneOf(df
.getOWLNamedIndividual(IRI
.create("http://example.com/owl/families/Bill")), df
.getOWLNamedIndividual(IRI
.create("http://example.com/owl/families/Mary")), df
.getOWLNamedIndividual(IRI
.create("http://example.com/owl/families/Meg")));
OWLClass parent = df.getOWLClass(IRI
.create("http://example.com/owl/families/Parent"));
OWLObjectProperty hasChild = df.getOWLObjectProperty(IRI
.create("http://example.com/owl/families/hasChild"));
OWLClassExpression superClass = df.getOWLObjectIntersectionOf(parent,
df.getOWLObjectAllValuesFrom(hasChild, female),
df.getOWLObjectMaxCardinality(1, hasChild));
manch.getOWLOntologyManager().addAxiom(
manch,
df.getOWLSubClassOfAxiom(
df.getOWLObjectIntersectionOf(female, oneOf),
superClass));
OWLOntology replacement = OWLManager.createOWLOntologyManager()
.createOntology(manch.getAxioms(),
manch.getOntologyID().getOntologyIRI().get());
equal(func, replacement);
}