Debian Codegraph @

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

raw symbols SCIP
1 package conformancetests;
2
3 /* This file is part of the JFact DL reasoner
4 Copyright 2011-2013 by Ignazio Palmisano, Dmitry Tsarkov, University of Manchester
5 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
6 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
7 You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA*/
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 // just so p is known in the ontology
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 }