01 package examples;
02
03 import dlejena.DLEJenaReasoner;
04 import java.io.File;
05 import java.net.URI;
06
07 /**
08 * An example of ABox validation using DLEJena.
09 *
10 * @author Georgios Meditskos <gmeditsk@csd.auth.gr>
11 */
12 public class ABoxValidation {
13
14 public static void main(String[] args) {
15
16
17 /*
18 * The physical URI (local path or Web address) of the ontology.
19 */
20 URI ontology = new File("src/examples/aboxValidation.owl").toURI();
21
22 /*
23 * Define an instance of the DLEJenaReasoner class.
24 * This class provides the necessary nethods for
25 * using the DLEJena library
26 */
27 DLEJenaReasoner dle = new DLEJenaReasoner();
28
29 /*
30 * Register the ontology to the reasoner.
31 */
32 dle.register(ontology);
33
34 /*
35 * Initiate the reasoning procedure. This phase involves the
36 * separation of the TBox from ABox axioms (using the OWLAPI),
37 * the TBox reasoning procedure (using Pellet), the generation of the
38 * dynamic entailments and the ABox reasoning procedure (using
39 * the forwardRete rule engine of Jena). In most cases, this
40 * method should be called only once.
41 */
42 dle.initialize();
43
44 /*
45 * The ABox is validated only on demand in order to avoid unnecessary
46 * overhead. This is done by calling the validateABox() method. The
47 * TBox inconsistencies are reported by default by Pellet.
48 */
49 dle.validateABox();
50
51 /*
52 * In the ontology of this example, two instances are defined to be
53 * same and disjoint at the same time. An exception is thrown informing
54 * about this inconsistency. Note that the default operation of DLEJena
55 * for ABox inconsinstencies is to throw an exception. However, DLEJena
56 * can be configured to print only a message without interrupting the
57 * execution. This can be done by setting:
58 * DLEJenaParameters.THROW_EXCEPTION_ON_ABOX_VALIDATION = false;
59 *
60 * Note that TBox inconsistencies are always reported as runtime exceptions.
61 */
62
63 }
64 }
|