Debian Codegraph @

FaCT++.Java/src/test/java/conformancetests/HasSelfSupportTestCase.java

raw symbols SCIP
1 package conformancetests;
2
3 import static org.junit.Assert.assertTrue;
4
5 import org.junit.Test;
6 import org.semanticweb.owlapi.apibinding.OWLManager;
7 import org.semanticweb.owlapi.io.StringDocumentSource;
8 import org.semanticweb.owlapi.model.OWLOntology;
9 import org.semanticweb.owlapi.model.OWLOntologyCreationException;
10 import org.semanticweb.owlapi.model.OWLOntologyManager;
11 import org.semanticweb.owlapi.reasoner.InferenceType;
12 import org.semanticweb.owlapi.reasoner.OWLReasoner;
13
14 import testbase.TestBase;
15
16 @SuppressWarnings("javadoc")
17 public class HasSelfSupportTestCase extends TestBase {
18
19 @Test
20 public void shouldBeConsistent() throws OWLOntologyCreationException {
21 String input = "Prefix(owl:=<http://www.w3.org/2002/07/owl#>)\n"
22 + "Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)\n"
23 + "Prefix(xml:=<http://www.w3.org/XML/1998/namespace>)\n"
24 + "Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)\n"
25 + "Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)\n"
26 + "\n"
27 + "\n"
28 + "Ontology(\n"
29 + "SubClassOf(<http://purl.obolibrary.org/obo/BFO_0000006> ObjectHasSelf(<http://purl.obolibrary.org/obo/BFO_0000083>))\n"
30 + ")";
31 OWLOntologyManager m = OWLManager.createOWLOntologyManager();
32 OWLOntology o = m
33 .loadOntologyFromOntologyDocument(new StringDocumentSource(
34 input));
35 OWLReasoner r = factory().createReasoner(o);
36 r.precomputeInferences(InferenceType.CLASS_HIERARCHY);
37 assertTrue(r.isConsistent());
38 }
39 }