diff options
| author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2022-05-10 18:17:06 +0100 |
|---|---|---|
| committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2022-05-11 12:34:47 +0100 |
| commit | 17bd9beaf7f358a44e5bf36a5855fe6727d506dc (patch) | |
| tree | 47e9310a0cff869d9ec017dcb2c81876407782c8 /src/test/java/uk/ac/ox/cs/hermit/HermitTester.java | |
| parent | 8651164cd632a5db310b457ce32d4fbc97bdc41c (diff) | |
| download | ACQuA-17bd9beaf7f358a44e5bf36a5855fe6727d506dc.tar.gz ACQuA-17bd9beaf7f358a44e5bf36a5855fe6727d506dc.zip | |
[pagoda] Move project to Scala
This commit includes a few changes:
- The repository still uses Maven to manage dependency but it is now a
Scala project.
- The code has been ported from OWLAPI 3.4.10 to 5.1.20
- A proof of concept program using both RSAComb and PAGOdA has been
added.
Diffstat (limited to 'src/test/java/uk/ac/ox/cs/hermit/HermitTester.java')
| -rw-r--r-- | src/test/java/uk/ac/ox/cs/hermit/HermitTester.java | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/test/java/uk/ac/ox/cs/hermit/HermitTester.java b/src/test/java/uk/ac/ox/cs/hermit/HermitTester.java new file mode 100644 index 0000000..dc70284 --- /dev/null +++ b/src/test/java/uk/ac/ox/cs/hermit/HermitTester.java | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | package uk.ac.ox.cs.hermit; | ||
| 2 | |||
| 3 | import org.semanticweb.HermiT.Configuration; | ||
| 4 | import org.semanticweb.HermiT.Reasoner; | ||
| 5 | import org.semanticweb.HermiT.model.Atom; | ||
| 6 | import org.semanticweb.HermiT.model.DLClause; | ||
| 7 | import org.semanticweb.HermiT.model.DLOntology; | ||
| 8 | import org.semanticweb.HermiT.structural.OWLClausification; | ||
| 9 | import org.semanticweb.owlapi.model.IRI; | ||
| 10 | import org.semanticweb.owlapi.model.OWLAxiom; | ||
| 11 | import org.semanticweb.owlapi.model.OWLClass; | ||
| 12 | import org.semanticweb.owlapi.model.OWLDataFactory; | ||
| 13 | import org.semanticweb.owlapi.model.OWLNamedIndividual; | ||
| 14 | import org.semanticweb.owlapi.model.OWLOntology; | ||
| 15 | import org.semanticweb.owlapi.reasoner.Node; | ||
| 16 | |||
| 17 | import uk.ac.ox.cs.pagoda.owl.OWLHelper; | ||
| 18 | |||
| 19 | public class HermitTester { | ||
| 20 | |||
| 21 | public static void main(String[] args) { | ||
| 22 | OWLOntology onto = OWLHelper.loadOntology("imported.owl"); | ||
| 23 | Reasoner hermit = new Reasoner(onto); | ||
| 24 | OWLDataFactory f = onto.getOWLOntologyManager().getOWLDataFactory(); | ||
| 25 | OWLClass concept = f.getOWLClass(IRI.create("http://semantics.crl.ibm.com/univ-bench-dl.owl#Query12")); | ||
| 26 | |||
| 27 | for (OWLOntology o: onto.getImportsClosure()) { | ||
| 28 | System.out.println(o.containsEntityInSignature(concept)); | ||
| 29 | for (OWLAxiom axiom: o.getAxioms()) | ||
| 30 | if (axiom.getClassesInSignature().contains(concept)) | ||
| 31 | System.out.println(axiom); | ||
| 32 | } | ||
| 33 | |||
| 34 | for (Node<OWLNamedIndividual> node : hermit.getInstances(concept, false)) | ||
| 35 | for (OWLNamedIndividual i: node.getEntities()) { | ||
| 36 | System.out.println(i.toStringID()); | ||
| 37 | } | ||
| 38 | |||
| 39 | // clausifierTest(); | ||
| 40 | } | ||
| 41 | |||
| 42 | @SuppressWarnings("unused") | ||
| 43 | private static void clausifierTest() { | ||
| 44 | OWLOntology onto = OWLHelper.loadOntology("/users/yzhou/ontologies/travel.owl"); | ||
| 45 | OWLClausification clausifier = new OWLClausification(new Configuration()); | ||
| 46 | DLOntology dlOntology = (DLOntology)clausifier.preprocessAndClausify(onto, null)[1]; | ||
| 47 | |||
| 48 | for (DLClause clause: dlOntology.getDLClauses()) | ||
| 49 | System.out.println(clause); | ||
| 50 | for (Atom atom : dlOntology.getPositiveFacts()) | ||
| 51 | System.out.println(atom); | ||
| 52 | |||
| 53 | } | ||
| 54 | |||
| 55 | } | ||
