| 1 |
package conformancetests; |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
import static org.junit.Assert.*; |
| 9 |
|
| 10 |
import org.junit.Test; |
| 11 |
import org.semanticweb.owlapi.apibinding.OWLManager; |
| 12 |
import org.semanticweb.owlapi.model.AddAxiom; |
| 13 |
import org.semanticweb.owlapi.model.IRI; |
| 14 |
import org.semanticweb.owlapi.model.OWLDataFactory; |
| 15 |
import org.semanticweb.owlapi.model.OWLDataProperty; |
| 16 |
import org.semanticweb.owlapi.model.OWLOntology; |
| 17 |
import org.semanticweb.owlapi.model.OWLOntologyCreationException; |
| 18 |
import org.semanticweb.owlapi.model.OWLOntologyManager; |
| 19 |
import org.semanticweb.owlapi.reasoner.OWLReasoner; |
| 20 |
import org.semanticweb.owlapi.reasoner.OWLReasonerFactory; |
| 21 |
|
| 22 |
import testbase.TestBase; |
| 23 |
|
| 24 |
@SuppressWarnings("javadoc") |
| 25 |
public class TopObjectPropertyTestCase extends TestBase { |
| 26 |
|
| 27 |
OWLDataFactory df = OWLManager.getOWLDataFactory(); |
| 28 |
|
| 29 |
@Test |
| 30 |
public void testReasoner3() throws OWLOntologyCreationException { |
| 31 |
OWLOntologyManager mngr = OWLManager.createOWLOntologyManager(); |
| 32 |
OWLOntology ont = mngr.createOntology(); |
| 33 |
OWLDataProperty p = df.getOWLDataProperty(IRI |
| 34 |
.create("http://example.com/p")); |
| 35 |
|
| 36 |
mngr.applyChange(new AddAxiom(ont, df |
| 37 |
.getOWLFunctionalDataPropertyAxiom(p))); |
| 38 |
OWLReasonerFactory fac = factory(); |
| 39 |
OWLReasoner r = fac.createReasoner(ont); |
| 40 |
assertTrue(r.isEntailed(df.getOWLSubClassOfAxiom( |
| 41 |
df.getOWLDataSomeValuesFrom(p, df.getIntegerOWLDatatype()), |
| 42 |
df.getOWLDataSomeValuesFrom(p, df.getTopDatatype())))); |
| 43 |
} |
| 44 |
|
| 45 |
@Test |
| 46 |
public void testReasoner4() throws OWLOntologyCreationException { |
| 47 |
OWLOntologyManager mngr = OWLManager.createOWLOntologyManager(); |
| 48 |
OWLOntology ont = mngr.createOntology(); |
| 49 |
OWLReasonerFactory fac = factory(); |
| 50 |
OWLReasoner r = fac.createReasoner(ont); |
| 51 |
assertFalse(r.getTopDataPropertyNode().getEntities().isEmpty()); |
| 52 |
} |
| 53 |
} |