aboutsummaryrefslogtreecommitdiff
path: root/test/uk/ac/ox/cs/hermit
diff options
context:
space:
mode:
Diffstat (limited to 'test/uk/ac/ox/cs/hermit')
-rw-r--r--test/uk/ac/ox/cs/hermit/HermitQueryReasoner.java48
-rw-r--r--test/uk/ac/ox/cs/hermit/JAIR_HermiT.java87
2 files changed, 62 insertions, 73 deletions
diff --git a/test/uk/ac/ox/cs/hermit/HermitQueryReasoner.java b/test/uk/ac/ox/cs/hermit/HermitQueryReasoner.java
index f6246f8..008fcb2 100644
--- a/test/uk/ac/ox/cs/hermit/HermitQueryReasoner.java
+++ b/test/uk/ac/ox/cs/hermit/HermitQueryReasoner.java
@@ -1,43 +1,21 @@
1package uk.ac.ox.cs.hermit; 1package uk.ac.ox.cs.hermit;
2 2
3import java.io.File;
4import java.io.FileNotFoundException;
5import java.io.FileOutputStream;
6import java.io.IOException;
7import java.io.PrintStream;
8import java.util.HashSet;
9import java.util.Set;
10import java.util.concurrent.Callable;
11import java.util.concurrent.ExecutionException;
12import java.util.concurrent.ExecutorService;
13import java.util.concurrent.Executors;
14import java.util.concurrent.Future;
15import java.util.concurrent.TimeUnit;
16import java.util.concurrent.TimeoutException;
17
18import org.semanticweb.HermiT.Reasoner; 3import org.semanticweb.HermiT.Reasoner;
19import org.semanticweb.HermiT.model.Atom; 4import org.semanticweb.HermiT.model.Atom;
20import org.semanticweb.HermiT.model.AtomicRole; 5import org.semanticweb.HermiT.model.AtomicRole;
21import org.semanticweb.owlapi.model.IRI; 6import org.semanticweb.owlapi.model.*;
22import org.semanticweb.owlapi.model.OWLAxiom;
23import org.semanticweb.owlapi.model.OWLClassExpression;
24import org.semanticweb.owlapi.model.OWLDataFactory;
25import org.semanticweb.owlapi.model.OWLDatatype;
26import org.semanticweb.owlapi.model.OWLIndividual;
27import org.semanticweb.owlapi.model.OWLNamedIndividual;
28import org.semanticweb.owlapi.model.OWLObjectProperty;
29import org.semanticweb.owlapi.model.OWLOntology;
30import org.semanticweb.owlapi.model.OWLOntologyCreationException;
31import org.semanticweb.owlapi.model.OWLOntologyManager;
32import org.semanticweb.owlapi.model.OWLOntologyStorageException;
33import org.semanticweb.owlapi.reasoner.Node; 7import org.semanticweb.owlapi.reasoner.Node;
34
35import uk.ac.ox.cs.pagoda.owl.OWLHelper; 8import uk.ac.ox.cs.pagoda.owl.OWLHelper;
36import uk.ac.ox.cs.pagoda.owl.QueryRoller; 9import uk.ac.ox.cs.pagoda.owl.QueryRoller;
37import uk.ac.ox.cs.pagoda.query.QueryManager; 10import uk.ac.ox.cs.pagoda.query.QueryManager;
38import uk.ac.ox.cs.pagoda.query.QueryRecord; 11import uk.ac.ox.cs.pagoda.query.QueryRecord;
39import uk.ac.ox.cs.pagoda.util.Timer; 12import uk.ac.ox.cs.pagoda.util.Timer;
40 13
14import java.io.*;
15import java.util.HashSet;
16import java.util.Set;
17import java.util.concurrent.*;
18
41public class HermitQueryReasoner { 19public class HermitQueryReasoner {
42 20
43 public static void main(String... args) throws FileNotFoundException, OWLOntologyCreationException, OWLOntologyStorageException { 21 public static void main(String... args) throws FileNotFoundException, OWLOntologyCreationException, OWLOntologyStorageException {
@@ -48,11 +26,13 @@ public class HermitQueryReasoner {
48// args = new String[] {"/media/krr-nas-share/Yujiao/ontologies/npd/npd-all-minus-datatype.owl", "/media/krr-nas-share/Yujiao/ontologies/npd/data/npd-data-dump-minus-datatype-new.ttl", "/users/yzhou/ontologies/npd/queries/atomic.sparql"}; 26// args = new String[] {"/media/krr-nas-share/Yujiao/ontologies/npd/npd-all-minus-datatype.owl", "/media/krr-nas-share/Yujiao/ontologies/npd/data/npd-data-dump-minus-datatype-new.ttl", "/users/yzhou/ontologies/npd/queries/atomic.sparql"};
49// args = new String[] {"/media/krr-nas-share/Yujiao/ontologies/npd/npd-all.owl", "/media/krr-nas-share/Yujiao/ontologies/npd/data/npd-data-dump-processed.ttl", "/users/yzhou/ontologies/npd/queries/atomic.sparql"}; 27// args = new String[] {"/media/krr-nas-share/Yujiao/ontologies/npd/npd-all.owl", "/media/krr-nas-share/Yujiao/ontologies/npd/data/npd-data-dump-processed.ttl", "/users/yzhou/ontologies/npd/queries/atomic.sparql"};
50// args = new String[] {PagodaTester.dbpedia_tbox, PagodaTester.dbpedia_abox, PagodaTester.dbpedia_query}; 28// args = new String[] {PagodaTester.dbpedia_tbox, PagodaTester.dbpedia_abox, PagodaTester.dbpedia_query};
51// args = new String[] {"/users/yzhou/ontologies/test/unsatisfiable.owl", null, "/users/yzhou/ontologies/test/unsatisfiable_queries.sparql"}; 29// args = new String[] {"/users/yzhou/ontologies/answersCorrectness/unsatisfiable.owl", null, "/users/yzhou/ontologies/answersCorrectness/unsatisfiable_queries.sparql"};
52 30
53// args = new String[] {"/media/krr-nas-share/Yujiao/ontologies/bio2rdf/chembl/cco-processed-noDPR-noDPD.ttl", "/media/krr-nas-share/Yujiao/ontologies/bio2rdf/chembl/graph sampling/sample_100.nt", "/media/krr-nas-share/Yujiao/ontologies/bio2rdf/chembl/queries/atomic_one_filtered.sparql", "../test-share/results/chembl/hermit_1p"}; 31// args = new String[] {"/media/krr-nas-share/Yujiao/ontologies/bio2rdf/chembl/cco-processed-noDPR-noDPD.ttl", "/media/krr-nas-share/Yujiao/ontologies/bio2rdf/chembl/graph sampling/sample_100.nt", "/media/krr-nas-share/Yujiao/ontologies/bio2rdf/chembl/queries/atomic_one_filtered.sparql", "../answersCorrectness-share/results/chembl/hermit_1p"};
54 args = new String[] {"/users/yzhou/temp/uniprot_debug/core-processed-noDis.owl", "/users/yzhou/temp/uniprot_debug/sample_1_removed.nt", "/media/krr-nas-share/Yujiao/ontologies/bio2rdf/uniprot/queries/atomic_one.sparql", "../test-share/results/uniprot/hermit_1p"}; } 32 args =
55// args = new String[] {"imported.owl", "", "/media/krr-nas-share/Yujiao/ontologies/bio2rdf/uniprot/queries/atomic_one.sparql", "../test-share/results/uniprot/hermit_1p"}; } 33 new String[]{"/users/yzhou/temp/uniprot_debug/core-processed-noDis.owl", "/users/yzhou/temp/uniprot_debug/sample_1_removed.nt", "/media/krr-nas-share/Yujiao/ontologies/bio2rdf/uniprot/queries/atomic_one.sparql", "../answersCorrectness-share/results/uniprot/hermit_1p"};
34 }
35// args = new String[] {"imported.owl", "", "/media/krr-nas-share/Yujiao/ontologies/bio2rdf/uniprot/queries/atomic_one.sparql", "../answersCorrectness-share/results/uniprot/hermit_1p"}; }
56 36
57 37
58 PrintStream ps = args.length < 4 ? null : new PrintStream(new File(args[3])); 38 PrintStream ps = args.length < 4 ? null : new PrintStream(new File(args[3]));
@@ -60,8 +40,8 @@ public class HermitQueryReasoner {
60 if (args[i] == null || args[i].equalsIgnoreCase("null")) args[i] = ""; 40 if (args[i] == null || args[i].equalsIgnoreCase("null")) args[i] = "";
61 System.out.println("Argument " + i + ": " + args[i]); 41 System.out.println("Argument " + i + ": " + args[i]);
62 } 42 }
63 43
64// PrintStream ps = null; // new PrintStream(new File("../test-share/results/reactome/ ")); 44// PrintStream ps = null; // new PrintStream(new File("../answersCorrectness-share/results/reactome/ "));
65 if (ps != null) System.setOut(ps); 45 if (ps != null) System.setOut(ps);
66 46
67 Timer t = new Timer(); 47 Timer t = new Timer();
diff --git a/test/uk/ac/ox/cs/hermit/JAIR_HermiT.java b/test/uk/ac/ox/cs/hermit/JAIR_HermiT.java
index 2fc478d..72e7af8 100644
--- a/test/uk/ac/ox/cs/hermit/JAIR_HermiT.java
+++ b/test/uk/ac/ox/cs/hermit/JAIR_HermiT.java
@@ -1,119 +1,128 @@
1package uk.ac.ox.cs.hermit; 1package uk.ac.ox.cs.hermit;
2 2
3import org.junit.Test; 3import org.junit.Test;
4 4import uk.ac.ox.cs.pagoda.util.TestUtil;
5import uk.ac.ox.cs.pagoda.tester.PagodaTester;
6 5
7public class JAIR_HermiT { 6public class JAIR_HermiT {
8 7
9 @Test 8 @Test
10 public void lubm1() throws Exception { 9 public void lubm1() throws Exception {
10 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
11 String[] args = new String[] { 11 String[] args = new String[] {
12 PagodaTester.onto_dir + "lubm/univ-bench.owl", 12 TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"),
13 PagodaTester.onto_dir + "lubm/data/lubm1_owl", 13 TestUtil.combinePaths(ontoDir, "lubm/data/lubm1_owl"),
14 PagodaTester.onto_dir + "lubm/queries/test.sparql" 14 TestUtil.combinePaths(ontoDir, "lubm/queries/answersCorrectness.sparql")
15// , "/home/yzhou/java-workspace/test-share/results_new/lubm1/hermit" 15// , "/home/yzhou/java-workspace/answersCorrectness-share/results_new/lubm1/hermit"
16 }; 16 };
17 HermitQueryReasoner.main(args); 17 HermitQueryReasoner.main(args);
18 } 18 }
19 19
20 @Test 20 @Test
21 public void lubm1_rolledUp() throws Exception { 21 public void lubm1_rolledUp() throws Exception {
22 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
22 String[] args = new String[] { 23 String[] args = new String[] {
23 "/home/yzhou/backup/20141212/univ-bench-queries.owl", 24 "/home/yzhou/backup/20141212/univ-bench-queries.owl",
24 PagodaTester.onto_dir + "lubm/data/lubm1_owl", 25 TestUtil.combinePaths(ontoDir, "lubm/data/lubm1_owl"),
25 PagodaTester.onto_dir + "lubm/queries/atomic_lubm.sparql" 26 TestUtil.combinePaths(ontoDir, "lubm/queries/atomic_lubm.sparql")
26// , "/home/yzhou/java-workspace/test-share/results_new/lubm1/hermit_rolledUp" 27// , "/home/yzhou/java-workspace/answersCorrectness-share/results_new/lubm1/hermit_rolledUp"
27 }; 28 };
28 HermitQueryReasoner.main(args); 29 HermitQueryReasoner.main(args);
29 } 30 }
30 31
31 @Test 32 @Test
32 public void uobm1() throws Exception { 33 public void uobm1() throws Exception {
34 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
33 String[] args = new String[] { 35 String[] args = new String[] {
34 PagodaTester.onto_dir + "uobm/univ-bench-dl.owl", 36 TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"),
35 PagodaTester.onto_dir + "uobm/data/uobm1_owl_withDeclaration", 37 TestUtil.combinePaths(ontoDir, "uobm/data/uobm1_owl_withDeclaration"),
36 PagodaTester.onto_dir + "uobm/queries/standard.sparql" 38 TestUtil.combinePaths(ontoDir, "uobm/queries/standard.sparql")
37// , "hermit_uobm1.out" 39// , "hermit_uobm1.out"
38// , "/home/yzhou/java-workspace/test-share/results_new/uobm1/hermit" 40// , "/home/yzhou/java-workspace/answersCorrectness-share/results_new/uobm1/hermit"
39 }; 41 };
40 HermitQueryReasoner.main(args); 42 HermitQueryReasoner.main(args);
41 } 43 }
42 44
43 @Test 45 @Test
44 public void uobm1_rolledUp() throws Exception { 46 public void uobm1_rolledUp() throws Exception {
47 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
45 String[] args = new String[] { 48 String[] args = new String[] {
46 "/home/yzhou/backup/20141212/univ-bench-dl-queries.owl", 49 "/home/yzhou/backup/20141212/univ-bench-dl-queries.owl",
47 PagodaTester.onto_dir + "uobm/data/uobm1_owl_withDeclaration", 50 TestUtil.combinePaths(ontoDir, "uobm/data/uobm1_owl_withDeclaration"),
48 PagodaTester.onto_dir + "uobm/queries/atomic_uobm.sparql" 51 TestUtil.combinePaths(ontoDir, "uobm/queries/atomic_uobm.sparql")
49 , "hermit_uobm1_rolledUp.out" 52 , "hermit_uobm1_rolledUp.out"
50// , "/home/yzhou/java-workspace/test-share/results_new/uobm1/hermit_rolledUp" 53// , "/home/yzhou/java-workspace/answersCorrectness-share/results_new/uobm1/hermit_rolledUp"
51 }; 54 };
52 HermitQueryReasoner.main(args); 55 HermitQueryReasoner.main(args);
53 } 56 }
54 57
55 @Test 58 @Test
56 public void fly_rolledUp() throws Exception { 59 public void fly_rolledUp() throws Exception {
60 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
57 HermitQueryReasoner.main( 61 HermitQueryReasoner.main(
58 PagodaTester.onto_dir + "fly/fly-all-in-one_rolledUp.owl", 62 TestUtil.combinePaths(ontoDir, "fly/fly-all-in-one_rolledUp.owl"),
59// PagodaTester.onto_dir + "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl", 63// TestUtil.combinePaths(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl",
60 null, 64 null,
61 PagodaTester.onto_dir + "fly/queries/fly_atomic.sparql" 65 TestUtil.combinePaths(ontoDir, "fly/queries/fly_atomic.sparql")
62 , "hermit_fly.out" 66 , "hermit_fly.out"
63 ); 67 );
64 } 68 }
65 69
66 @Test 70 @Test
67 public void npd() throws Exception { 71 public void npd() throws Exception {
72 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
68 HermitQueryReasoner.main( 73 HermitQueryReasoner.main(
69 PagodaTester.onto_dir + "npd/npd-all-minus-datatype.owl", 74 TestUtil.combinePaths(ontoDir, "npd/npd-all-minus-datatype.owl"),
70 PagodaTester.onto_dir + "npd/data/npd-data-dump-minus-datatype-new.ttl", 75 TestUtil.combinePaths(ontoDir, "npd/data/npd-data-dump-minus-datatype-new.ttl"),
71 PagodaTester.onto_dir + "npd/queries/atomic_ground.sparql" 76 TestUtil.combinePaths(ontoDir, "npd/queries/atomic_ground.sparql")
72 , "hermit_npd.out" 77 , "hermit_npd.out"
73// , "/home/yzhou/java-workspace/test-share/results_new/npd/hermit" 78// , "/home/yzhou/java-workspace/answersCorrectness-share/results_new/npd/hermit"
74 ); 79 );
75 } 80 }
76 81
77 @Test 82 @Test
78 public void dbpedia() throws Exception { 83 public void dbpedia() throws Exception {
84 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
79 HermitQueryReasoner.main( 85 HermitQueryReasoner.main(
80 PagodaTester.onto_dir + "dbpedia/integratedOntology-all-in-one-minus-datatype.owl", 86 TestUtil.combinePaths(ontoDir, "dbpedia/integratedOntology-all-in-one-minus-datatype.owl"),
81 PagodaTester.onto_dir + "dbpedia/data/dbpedia-minus-datatype-new.ttl", 87 TestUtil.combinePaths(ontoDir, "dbpedia/data/dbpedia-minus-datatype-new.ttl"),
82 PagodaTester.onto_dir + "dbpedia/queries/atomic_ground.sparql" 88 TestUtil.combinePaths(ontoDir, "dbpedia/queries/atomic_ground.sparql")
83 , "/home/yzhou/java-workspace/test-share/results_new/dbpedia/hermit" 89 , "/home/yzhou/java-workspace/answersCorrectness-share/results_new/dbpedia/hermit"
84 ); 90 );
85 } 91 }
86 92
87 @Test 93 @Test
88 public void reactome() throws Exception { 94 public void reactome() throws Exception {
95 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
89 HermitQueryReasoner.main( 96 HermitQueryReasoner.main(
90 PagodaTester.onto_dir + "bio2rdf/reactome/biopax-level3-processed.owl", 97 TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/biopax-level3-processed.owl"),
91 PagodaTester.onto_dir + "bio2rdf/reactome/graph sampling/reactome_sample_10.ttl", 98 TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/graph sampling/reactome_sample_10.ttl"),
92 PagodaTester.onto_dir + "bio2rdf/reactome/queries/atomic_ground.sparql" 99 TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/queries/atomic_ground.sparql")
93 , "/home/yzhou/java-workspace/test-share/results_new/reactome/hermit_10p" 100 , "/home/yzhou/java-workspace/answersCorrectness-share/results_new/reactome/hermit_10p"
94 ); 101 );
95 } 102 }
96 103
97 @Test 104 @Test
98 public void chembl() throws Exception { 105 public void chembl() throws Exception {
106 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
99 HermitQueryReasoner.main( 107 HermitQueryReasoner.main(
100 PagodaTester.onto_dir + "bio2rdf/chembl/cco-noDPR.ttl", 108 TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/cco-noDPR.ttl"),
101// null, 109// null,
102 PagodaTester.onto_dir + "bio2rdf/chembl/graph sampling/sample_1.nt", 110 TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/graph sampling/sample_1.nt"),
103 PagodaTester.onto_dir + "bio2rdf/chembl/queries/atomic_ground.sparql" 111 TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/queries/atomic_ground.sparql")
104 , "hermit_chembl.out" 112 , "hermit_chembl.out"
105// , "/home/yzhou/java-workspace/test-share/results_new/chembl/hermit_1p" 113// , "/home/yzhou/java-workspace/answersCorrectness-share/results_new/chembl/hermit_1p"
106 ); 114 );
107 } 115 }
108 116
109 @Test 117 @Test
110 public void uniprot() throws Exception { 118 public void uniprot() throws Exception {
119 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
111 HermitQueryReasoner.main( 120 HermitQueryReasoner.main(
112 PagodaTester.onto_dir + "bio2rdf/uniprot/core-sat.owl", 121 TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/core-sat.owl"),
113 PagodaTester.onto_dir + "bio2rdf/uniprot/graph sampling/sample_1.nt", 122 TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/graph sampling/sample_1.nt"),
114 PagodaTester.onto_dir + "bio2rdf/uniprot/queries/atomic_ground.sparql" 123 TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/queries/atomic_ground.sparql")
115 , "hermit_uniprot.out" 124 , "hermit_uniprot.out"
116// , "/home/yzhou/java-workspace/test-share/results_new/uniprot/hermit_1p" 125// , "/home/yzhou/java-workspace/answersCorrectness-share/results_new/uniprot/hermit_1p"
117 ); 126 );
118 } 127 }
119 128