package bugs; import static org.junit.Assert.assertEquals; import javax.annotation.Nonnull; import org.junit.Before; import org.junit.Test; import org.semanticweb.owlapi.apibinding.OWLManager; import org.semanticweb.owlapi.formats.FunctionalSyntaxDocumentFormat; import org.semanticweb.owlapi.io.StringDocumentSource; import org.semanticweb.owlapi.io.SystemOutDocumentTarget; import org.semanticweb.owlapi.model.IRI; import org.semanticweb.owlapi.model.OWLClass; import org.semanticweb.owlapi.model.OWLDataFactory; import org.semanticweb.owlapi.model.OWLOntology; import org.semanticweb.owlapi.model.OWLOntologyCreationException; import org.semanticweb.owlapi.model.OWLOntologyStorageException; import org.semanticweb.owlapi.reasoner.OWLReasoner; import testbase.TestBase; @SuppressWarnings("javadoc") public class DebugVerifyComplianceUniversityTestCase extends TestBase { private OWLReasoner reasoner; private OWLDataFactory df = OWLManager.getOWLDataFactory(); @Nonnull private static OWLOntology load() throws OWLOntologyCreationException { String input = "Prefix(owl:=)\n" + "Prefix(rdf:=)\n" + "Prefix(xml:=)\n" + "Prefix(xsd:=)\n" + "Prefix(rdfs:=)\n" + "Ontology(\n" + "Declaration(Class())\n" + "Declaration(Class())\n" + "Declaration(DataProperty())\n" + "EquivalentClasses( DataHasValue( \"false\"^^xsd:boolean))\n" + "DisjointClasses( )\n" + "EquivalentClasses( DataHasValue( \"true\"^^xsd:boolean))\n" + "DataPropertyDomain( )\n" + "DataPropertyRange( xsd:boolean)\n" + ')'; return OWLManager.createOWLOntologyManager() .loadOntologyFromOntologyDocument( new StringDocumentSource(input)); } private static void equal(Object o, boolean object) { assertEquals(object, o); } @Nonnull private OWLClass C(@Nonnull String i) { return df.getOWLClass(IRI.create(i)); } @Nonnull private OWLClass Professor = C("urn:uni#Professor"); @Before public void setUp() throws OWLOntologyCreationException { reasoner = factory().createReasoner(load()); } protected void print(OWLOntology o) throws OWLOntologyStorageException { o.getOWLOntologyManager().saveOntology(o, new FunctionalSyntaxDocumentFormat(), new SystemOutDocumentTarget()); } @Test public void shouldPassisSatisfiableProfessor() { equal(reasoner.isSatisfiable(Professor), true); } }