aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRncLsn <rnc.lsn@gmail.com>2015-05-07 19:26:24 +0100
committerRncLsn <rnc.lsn@gmail.com>2015-05-07 19:26:24 +0100
commit5be5fd3daa0d50980fb3791e904e035cdbca254f (patch)
tree8109fdd92d6a8f3b59b47f147d21e23b84301494 /test
parent11a432bfc3cb11e07c68c4298fcec060ff1e25fa (diff)
downloadACQuA-5be5fd3daa0d50980fb3791e904e035cdbca254f.tar.gz
ACQuA-5be5fd3daa0d50980fb3791e904e035cdbca254f.zip
Making the output machine-readable (JSON).
Diffstat (limited to 'test')
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/CostEvaluation.java44
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/JAIR_PAGOdA.java143
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/JAIR_Scalability.java33
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/LightEvaluation.java45
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaDBPedia.java16
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaELU.java10
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaFLY.java7
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java64
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD.java25
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD_bench.java16
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaRLU.java12
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java75
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/TestGlobalCorrectness.java55
-rw-r--r--test/uk/ac/ox/cs/pagoda/tester/PagodaTester.java16
-rw-r--r--test/uk/ac/ox/cs/pagoda/util/TestUtil.java64
15 files changed, 339 insertions, 286 deletions
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/CostEvaluation.java b/test/uk/ac/ox/cs/pagoda/test_units/CostEvaluation.java
index 4e32297..968cf01 100644
--- a/test/uk/ac/ox/cs/pagoda/test_units/CostEvaluation.java
+++ b/test/uk/ac/ox/cs/pagoda/test_units/CostEvaluation.java
@@ -1,12 +1,12 @@
1package uk.ac.ox.cs.pagoda.test_units; 1package uk.ac.ox.cs.pagoda.test_units;
2 2
3import org.semanticweb.owlapi.model.OWLOntology; 3import org.semanticweb.owlapi.model.OWLOntology;
4
5import org.testng.annotations.Test; 4import org.testng.annotations.Test;
6import uk.ac.ox.cs.pagoda.owl.OWLHelper; 5import uk.ac.ox.cs.pagoda.owl.OWLHelper;
7import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner; 6import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner;
8import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner.Type; 7import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner.Type;
9import uk.ac.ox.cs.pagoda.tester.PagodaTester; 8import uk.ac.ox.cs.pagoda.tester.PagodaTester;
9import uk.ac.ox.cs.pagoda.util.TestUtil;
10import uk.ac.ox.cs.pagoda.util.Timer; 10import uk.ac.ox.cs.pagoda.util.Timer;
11import uk.ac.ox.cs.pagoda.util.Utility; 11import uk.ac.ox.cs.pagoda.util.Utility;
12 12
@@ -15,20 +15,22 @@ public class CostEvaluation {
15 @Test 15 @Test
16 public void lubm100() { 16 public void lubm100() {
17 int number = 1; 17 int number = 1;
18 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
18 PagodaTester.main( 19 PagodaTester.main(
19 PagodaTester.onto_dir + "lubm/univ-bench.owl", 20 TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"),
20 PagodaTester.onto_dir + "lubm/data/lubm" + number + ".ttl", 21 TestUtil.combinePaths(ontoDir, "lubm/data/lubm" + number + ".ttl"),
21 PagodaTester.onto_dir + "lubm/queries/test_all_pagoda.sparql" 22 TestUtil.combinePaths(ontoDir, "lubm/queries/test_all_pagoda.sparql")
22 ); 23 );
23// AllTests.copy("output/log4j.log", "results-backup/jair/lubm" + number + ".out"); 24// AllTests.copy("output/log4j.log", "results-backup/jair/lubm" + number + ".out");
24 } 25 }
25 26
26 public void lubm1000() { 27 public void lubm1000() {
27 int number = 1000; 28 int number = 1000;
29 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
28 String[] args = new String[] { 30 String[] args = new String[] {
29 PagodaTester.onto_dir + "lubm/univ-bench.owl", 31 TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"),
30 PagodaTester.onto_dir + "lubm/data/lubm" + number + ".ttl", 32 TestUtil.combinePaths(ontoDir, "lubm/data/lubm" + number + ".ttl"),
31 PagodaTester.onto_dir + "lubm/queries/test_all_pagoda.sparql" 33 TestUtil.combinePaths(ontoDir, "lubm/queries/test_all_pagoda.sparql")
32 }; 34 };
33 OWLOntology ontology = OWLHelper.loadOntology(args[0]); 35 OWLOntology ontology = OWLHelper.loadOntology(args[0]);
34 QueryReasoner reasoner = QueryReasoner.getInstance(Type.ELHOU, ontology, true, true); 36 QueryReasoner reasoner = QueryReasoner.getInstance(Type.ELHOU, ontology, true, true);
@@ -46,10 +48,11 @@ public class CostEvaluation {
46 @Test 48 @Test
47 public void uobm5() { 49 public void uobm5() {
48 int number = 1; 50 int number = 1;
51 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
49 String[] args = new String[] { 52 String[] args = new String[] {
50 PagodaTester.onto_dir + "uobm/univ-bench-dl.owl", 53 TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"),
51 PagodaTester.onto_dir + "uobm/data/uobm" + number + ".ttl", 54 TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"),
52 PagodaTester.onto_dir + "uobm/queries/standard_all_pagoda.sparql" 55 TestUtil.combinePaths(ontoDir, "uobm/queries/standard_all_pagoda.sparql")
53 }; 56 };
54 PagodaTester.main(args); 57 PagodaTester.main(args);
55// AllTests.copy("output/log4j.log", "results-backup/jair/uobm" + number + ".out"); 58// AllTests.copy("output/log4j.log", "results-backup/jair/uobm" + number + ".out");
@@ -57,10 +60,11 @@ public class CostEvaluation {
57 60
58 public void uobm100() { 61 public void uobm100() {
59 int number = 200; 62 int number = 200;
63 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
60 String[] args = new String[] { 64 String[] args = new String[] {
61 PagodaTester.onto_dir + "uobm/univ-bench-dl.owl", 65 TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"),
62 PagodaTester.onto_dir + "uobm/data/uobm" + number + ".ttl", 66 TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"),
63 PagodaTester.onto_dir + "uobm/queries/standard_group3_all.sparql" 67 TestUtil.combinePaths(ontoDir, "uobm/queries/standard_group3_all.sparql")
64 }; 68 };
65 PagodaTester.main(args); 69 PagodaTester.main(args);
66// AllTests.copy("output/log4j.log", "results-backup/jair/uobm" + number + ".out"); 70// AllTests.copy("output/log4j.log", "results-backup/jair/uobm" + number + ".out");
@@ -68,10 +72,11 @@ public class CostEvaluation {
68 72
69 public void uobm500() { 73 public void uobm500() {
70 int number = 500; 74 int number = 500;
75 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
71 String[] args = new String[] { 76 String[] args = new String[] {
72 PagodaTester.onto_dir + "uobm/univ-bench-dl.owl", 77 TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"),
73 PagodaTester.onto_dir + "uobm/data/uobm" + number + ".ttl", 78 TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"),
74 PagodaTester.onto_dir + "uobm/queries/standard_all_pagoda.sparql" 79 TestUtil.combinePaths(ontoDir, "uobm/queries/standard_all_pagoda.sparql")
75 }; 80 };
76 81
77 OWLOntology ontology = OWLHelper.loadOntology(args[0]); 82 OWLOntology ontology = OWLHelper.loadOntology(args[0]);
@@ -89,10 +94,11 @@ public class CostEvaluation {
89 94
90 95
91 public static void main(String... args) { 96 public static void main(String... args) {
97 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
92 args = new String[] { 98 args = new String[] {
93 PagodaTester.onto_dir + "dbpedia/integratedOntology-all-in-one-minus-datatype.owl", 99 TestUtil.combinePaths(ontoDir, "dbpedia/integratedOntology-all-in-one-minus-datatype.owl"),
94 PagodaTester.onto_dir + "dbpedia/data/dbpedia-minus-datatype-new.ttl", 100 TestUtil.combinePaths(ontoDir, "dbpedia/data/dbpedia-minus-datatype-new.ttl"),
95 PagodaTester.onto_dir + "dbpedia/queries/atomic_ground.sparql" 101 TestUtil.combinePaths(ontoDir, "dbpedia/queries/atomic_ground.sparql")
96 }; 102 };
97 103
98 OWLOntology ontology = OWLHelper.loadOntology(args[0]); 104 OWLOntology ontology = OWLHelper.loadOntology(args[0]);
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/JAIR_PAGOdA.java b/test/uk/ac/ox/cs/pagoda/test_units/JAIR_PAGOdA.java
index ff616f7..10ac974 100644
--- a/test/uk/ac/ox/cs/pagoda/test_units/JAIR_PAGOdA.java
+++ b/test/uk/ac/ox/cs/pagoda/test_units/JAIR_PAGOdA.java
@@ -2,7 +2,7 @@ package uk.ac.ox.cs.pagoda.test_units;
2 2
3import org.testng.annotations.Test; 3import org.testng.annotations.Test;
4import uk.ac.ox.cs.pagoda.tester.PagodaTester; 4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
5import uk.ac.ox.cs.pagoda.util.Utility; 5import uk.ac.ox.cs.pagoda.util.TestUtil;
6 6
7import java.io.IOException; 7import java.io.IOException;
8 8
@@ -10,162 +10,175 @@ public class JAIR_PAGOdA {
10 10
11 @Test 11 @Test
12 public void lubm1() throws IOException { 12 public void lubm1() throws IOException {
13 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
13 String[] args = new String[] { 14 String[] args = new String[] {
14 PagodaTester.onto_dir + "lubm/univ-bench.owl", 15 TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"),
15 PagodaTester.onto_dir + "lubm/data/lubm1.ttl", 16 TestUtil.combinePaths(ontoDir, "lubm/data/lubm1.ttl"),
16 PagodaTester.onto_dir + "lubm/queries/test.sparql" 17 TestUtil.combinePaths(ontoDir, "lubm/queries/test.sparql")
17 }; 18 };
18 PagodaTester.main(args); 19 PagodaTester.main(args);
19 Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/lubm1/pagoda"); 20 TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/lubm1/pagoda");
20 } 21 }
21 22
22 @Test 23 @Test
23 public void lubm1_conj() throws IOException { 24 public void lubm1_conj() throws IOException {
25 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
24 String[] args = new String[] { 26 String[] args = new String[] {
25 PagodaTester.onto_dir + "lubm/univ-bench.owl", 27 TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"),
26 PagodaTester.onto_dir + "lubm/data/lubm1.ttl", 28 TestUtil.combinePaths(ontoDir, "lubm/data/lubm1.ttl"),
27 PagodaTester.onto_dir + "lubm/queries/test_pellet.sparql" 29 TestUtil.combinePaths(ontoDir, "lubm/queries/test_pellet.sparql")
28 }; 30 };
29 PagodaTester.main(args); 31 PagodaTester.main(args);
30 Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/lubm1/pagoda_conj"); 32 TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/lubm1/pagoda_conj");
31 } 33 }
32 34
33 @Test 35 @Test
34 public void lubm1_rolledUp() throws IOException { 36 public void lubm1_rolledUp() throws IOException {
35 String[] args = new String[] { 37 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
38 PagodaTester.main(
36 "/home/yzhou/backup/20141212/univ-bench-queries.owl", 39 "/home/yzhou/backup/20141212/univ-bench-queries.owl",
37 PagodaTester.onto_dir + "lubm/data/lubm1.ttl", 40 TestUtil.combinePaths(ontoDir, "lubm/data/lubm1.ttl"),
38 PagodaTester.onto_dir + "lubm/queries/atomic_lubm.sparql" 41 TestUtil.combinePaths(ontoDir, "lubm/queries/atomic_lubm.sparql")
39 }; 42 );
40 PagodaTester.main(args); 43 TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/lubm1/pagoda_rolledUp");
41 Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/lubm1/pagoda_rolledUp");
42 } 44 }
43 45
44 @Test 46 @Test
45 public void uobm1() throws IOException { 47 public void uobm1() throws IOException {
48 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
46 String[] args = new String[] { 49 String[] args = new String[] {
47 PagodaTester.onto_dir + "uobm/univ-bench-dl.owl", 50 TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"),
48 PagodaTester.onto_dir + "uobm/data/uobm1.ttl", 51 TestUtil.combinePaths(ontoDir, "uobm/data/uobm1.ttl"),
49 PagodaTester.onto_dir + "uobm/queries/standard.sparql" 52 TestUtil.combinePaths(ontoDir, "uobm/queries/standard.sparql")
50 }; 53 };
51 PagodaTester.main(args); 54 PagodaTester.main(args);
52 Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uobm1/pagoda"); 55 TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uobm1/pagoda");
53 } 56 }
54 57
55 @Test 58 @Test
56 public void uobm1_conj() throws IOException { 59 public void uobm1_conj() throws IOException {
60 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
57 String[] args = new String[] { 61 String[] args = new String[] {
58 PagodaTester.onto_dir + "uobm/univ-bench-dl.owl", 62 TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"),
59 PagodaTester.onto_dir + "uobm/data/uobm1.ttl", 63 TestUtil.combinePaths(ontoDir, "uobm/data/uobm1.ttl"),
60 PagodaTester.onto_dir + "uobm/queries/standard_pellet.sparql" 64 TestUtil.combinePaths(ontoDir, "uobm/queries/standard_pellet.sparql")
61 }; 65 };
62 PagodaTester.main(args); 66 PagodaTester.main(args);
63 Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uobm1/pagoda_conj"); 67 TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uobm1/pagoda_conj");
64 } 68 }
65 69
66 @Test 70 @Test
67 public void uobm1_rolledUp() { 71 public void uobm1_rolledUp() {
72 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
68 String[] args = new String[] { 73 String[] args = new String[] {
69 "/home/yzhou/backup/20141212/univ-bench-dl-queries.owl", 74 "/home/yzhou/backup/20141212/univ-bench-dl-queries.owl",
70 PagodaTester.onto_dir + "uobm/data/uobm1.ttl", 75 TestUtil.combinePaths(ontoDir, "uobm/data/uobm1.ttl"),
71 PagodaTester.onto_dir + "uobm/queries/atomic_uobm.sparql" 76 TestUtil.combinePaths(ontoDir, "uobm/queries/atomic_uobm.sparql")
72 }; 77 };
73 PagodaTester.main(args); 78 PagodaTester.main(args);
74// AllTests.copy("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uobm1/pagoda_rolledUp"); 79// TestUtil.copyFile(("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uobm1/pagoda_rolledUp");
75 } 80 }
76 81
77 @Test 82 @Test
78 public void fly() { 83 public void fly() {
84 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
79 String[] args = new String[] { 85 String[] args = new String[] {
80 PagodaTester.onto_dir + "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl", 86 TestUtil.combinePaths(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl"),
81 null, 87 null,
82 PagodaTester.onto_dir + "fly/queries/fly_pellet.sparql" 88 TestUtil.combinePaths(ontoDir, "fly/queries/fly_pellet.sparql")
83 }; 89 };
84 PagodaTester.main(args); 90 PagodaTester.main(args);
85// AllTests.copy("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/fly/pagoda"); 91// TestUtil.copyFile(("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/fly/pagoda");
86 } 92 }
87 93
88 @Test 94 @Test
89 public void fly_conj() throws IOException { 95 public void fly_conj() throws IOException {
96 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
90 String[] args = new String[] { 97 String[] args = new String[] {
91 PagodaTester.onto_dir + "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl", 98 TestUtil.combinePaths(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl"),
92 null, 99 null,
93 PagodaTester.onto_dir + "fly/queries/fly_pellet.sparql" 100 TestUtil.combinePaths(ontoDir, "fly/queries/fly_pellet.sparql")
94 }; 101 };
95 PagodaTester.main(args); 102 PagodaTester.main(args);
96 Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/fly/pagoda_conj"); 103 TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/fly/pagoda_conj");
97 } 104 }
98 105
99 106
100 public void fly_rolledUp() { 107 public void fly_rolledUp() {
101 PagodaTester.main(new String[] { 108 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
102// PagodaTester.onto_dir + "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl", 109 PagodaTester.main(
103 PagodaTester.onto_dir + "fly/fly-all-in-one_rolledUp.owl", 110// TestUtil.combinePaths(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl",
111 TestUtil.combinePaths(ontoDir, "fly/fly-all-in-one_rolledUp.owl"),
104 null, 112 null,
105 PagodaTester.onto_dir + "fly/queries/fly_atomic.sparql" 113 TestUtil.combinePaths(ontoDir, "fly/queries/fly_atomic.sparql")
106 }); 114 );
107// Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/fly/pagoda_rolledUp"); 115// TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/fly/pagoda_rolledUp");
108 } 116 }
109 117
110 public void dbpedia() { 118 public void dbpedia() {
119 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
111 PagodaTester.main( 120 PagodaTester.main(
112 PagodaTester.onto_dir + "dbpedia/integratedOntology-all-in-one-minus-datatype.owl", 121 TestUtil.combinePaths(ontoDir, "dbpedia/integratedOntology-all-in-one-minus-datatype.owl"),
113 PagodaTester.onto_dir + "dbpedia/data/dbpedia-minus-datatype-new.ttl", 122 TestUtil.combinePaths(ontoDir, "dbpedia/data/dbpedia-minus-datatype-new.ttl"),
114 PagodaTester.onto_dir + "dbpedia/queries/atomic_ground.sparql" 123 TestUtil.combinePaths(ontoDir, "dbpedia/queries/atomic_ground.sparql"),
115 , "dbpedia.ans" 124 "dbpedia.ans"
116 ); 125 );
117 126
118// Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/dbpedia/pagoda"); 127// TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/dbpedia/pagoda");
119 } 128 }
120 129
121 public void npd() { 130 public void npd() {
131 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
122 PagodaTester.main( 132 PagodaTester.main(
123 PagodaTester.onto_dir + "npd/npd-all-minus-datatype.owl", 133 TestUtil.combinePaths(ontoDir, "npd/npd-all-minus-datatype.owl"),
124 PagodaTester.onto_dir + "npd/data/npd-data-dump-minus-datatype-new.ttl", 134 TestUtil.combinePaths(ontoDir, "npd/data/npd-data-dump-minus-datatype-new.ttl"),
125 PagodaTester.onto_dir + "npd/queries/atomic_ground.sparql" 135 TestUtil.combinePaths(ontoDir, "npd/queries/atomic_ground.sparql")
126 , "npd.ans" 136 , "npd.ans"
127 ); 137 );
128 138
129// Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/npd/pagoda"); 139// TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/npd/pagoda");
130 } 140 }
131 141
132 public void reactome() throws IOException { 142 public void reactome() throws IOException {
143 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
133 PagodaTester.main( 144 PagodaTester.main(
134 PagodaTester.onto_dir + "bio2rdf/reactome/biopax-level3-processed.owl", 145 TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/biopax-level3-processed.owl"),
135 PagodaTester.onto_dir + "bio2rdf/reactome/graph sampling/reactome_sample_10.ttl", 146 TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/graph sampling/reactome_sample_10.ttl"),
136// null, 147// null,
137// PagodaTester.onto_dir + "bio2rdf/reactome/queries/atomic_ground.sparql" 148// TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/queries/atomic_ground.sparql")
138 PagodaTester.onto_dir + "bio2rdf/reactome/queries/example.sparql" 149 TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/queries/example.sparql")
139 , "pagoda_reactome.ans" 150 , "pagoda_reactome.ans"
140 ); 151 );
141 Utility.copyFile("log4j.log", "output/jair/pagoda_reactome.example"); 152 TestUtil.copyFile("log4j.log", "output/jair/pagoda_reactome.example");
142 153
143// AllTests.copy("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/reactome/pagoda_10p"); 154// TestUtil.copyFile(("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/reactome/pagoda_10p");
144 } 155 }
145 156
146 public void chembl() throws IOException { 157 public void chembl() throws IOException {
158 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
147 PagodaTester.main( 159 PagodaTester.main(
148 PagodaTester.onto_dir + "bio2rdf/chembl/cco-noDPR.ttl", 160 TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/cco-noDPR.ttl"),
149 PagodaTester.onto_dir + "bio2rdf/chembl/graph sampling/sample_1.nt", 161 TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/graph sampling/sample_1.nt"),
150// PagodaTester.onto_dir + "bio2rdf/chembl/queries/atomic_ground.sparql" 162// TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/queries/atomic_ground.sparql")
151 PagodaTester.onto_dir + "bio2rdf/chembl/queries/example.sparql" 163 TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/queries/example.sparql")
152 , "pagoda_chembl.ans" 164 , "pagoda_chembl.ans"
153 ); 165 );
154 Utility.copyFile("log4j.log", "output/jair/pagoda_chembl.example"); 166 TestUtil.copyFile("log4j.log", "output/jair/pagoda_chembl.example");
155// Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/chembl/pagoda_1p"); 167// TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/chembl/pagoda_1p");
156 } 168 }
157 169
158 public void uniprot() throws IOException { 170 public void uniprot() throws IOException {
171 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
159 PagodaTester.main( 172 PagodaTester.main(
160 PagodaTester.onto_dir + "bio2rdf/uniprot/core-sat-processed.owl", 173 TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/core-sat-processed.owl"),
161 PagodaTester.onto_dir + "bio2rdf/uniprot/graph sampling/sample_1.nt", 174 TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/graph sampling/sample_1.nt"),
162// null, 175// null,
163// PagodaTester.onto_dir + "bio2rdf/uniprot/queries/atomic_ground.sparql" 176// TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/queries/atomic_ground.sparql")
164 PagodaTester.onto_dir + "bio2rdf/uniprot/queries/example.sparql" 177 TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/queries/example.sparql")
165 , "pagoda_uniprot.ans" 178 , "pagoda_uniprot.ans"
166 ); 179 );
167 Utility.copyFile("log4j.log", "output/jair/pagoda_uniprot.example"); 180 TestUtil.copyFile("log4j.log", "output/jair/pagoda_uniprot.example");
168// AllTests.copy("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uniprot/pagoda_1p"); 181// TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uniprot/pagoda_1p");
169 } 182 }
170 183
171 184
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/JAIR_Scalability.java b/test/uk/ac/ox/cs/pagoda/test_units/JAIR_Scalability.java
index 43cb810..2cf8446 100644
--- a/test/uk/ac/ox/cs/pagoda/test_units/JAIR_Scalability.java
+++ b/test/uk/ac/ox/cs/pagoda/test_units/JAIR_Scalability.java
@@ -3,7 +3,7 @@ package uk.ac.ox.cs.pagoda.test_units;
3import org.testng.annotations.Test; 3import org.testng.annotations.Test;
4import uk.ac.ox.cs.pagoda.tester.PagodaTester; 4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
5import uk.ac.ox.cs.pagoda.util.Properties; 5import uk.ac.ox.cs.pagoda.util.Properties;
6import uk.ac.ox.cs.pagoda.util.Utility; 6import uk.ac.ox.cs.pagoda.util.TestUtil;
7 7
8import java.io.IOException; 8import java.io.IOException;
9 9
@@ -27,10 +27,11 @@ public class JAIR_Scalability {
27 } 27 }
28 28
29 public void testReactome(int percentage, boolean save) throws IOException { 29 public void testReactome(int percentage, boolean save) throws IOException {
30 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
30 String[] args = new String[] { 31 String[] args = new String[] {
31 PagodaTester.onto_dir + "bio2rdf/reactome/biopax-level3-processed.owl", 32 TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/biopax-level3-processed.owl"),
32 PagodaTester.onto_dir + "bio2rdf/reactome/graph sampling/simplifed_sample_" + percentage + ".ttl", 33 TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/graph sampling/simplifed_sample_" + percentage + ".ttl"),
33 PagodaTester.onto_dir + "bio2rdf/reactome/queries/test.sparql" 34 TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/queries/test.sparql")
34 , "reactome.ans" 35 , "reactome.ans"
35 }; 36 };
36 if (percentage == 10) 37 if (percentage == 10)
@@ -38,15 +39,16 @@ public class JAIR_Scalability {
38 39
39 PagodaTester.main(args); 40 PagodaTester.main(args);
40 if (save) 41 if (save)
41 Utility.copyFile("log4j.log", "/home/yzhou/java-workspace/test-share/results_new/reactome/pagoda_" + percentage + "p" + date); 42 TestUtil.copyFile("log4j.log", "/home/yzhou/java-workspace/test-share/results_new/reactome/pagoda_" + percentage + "p" + date);
42 } 43 }
43 44
44 public void testChEMBL(int percentage, boolean save) throws IOException { 45 public void testChEMBL(int percentage, boolean save) throws IOException {
46 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
45 String[] args = new String[] { 47 String[] args = new String[] {
46 PagodaTester.onto_dir + "bio2rdf/chembl/cco-noDPR.ttl", 48 TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/cco-noDPR.ttl"),
47 PagodaTester.onto_dir + "bio2rdf/chembl/sample_" + percentage + ".nt", 49 TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/sample_" + percentage + ".nt"),
48// PagodaTester.onto_dir + "bio2rdf/chembl/queries/atomic_ground.sparql" 50// TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/queries/atomic_ground.sparql")
49 PagodaTester.onto_dir + "bio2rdf/chembl/queries/test.sparql" 51 TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/queries/test.sparql")
50 , "chembl.ans" 52 , "chembl.ans"
51 }; 53 };
52 if (percentage == 1 || percentage == 10 || percentage == 50) 54 if (percentage == 1 || percentage == 10 || percentage == 50)
@@ -57,15 +59,16 @@ public class JAIR_Scalability {
57 59
58 PagodaTester.main(args); 60 PagodaTester.main(args);
59 if (save) 61 if (save)
60 Utility.copyFile("log4j.log", "/home/yzhou/java-workspace/test-share/results_new/chembl/pagoda_" + percentage + "p" + date); 62 TestUtil.copyFile("log4j.log", "/home/yzhou/java-workspace/test-share/results_new/chembl/pagoda_" + percentage + "p" + date);
61 } 63 }
62 64
63 public void testUniProt(int percentage, boolean save) throws IOException { 65 public void testUniProt(int percentage, boolean save) throws IOException {
66 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
64 String[] args = new String[] { 67 String[] args = new String[] {
65 PagodaTester.onto_dir + "bio2rdf/uniprot/core-sat-processed.owl", 68 TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/core-sat-processed.owl"),
66 PagodaTester.onto_dir + "bio2rdf/uniprot/sample_" + percentage + ".nt", 69 TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/sample_" + percentage + ".nt"),
67// PagodaTester.onto_dir + "bio2rdf/uniprot/queries/atomic_ground.sparql" 70// TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/queries/atomic_ground.sparql")
68 PagodaTester.onto_dir + "bio2rdf/uniprot/queries/test.sparql" 71 TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/queries/test.sparql")
69 , "uniprot.ans" 72 , "uniprot.ans"
70 }; 73 };
71 74
@@ -77,7 +80,7 @@ public class JAIR_Scalability {
77 80
78 PagodaTester.main(args); 81 PagodaTester.main(args);
79 if (save) 82 if (save)
80 Utility.copyFile("log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uniprot/pagoda_" + percentage + "p" + date); 83 TestUtil.copyFile("log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uniprot/pagoda_" + percentage + "p" + date);
81 } 84 }
82 85
83 public static void main(String... args) throws IOException { 86 public static void main(String... args) throws IOException {
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/LightEvaluation.java b/test/uk/ac/ox/cs/pagoda/test_units/LightEvaluation.java
index 29006de..932c178 100644
--- a/test/uk/ac/ox/cs/pagoda/test_units/LightEvaluation.java
+++ b/test/uk/ac/ox/cs/pagoda/test_units/LightEvaluation.java
@@ -2,7 +2,7 @@ package uk.ac.ox.cs.pagoda.test_units;
2 2
3import org.junit.Test; 3import org.junit.Test;
4import uk.ac.ox.cs.pagoda.tester.PagodaTester; 4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
5import uk.ac.ox.cs.pagoda.util.Utility; 5import uk.ac.ox.cs.pagoda.util.TestUtil;
6 6
7import java.io.IOException; 7import java.io.IOException;
8 8
@@ -11,52 +11,57 @@ public class LightEvaluation {
11 @Test 11 @Test
12 public void uobm1() throws IOException { 12 public void uobm1() throws IOException {
13 int number = 1; 13 int number = 1;
14 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
14 PagodaTester.main( 15 PagodaTester.main(
15 PagodaTester.onto_dir + "uobm/univ-bench-dl.owl", 16 TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"),
16 PagodaTester.onto_dir + "uobm/data/uobm" + number + ".ttl", 17 TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"),
17 PagodaTester.onto_dir + "uobm/queries/standard.sparql" 18 TestUtil.combinePaths(ontoDir, "uobm/queries/standard.sparql")
18 ); 19 );
19 Utility.copyFile("log4j.log", "output/jair/uobm1.out"); 20 TestUtil.copyFile("log4j.log", "output/jair/uobm1.out");
20 } 21 }
21 22
22 @Test 23 @Test
23 public void lubm100() throws IOException { 24 public void lubm100() throws IOException {
24 int number = 100; 25 int number = 100;
26 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
25 PagodaTester.main( 27 PagodaTester.main(
26 PagodaTester.onto_dir + "lubm/univ-bench.owl", 28 TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"),
27 PagodaTester.onto_dir + "lubm/data/lubm" + number + ".ttl", 29 TestUtil.combinePaths(ontoDir, "lubm/data/lubm" + number + ".ttl"),
28 PagodaTester.onto_dir + "lubm/queries/test.sparql" 30 TestUtil.combinePaths(ontoDir, "lubm/queries/test.sparql")
29 ); 31 );
30 Utility.copyFile("log4j.log", "results-backup/current/lubm100.out"); 32 TestUtil.copyFile("log4j.log", "results-backup/current/lubm100.out");
31 } 33 }
32 34
33 @Test 35 @Test
34 public void fly() throws IOException { 36 public void fly() throws IOException {
37 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
35 PagodaTester.main( 38 PagodaTester.main(
36 PagodaTester.onto_dir + "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl", 39 TestUtil.combinePaths(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl"),
37 PagodaTester.onto_dir + "fly/queries/fly.sparql" 40 TestUtil.combinePaths(ontoDir, "fly/queries/fly.sparql")
38 ); 41 );
39 Utility.copyFile("log4j.log", "results-backup/current/fly.out"); 42 TestUtil.copyFile("log4j.log", "results-backup/current/fly.out");
40 } 43 }
41 44
42 @Test 45 @Test
43 public void dbpedia() throws IOException { 46 public void dbpedia() throws IOException {
47 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
44 PagodaTester.main( 48 PagodaTester.main(
45 PagodaTester.onto_dir + "dbpedia/integratedOntology-all-in-one-minus-datatype.owl", 49 TestUtil.combinePaths(ontoDir, "dbpedia/integratedOntology-all-in-one-minus-datatype.owl"),
46 PagodaTester.onto_dir + "dbpedia/data/dbpedia-minus-datatype-new.ttl", 50 TestUtil.combinePaths(ontoDir, "dbpedia/data/dbpedia-minus-datatype-new.ttl"),
47 PagodaTester.onto_dir + "dbpedia/atomic.sparql" 51 TestUtil.combinePaths(ontoDir, "dbpedia/atomic.sparql")
48 ); 52 );
49 Utility.copyFile("log4j.log", "results-backup/current/dbpedia.out"); 53 TestUtil.copyFile("log4j.log", "results-backup/current/dbpedia.out");
50 } 54 }
51 55
52 @Test 56 @Test
53 public void npdWithoutDataType() throws IOException { 57 public void npdWithoutDataType() throws IOException {
58 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
54 PagodaTester.main( 59 PagodaTester.main(
55 PagodaTester.onto_dir + "npd/npd-all-minus-datatype.owl", 60 TestUtil.combinePaths(ontoDir, "npd/npd-all-minus-datatype.owl"),
56 PagodaTester.onto_dir + "npd/data/npd-data-dump-minus-datatype-new.ttl", 61 TestUtil.combinePaths(ontoDir, "npd/data/npd-data-dump-minus-datatype-new.ttl"),
57 PagodaTester.onto_dir + "npd/queries/atomic.sparql" 62 TestUtil.combinePaths(ontoDir, "npd/queries/atomic.sparql")
58 ); 63 );
59 Utility.copyFile("log4j.log", "results-backup/current/npd_minus.out"); 64 TestUtil.copyFile("log4j.log", "results-backup/current/npd_minus.out");
60 } 65 }
61 66
62} 67}
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/PagodaDBPedia.java b/test/uk/ac/ox/cs/pagoda/test_units/PagodaDBPedia.java
index aaf542e..1673179 100644
--- a/test/uk/ac/ox/cs/pagoda/test_units/PagodaDBPedia.java
+++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaDBPedia.java
@@ -1,28 +1,28 @@
1package uk.ac.ox.cs.pagoda.test_units; 1package uk.ac.ox.cs.pagoda.test_units;
2 2
3import static org.junit.Assert.fail;
4
5import org.junit.Test; 3import org.junit.Test;
6
7import uk.ac.ox.cs.pagoda.tester.PagodaTester; 4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
8import uk.ac.ox.cs.pagoda.tester.Statistics; 5import uk.ac.ox.cs.pagoda.tester.Statistics;
9import uk.ac.ox.cs.pagoda.util.Utility; 6import uk.ac.ox.cs.pagoda.util.TestUtil;
10 7
11import java.io.IOException; 8import java.io.IOException;
12 9
10import static org.junit.Assert.fail;
11
13public class PagodaDBPedia { 12public class PagodaDBPedia {
14 13
15 @Test 14 @Test
16 public void test() throws IOException { 15 public void test() throws IOException {
16 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
17 PagodaTester.main( 17 PagodaTester.main(
18 PagodaTester.onto_dir + "dbpedia/integratedOntology-all-in-one-minus-datatype.owl", 18 TestUtil.combinePaths(ontoDir, "dbpedia/integratedOntology-all-in-one-minus-datatype.owl"),
19 PagodaTester.onto_dir + "dbpedia/data/dbpedia-minus-datatype-new.ttl", 19 TestUtil.combinePaths(ontoDir, "dbpedia/data/dbpedia-minus-datatype-new.ttl"),
20 PagodaTester.onto_dir + "dbpedia/atomic.sparql" 20 TestUtil.combinePaths(ontoDir, "dbpedia/atomic.sparql")
21 ); 21 );
22 22
23 Statistics stat = new Statistics("output/log4j.log"); 23 Statistics stat = new Statistics("output/log4j.log");
24 String diff = stat.diff("results-backup/benchmark/dbpedia.out"); 24 String diff = stat.diff("results-backup/benchmark/dbpedia.out");
25 Utility.copyFile("output/log4j.log", "results-backup/current/dbpedia.out"); 25 TestUtil.copyFile("output/log4j.log", "results-backup/current/dbpedia.out");
26 if (!diff.isEmpty()) 26 if (!diff.isEmpty())
27 fail(diff); 27 fail(diff);
28 } 28 }
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/PagodaELU.java b/test/uk/ac/ox/cs/pagoda/test_units/PagodaELU.java
index c2fa838..70d531d 100644
--- a/test/uk/ac/ox/cs/pagoda/test_units/PagodaELU.java
+++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaELU.java
@@ -2,15 +2,17 @@ package uk.ac.ox.cs.pagoda.test_units;
2 2
3import org.junit.Test; 3import org.junit.Test;
4import uk.ac.ox.cs.pagoda.tester.PagodaTester; 4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
5import uk.ac.ox.cs.pagoda.util.TestUtil;
5 6
6public class PagodaELU { 7public class PagodaELU {
7 8
8 @Test void test() { 9 @Test void test() {
9 int number = 1; 10 int number = 1;
11 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
10 PagodaTester.main( 12 PagodaTester.main(
11 PagodaTester.onto_dir + "uobm/univ-bench-dl.owl", 13 TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"),
12 PagodaTester.onto_dir + "uobm/data/uobm" + number + ".ttl", 14 TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"),
13 PagodaTester.onto_dir + "uobm/queries/standard.sparql" 15 TestUtil.combinePaths(ontoDir, "uobm/queries/standard.sparql")
14 ); 16 );
15 } 17 }
16 18
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/PagodaFLY.java b/test/uk/ac/ox/cs/pagoda/test_units/PagodaFLY.java
index 2fe07f0..bad533f 100644
--- a/test/uk/ac/ox/cs/pagoda/test_units/PagodaFLY.java
+++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaFLY.java
@@ -1,16 +1,17 @@
1package uk.ac.ox.cs.pagoda.test_units; 1package uk.ac.ox.cs.pagoda.test_units;
2 2
3import org.junit.Test; 3import org.junit.Test;
4
5import uk.ac.ox.cs.pagoda.tester.PagodaTester; 4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
5import uk.ac.ox.cs.pagoda.util.TestUtil;
6 6
7public class PagodaFLY { 7public class PagodaFLY {
8 8
9 @Test 9 @Test
10 public void test() { 10 public void test() {
11 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
11 PagodaTester.main( 12 PagodaTester.main(
12 PagodaTester.onto_dir + "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl", 13 TestUtil.combinePaths(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl"),
13 PagodaTester.onto_dir + "fly/queries/fly_pellet.sparql" 14 TestUtil.combinePaths(ontoDir, "fly/queries/fly_pellet.sparql")
14 ); 15 );
15 16
16// Statistics stat = new Statistics("output/log4j.log"); 17// Statistics stat = new Statistics("output/log4j.log");
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java b/test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java
index f40e41b..29abc87 100644
--- a/test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java
+++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java
@@ -1,68 +1,24 @@
1package uk.ac.ox.cs.pagoda.test_units; 1package uk.ac.ox.cs.pagoda.test_units;
2 2
3import org.testng.Assert;
4import org.testng.annotations.Test; 3import org.testng.annotations.Test;
5import uk.ac.ox.cs.pagoda.tester.PagodaTester; 4import uk.ac.ox.cs.pagoda.util.TestUtil;
6import uk.ac.ox.cs.pagoda.tester.Statistics;
7import uk.ac.ox.cs.pagoda.util.Utility;
8 5
9import java.io.FileInputStream;
10import java.io.IOException; 6import java.io.IOException;
11import java.util.Properties; 7import java.nio.file.Paths;
12 8
13public class PagodaLUBM { 9public class PagodaLUBM {
14 10
15 public static final String CONFIG_FILE = "config/test.properties"; 11 private void testN(int number ) throws IOException {
16 12 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
17 private static boolean isInit = false; 13 TestGlobalCorrectness.test(Paths.get(ontoDir, "lubm/univ-bench.owl"),
18 private static String ontoDir; 14 Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl"),
19 15 Paths.get(ontoDir, "lubm/queries/test.sparql"),
20 private static void init() { 16 Paths.get(ontoDir, "lubm/lubm" + number + ".ans"));
21 if(isInit) return;
22 isInit = true;
23
24 Properties config = new Properties();
25
26 try(FileInputStream in = new FileInputStream(CONFIG_FILE)) {
27 config.load(in);
28 in.close();
29 } catch (IOException e) {
30 e.printStackTrace();
31 }
32
33 ontoDir = config.getProperty("ontoDir");
34 }
35
36 private void test_all(int number) {
37 init();
38 PagodaTester.main(
39 Utility.combinePaths(ontoDir, "lubm/univ-bench.owl"),
40 Utility.combinePaths(ontoDir, "lubm/data/lubm" + number + ".ttl"),
41 Utility.combinePaths(ontoDir, "lubm/queries/test.sparql")
42 );
43
44// assertTrue(false);
45// AllTests.copy("log4j.log", "output/jair/lubm" + number + ".out");
46 } 17 }
47 18
48 @Test 19 @Test
49 public void test1() { 20 public void test1() throws IOException {
50 test_all(1); 21 testN(1);
51 }
52
53// @Test
54// public void test() {
55// int number = 100;
56// test_all(number);
57// }
58
59 private void check(int number) throws IOException {
60 Statistics stat = new Statistics("output/log4j.log");
61 // TODO insert proper file
62 String diff = stat.diff("results-backup/benchmark/lubm" + number + ".out");
63 Utility.copyFile("output/log4j.log", "results-backup/current/lubm" + number + ".out");
64 if (!diff.isEmpty())
65 Assert.fail(diff);
66 } 22 }
67 23
68} 24}
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD.java b/test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD.java
index 8fbe793..5f89162 100644
--- a/test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD.java
+++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD.java
@@ -1,43 +1,44 @@
1package uk.ac.ox.cs.pagoda.test_units; 1package uk.ac.ox.cs.pagoda.test_units;
2 2
3import static org.junit.Assert.fail;
4
5import org.junit.Test; 3import org.junit.Test;
6
7import uk.ac.ox.cs.pagoda.tester.PagodaTester; 4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
8import uk.ac.ox.cs.pagoda.tester.Statistics; 5import uk.ac.ox.cs.pagoda.tester.Statistics;
9import uk.ac.ox.cs.pagoda.util.Utility; 6import uk.ac.ox.cs.pagoda.util.TestUtil;
10 7
11import java.io.IOException; 8import java.io.IOException;
12 9
10import static org.junit.Assert.fail;
11
13public class PagodaNPD { 12public class PagodaNPD {
14 13
15 @Test 14 @Test
16 public void testNPDwithoutDataType() throws IOException { 15 public void testNPDwithoutDataType() throws IOException {
16 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
17 PagodaTester.main( 17 PagodaTester.main(
18 PagodaTester.onto_dir + "npd/npd-all-minus-datatype.owl", 18 TestUtil.combinePaths(ontoDir, "npd/npd-all-minus-datatype.owl"),
19 PagodaTester.onto_dir + "npd/data/npd-data-dump-minus-datatype-new.ttl", 19 TestUtil.combinePaths(ontoDir, "npd/data/npd-data-dump-minus-datatype-new.ttl"),
20 PagodaTester.onto_dir + "npd/queries/atomic.sparql" 20 TestUtil.combinePaths(ontoDir, "npd/queries/atomic.sparql")
21 ); 21 );
22 22
23 Statistics stat = new Statistics("output/log4j.log"); 23 Statistics stat = new Statistics("output/log4j.log");
24 String diff = stat.diff("results-backup/benchmark/npd_minus.out"); 24 String diff = stat.diff("results-backup/benchmark/npd_minus.out");
25 Utility.copyFile("output/log4j.log", "results-backup/current/npd_minus.out"); 25 TestUtil.copyFile("output/log4j.log", "results-backup/current/npd_minus.out");
26 if (!diff.isEmpty()) 26 if (!diff.isEmpty())
27 fail(diff); 27 fail(diff);
28 } 28 }
29 29
30 @Test 30 @Test
31 public void testNPD() throws IOException { 31 public void testNPD() throws IOException {
32 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
32 PagodaTester.main( 33 PagodaTester.main(
33 PagodaTester.onto_dir + "npd/npd-all.owl", 34 TestUtil.combinePaths(ontoDir, "npd/npd-all.owl"),
34 PagodaTester.onto_dir + "npd/data/npd-data-dump-processed.ttl", 35 TestUtil.combinePaths(ontoDir, "npd/data/npd-data-dump-processed.ttl"),
35 PagodaTester.onto_dir + "npd/queries/atomic.sparql" 36 TestUtil.combinePaths(ontoDir, "npd/queries/atomic.sparql")
36 ); 37 );
37 38
38 Statistics stat = new Statistics("output/log4j.log"); 39 Statistics stat = new Statistics("output/log4j.log");
39 String diff = stat.diff("results-backup/benchmark/npd.out"); 40 String diff = stat.diff("results-backup/benchmark/npd.out");
40 Utility.copyFile("output/log4j.log", "results-backup/current/npd.out"); 41 TestUtil.copyFile("output/log4j.log", "results-backup/current/npd.out");
41 if (!diff.isEmpty()) 42 if (!diff.isEmpty())
42 fail(diff); 43 fail(diff);
43 } 44 }
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD_bench.java b/test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD_bench.java
index 1243180..1aca36a 100644
--- a/test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD_bench.java
+++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD_bench.java
@@ -1,28 +1,28 @@
1package uk.ac.ox.cs.pagoda.test_units; 1package uk.ac.ox.cs.pagoda.test_units;
2 2
3import static org.junit.Assert.fail;
4
5import org.junit.Test; 3import org.junit.Test;
6
7import uk.ac.ox.cs.pagoda.tester.PagodaTester; 4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
8import uk.ac.ox.cs.pagoda.tester.Statistics; 5import uk.ac.ox.cs.pagoda.tester.Statistics;
9import uk.ac.ox.cs.pagoda.util.Utility; 6import uk.ac.ox.cs.pagoda.util.TestUtil;
10 7
11import java.io.IOException; 8import java.io.IOException;
12 9
10import static org.junit.Assert.fail;
11
13public class PagodaNPD_bench { 12public class PagodaNPD_bench {
14 13
15 @Test 14 @Test
16 public void test() throws IOException { 15 public void test() throws IOException {
16 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
17 PagodaTester.main( 17 PagodaTester.main(
18 PagodaTester.onto_dir + "npd-benchmark/npd-v2-ql_a.owl", 18 TestUtil.combinePaths(ontoDir, "npd-benchmark/npd-v2-ql_a.owl"),
19 PagodaTester.onto_dir + "npd-benchmark/npd-v2-ql_a.ttl", 19 TestUtil.combinePaths(ontoDir, "npd-benchmark/npd-v2-ql_a.ttl"),
20 PagodaTester.onto_dir + "npd-benchmark/queries/all.sparql" 20 TestUtil.combinePaths(ontoDir, "npd-benchmark/queries/all.sparql")
21 ); 21 );
22 22
23 Statistics stat = new Statistics("output/log4j.log"); 23 Statistics stat = new Statistics("output/log4j.log");
24 String diff = stat.diff("results-backup/benchmark/npd-bench.out"); 24 String diff = stat.diff("results-backup/benchmark/npd-bench.out");
25 Utility.copyFile("output/log4j.log", "results-backup/current/npd-bench.out"); 25 TestUtil.copyFile("output/log4j.log", "results-backup/current/npd-bench.out");
26 if (!diff.isEmpty()) 26 if (!diff.isEmpty())
27 fail(diff); 27 fail(diff);
28 } 28 }
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/PagodaRLU.java b/test/uk/ac/ox/cs/pagoda/test_units/PagodaRLU.java
index 8b31c99..c365196 100644
--- a/test/uk/ac/ox/cs/pagoda/test_units/PagodaRLU.java
+++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaRLU.java
@@ -2,17 +2,19 @@ package uk.ac.ox.cs.pagoda.test_units;
2 2
3import org.junit.Test; 3import org.junit.Test;
4import uk.ac.ox.cs.pagoda.tester.PagodaTester; 4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
5import uk.ac.ox.cs.pagoda.util.TestUtil;
5 6
6public class PagodaRLU { 7public class PagodaRLU {
7 8
8 @Test 9 @Test
9 public void testRL() { 10 public void testRL() {
10 int number = 1; 11 int number = 1;
12 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
11 PagodaTester.main( 13 PagodaTester.main(
12 PagodaTester.onto_dir + "uobm/univ-bench-dl.owl", 14 TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"),
13 PagodaTester.onto_dir + "uobm/data/uobm" + number + ".ttl", 15 TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"),
14 PagodaTester.onto_dir + "uobm/queries/standard.sparql" 16 TestUtil.combinePaths(ontoDir, "uobm/queries/standard.sparql")
15 ); 17 );
16 } 18 }
17 19
18} 20}
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java b/test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java
index 29a9056..f53ed7e 100644
--- a/test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java
+++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java
@@ -1,79 +1,24 @@
1package uk.ac.ox.cs.pagoda.test_units; 1package uk.ac.ox.cs.pagoda.test_units;
2 2
3import org.testng.annotations.Test; 3import org.testng.annotations.Test;
4import uk.ac.ox.cs.pagoda.tester.PagodaTester; 4import uk.ac.ox.cs.pagoda.util.TestUtil;
5import uk.ac.ox.cs.pagoda.tester.Statistics;
6import uk.ac.ox.cs.pagoda.util.Utility;
7 5
8import java.io.FileInputStream;
9import java.io.IOException; 6import java.io.IOException;
10import java.util.Properties; 7import java.nio.file.Paths;
11 8
12public class PagodaUOBM { 9public class PagodaUOBM {
13 10
14 public static final String CONFIG_FILE = "config/test.properties"; 11 private void testN(int number ) throws IOException {
15 12 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
16 private static boolean isInit = false; 13 TestGlobalCorrectness.test(Paths.get(ontoDir, "uobm/univ-bench-dl.owl"),
17 private static String ontoDir; 14 Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl"),
18 15 Paths.get(ontoDir, "uobm/queries/test.sparql"),
19 private static void init() { 16 Paths.get(ontoDir, "uobm/uobm" + number + ".ans"));
20 if(isInit) return;
21 isInit = true;
22
23 Properties config = new Properties();
24
25 try(FileInputStream in = new FileInputStream(CONFIG_FILE)) {
26 config.load(in);
27 in.close();
28 } catch (IOException e) {
29 e.printStackTrace();
30 }
31
32 ontoDir = config.getProperty("ontoDir");
33 }
34
35 private void test_all(int number ) {
36 init();
37
38 PagodaTester.main(
39 Utility.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"),
40 Utility.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"),
41 Utility.combinePaths(ontoDir, "uobm/queries/test.sparql")
42// + ";" +
43// Utility.combinePaths(ontoDir, "uobm/queries/standard_group3_all_less.sparql") + ";" +
44// Utility.combinePaths(ontoDir, "uobm/queries/G3.sparql") + ";" +
45// Utility.combinePaths(ontoDir, "uobm/queries/last.sparql")
46 );
47
48// AllTests.copy("log4j.log", "output/jair/newuobm/uobm" + number + ".out");
49 }
50
51 private void test_upToSum(int number) {
52 init();
53
54 PagodaTester.main(
55 PagodaTester.onto_dir + "uobm/univ-bench-dl.owl",
56 PagodaTester.onto_dir + "uobm/data/uobm" + number + ".ttl",
57 PagodaTester.onto_dir + "uobm/queries/standard_group3_all.sparql"
58 );
59
60// AllTests.copy("log4j.log", "output/jair/uobm" + number + ".out");
61 } 17 }
62 18
63 @Test 19 @Test
64 public void test1() { test_all(1); } 20 public void test1() throws IOException {
65 21 testN(1);
66// @Test
67 public void test500() { test_upToSum(500); }
68
69// public static void main(String... args) {
70// new PagodaUOBM().test_all(1);
71// }
72
73 private void check() {
74 Statistics stat = new Statistics("results-backup/current/uobm1.out");
75 String diff = stat.diff("results-backup/benchmark/uobm1.out");
76 System.out.println(diff);
77 } 22 }
78 23
79} 24}
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/TestGlobalCorrectness.java b/test/uk/ac/ox/cs/pagoda/test_units/TestGlobalCorrectness.java
new file mode 100644
index 0000000..34ec8cd
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/test_units/TestGlobalCorrectness.java
@@ -0,0 +1,55 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import com.google.gson.Gson;
4import com.google.gson.GsonBuilder;
5import com.google.gson.reflect.TypeToken;
6import org.apache.log4j.Logger;
7import org.testng.Assert;
8import uk.ac.ox.cs.pagoda.query.AnswerTuple;
9import uk.ac.ox.cs.pagoda.query.QueryRecord;
10import uk.ac.ox.cs.pagoda.tester.PagodaTester;
11
12import java.io.BufferedReader;
13import java.io.File;
14import java.io.IOException;
15import java.lang.reflect.Type;
16import java.nio.file.Files;
17import java.nio.file.Path;
18import java.nio.file.Paths;
19import java.util.Collection;
20import java.util.Set;
21
22/*
23 * This is a unit test for TestNG.
24 * <p>
25 * It tests the correctness on the final output.
26 * */
27public class TestGlobalCorrectness {
28
29 public static final Logger logger = Logger.getLogger(TestGlobalCorrectness.class);
30
31 public static void test(Path ontology, Path data, Path queries, Path givenAnswers) {
32 try {
33 Path computedAnswers = Paths.get(File.createTempFile("answers", ".tmp").getAbsolutePath());
34 PagodaTester.main(ontology.toString(), data.toString(), queries.toString(), computedAnswers.toString());
35 Assert.assertTrue(checkSameContent(computedAnswers, givenAnswers));
36 } catch (IOException e) {
37 e.printStackTrace();
38 }
39 }
40
41 private static boolean checkSameContent(Path computedAnswersFile, Path givenAnswersFile) throws IOException {
42 BufferedReader computedReader = Files.newBufferedReader(computedAnswersFile);
43 BufferedReader givenReader = Files.newBufferedReader(givenAnswersFile);
44
45 Gson gson = new GsonBuilder().create();
46
47 Type cqType = new TypeToken<Set<AnswerTuple>>() {}.getType();
48 Collection<QueryRecord> computedAnswers = gson.fromJson(computedReader, cqType);
49 Collection<QueryRecord> givenAnswers = gson.fromJson(givenReader, cqType);
50
51 return computedAnswers.equals(givenAnswers);
52 }
53
54
55}
diff --git a/test/uk/ac/ox/cs/pagoda/tester/PagodaTester.java b/test/uk/ac/ox/cs/pagoda/tester/PagodaTester.java
index 51b41f9..7dacdac 100644
--- a/test/uk/ac/ox/cs/pagoda/tester/PagodaTester.java
+++ b/test/uk/ac/ox/cs/pagoda/tester/PagodaTester.java
@@ -1,17 +1,17 @@
1package uk.ac.ox.cs.pagoda.tester; 1package uk.ac.ox.cs.pagoda.tester;
2 2
3import java.io.File;
4import java.io.FileNotFoundException;
5import java.io.IOException;
6import java.util.Scanner;
7
8import uk.ac.ox.cs.pagoda.query.AnswerTuple; 3import uk.ac.ox.cs.pagoda.query.AnswerTuple;
9import uk.ac.ox.cs.pagoda.query.AnswerTuples; 4import uk.ac.ox.cs.pagoda.query.AnswerTuples;
10import uk.ac.ox.cs.pagoda.reasoner.*; 5import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner;
11import uk.ac.ox.cs.pagoda.util.Properties; 6import uk.ac.ox.cs.pagoda.util.Properties;
12import uk.ac.ox.cs.pagoda.util.Timer; 7import uk.ac.ox.cs.pagoda.util.Timer;
13import uk.ac.ox.cs.pagoda.util.Utility; 8import uk.ac.ox.cs.pagoda.util.Utility;
14 9
10import java.io.File;
11import java.io.FileNotFoundException;
12import java.io.IOException;
13import java.util.Scanner;
14
15public class PagodaTester { 15public class PagodaTester {
16 16
17// public static final String onto_dir = "/media/RDFData/yzhou/"; 17// public static final String onto_dir = "/media/RDFData/yzhou/";
@@ -93,7 +93,7 @@ public class PagodaTester {
93 public static void main(String... args) { 93 public static void main(String... args) {
94 if (args.length == 0) { 94 if (args.length == 0) {
95// args = new String[] {test_tbox, test_abox, test_query}; 95// args = new String[] {test_tbox, test_abox, test_query};
96 args = new String[] {lubm_tbox, lubm_abox, lubm_query}; 96 args = new String[] {lubm_tbox, lubm_abox, lubm_query, "/home/alessandro/Desktop/lubm1.ans"};
97// args = new String[] {uobm_tbox, uobm_abox, uobm_query.replace(".sparql", "_all_pagoda.sparql")}; 97// args = new String[] {uobm_tbox, uobm_abox, uobm_query.replace(".sparql", "_all_pagoda.sparql")};
98// args = new String[] {fly, "null", fly_query.replace(".sparql", "_pellet.sparql") }; 98// args = new String[] {fly, "null", fly_query.replace(".sparql", "_pellet.sparql") };
99// args = new String[] {dbpedia_tbox, dbpedia_abox, dbpedia_query}; 99// args = new String[] {dbpedia_tbox, dbpedia_abox, dbpedia_query};
@@ -145,7 +145,7 @@ public class PagodaTester {
145 145
146 if (properties.getQueryPath() != null) 146 if (properties.getQueryPath() != null)
147 for (String queryFile: properties.getQueryPath().split(";")) 147 for (String queryFile: properties.getQueryPath().split(";"))
148 pagoda.evaluate(pagoda.getQueryManager().collectQueryRecords(queryFile), properties.getAnswerPath()); 148 pagoda.evaluate(pagoda.getQueryManager().collectQueryRecords(queryFile));
149 149
150 if (properties.getShellMode()) 150 if (properties.getShellMode())
151 try { 151 try {
diff --git a/test/uk/ac/ox/cs/pagoda/util/TestUtil.java b/test/uk/ac/ox/cs/pagoda/util/TestUtil.java
new file mode 100644
index 0000000..227398b
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/util/TestUtil.java
@@ -0,0 +1,64 @@
1package uk.ac.ox.cs.pagoda.util;
2
3import org.apache.log4j.Appender;
4import org.apache.log4j.FileAppender;
5import org.apache.log4j.Logger;
6
7import java.io.File;
8import java.io.FileInputStream;
9import java.io.IOException;
10import java.nio.file.Files;
11import java.nio.file.Paths;
12import java.util.Enumeration;
13import java.util.Properties;
14
15import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
16
17/**
18 * A collection of utility methods for testing.
19 */
20public class TestUtil {
21
22 public static final String CONFIG_FILE = "config/test.properties";
23
24 private static boolean isConfigLoaded = false;
25 private static Properties config;
26
27 public static Properties getConfig() {
28 if(!isConfigLoaded) {
29 try (FileInputStream in = new FileInputStream(CONFIG_FILE)) {
30 config = new java.util.Properties();
31 config.load(in);
32 in.close();
33 isConfigLoaded = true;
34 } catch (IOException e) {
35 e.printStackTrace();
36 }
37 }
38 return config;
39 }
40
41 public static String combinePaths(String path1, String path2) {
42 File file1 = new File(path1);
43 File file2 = new File(file1, path2);
44 return file2.getPath();
45 }
46
47 public static void copyFile(String src, String dst) throws IOException {
48 Files.copy(Paths.get(src), Paths.get(dst), REPLACE_EXISTING);
49 }
50
51 /*
52 * Get the log file, which is assumed unique.
53 * */
54 public static String getLogFileName() {
55 Enumeration e = Logger.getRootLogger().getAllAppenders();
56 while (e.hasMoreElements()){
57 Appender app = (Appender)e.nextElement();
58 if (app instanceof FileAppender){
59 return ((FileAppender)app).getFile();
60 }
61 }
62 return null;
63 }
64}