aboutsummaryrefslogtreecommitdiff
path: root/test/uk/ac/ox/cs/pagoda/test_units
diff options
context:
space:
mode:
authorRncLsn <rnc.lsn@gmail.com>2015-05-15 17:32:22 +0100
committerRncLsn <rnc.lsn@gmail.com>2015-05-15 17:32:22 +0100
commit1b6a128137e5d7a6ff75566869232fc054afabef (patch)
tree3def49c3c9c1e2ebebc49b82d9eb562b6d097cad /test/uk/ac/ox/cs/pagoda/test_units
parentbd995407098d1b0c79c17a28b0b23a2c24a493c6 (diff)
downloadACQuA-1b6a128137e5d7a6ff75566869232fc054afabef.tar.gz
ACQuA-1b6a128137e5d7a6ff75566869232fc054afabef.zip
Testing and fixing. Executed successfully on UOBM{1,2,3,4,5,6,7,8}.
Diffstat (limited to 'test/uk/ac/ox/cs/pagoda/test_units')
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/ClauseTester.java164
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/CostEvaluation.java115
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/JAIR_PAGOdA.java193
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/JAIR_Scalability.java91
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/LightEvaluation.java67
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaDBPedia.java30
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaELU.java20
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaFLY.java25
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java24
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD.java46
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD_bench.java30
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaRLU.java20
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java24
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/TestGlobalCorrectness.java52
14 files changed, 0 insertions, 901 deletions
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/ClauseTester.java b/test/uk/ac/ox/cs/pagoda/test_units/ClauseTester.java
deleted file mode 100644
index a0f16d4..0000000
--- a/test/uk/ac/ox/cs/pagoda/test_units/ClauseTester.java
+++ /dev/null
@@ -1,164 +0,0 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import org.semanticweb.HermiT.model.Atom;
4import org.semanticweb.HermiT.model.AtomicConcept;
5import org.semanticweb.HermiT.model.AtomicRole;
6import org.semanticweb.HermiT.model.DLClause;
7import org.semanticweb.HermiT.model.Equality;
8import org.semanticweb.HermiT.model.Variable;
9import org.semanticweb.owlapi.apibinding.OWLManager;
10import org.semanticweb.owlapi.model.OWLOntology;
11import org.semanticweb.owlapi.model.OWLOntologyManager;
12
13import org.testng.Assert;
14import org.testng.annotations.Test;
15import uk.ac.ox.cs.pagoda.approx.Clause;
16import uk.ac.ox.cs.pagoda.approx.Clausifier;
17
18public class ClauseTester {
19
20 @Test
21 public void test_simple() {
22 Variable x = Variable.create("X"), y1 = Variable.create("y1"), y2 = Variable.create("y2");
23 AtomicConcept A = AtomicConcept.create("A");
24 AtomicRole r = AtomicRole.create("r");
25 Atom[] bodyAtoms = new Atom[] {
26 Atom.create(A, x),
27 Atom.create(r, x, y1),
28 Atom.create(r, x, y2)
29 };
30
31 Atom[] headAtoms = new Atom[] {
32 Atom.create(Equality.INSTANCE, y1, y2)
33 };
34
35 OWLOntologyManager m = OWLManager.createOWLOntologyManager();
36 OWLOntology emptyOntology = null;
37 try {
38 emptyOntology = m.createOntology();
39 } catch (Exception e) {
40 e.printStackTrace();
41 Assert.fail("failed to create a new ontology");
42 }
43 Clause c = new Clause(Clausifier.getInstance(emptyOntology), DLClause.create(headAtoms, bodyAtoms));
44 System.out.println(c.toString());
45 }
46
47 @Test
48 public void test_more() {
49 Variable x = Variable.create("X"), y1 = Variable.create("y1"), y2 = Variable.create("y2"), y3 = Variable.create("y3");
50 AtomicConcept A = AtomicConcept.create("A");
51 AtomicRole r = AtomicRole.create("r");
52 Atom[] bodyAtoms = new Atom[] {
53 Atom.create(A, x),
54 Atom.create(r, x, y1),
55 Atom.create(r, x, y2),
56 Atom.create(r, x, y3),
57 };
58
59 Atom[] headAtoms = new Atom[] {
60 Atom.create(Equality.INSTANCE, y1, y2),
61 Atom.create(Equality.INSTANCE, y1, y3),
62 Atom.create(Equality.INSTANCE, y2, y3)
63 };
64
65 OWLOntologyManager m = OWLManager.createOWLOntologyManager();
66 OWLOntology emptyOntology = null;
67 try {
68 emptyOntology = m.createOntology();
69 } catch (Exception e) {
70 e.printStackTrace();
71 Assert.fail("failed to create a new ontology");
72 }
73 Clause c = new Clause(Clausifier.getInstance(emptyOntology), DLClause.create(headAtoms, bodyAtoms));
74 System.out.println(c.toString());
75 }
76
77 @Test
78 public void test_inverse() {
79 Variable x = Variable.create("X"), y1 = Variable.create("y1"), y2 = Variable.create("y2");
80 AtomicConcept A = AtomicConcept.create("A");
81 AtomicRole r = AtomicRole.create("r");
82 Atom[] bodyAtoms = new Atom[] {
83 Atom.create(A, x),
84 Atom.create(r, y1, x),
85 Atom.create(r, y2, x)
86 };
87
88 Atom[] headAtoms = new Atom[] {
89 Atom.create(Equality.INSTANCE, y1, y2)
90 };
91
92 OWLOntologyManager m = OWLManager.createOWLOntologyManager();
93 OWLOntology emptyOntology = null;
94 try {
95 emptyOntology = m.createOntology();
96 } catch (Exception e) {
97 e.printStackTrace();
98 Assert.fail("failed to create a new ontology");
99 }
100 Clause c = new Clause(Clausifier.getInstance(emptyOntology), DLClause.create(headAtoms, bodyAtoms));
101 System.out.println(c.toString());
102 }
103
104 @Test
105 public void test_fillter() {
106 Variable x = Variable.create("X"), y1 = Variable.create("y1"), y2 = Variable.create("y2");
107 AtomicConcept A = AtomicConcept.create("A");
108 AtomicConcept B = AtomicConcept.create("B");
109 AtomicRole r = AtomicRole.create("r");
110 Atom[] bodyAtoms = new Atom[] {
111 Atom.create(A, x),
112 Atom.create(r, y1, x),
113 Atom.create(r, y2, x),
114 Atom.create(B, y1),
115 Atom.create(B, y2)
116 };
117
118 Atom[] headAtoms = new Atom[] {
119 Atom.create(Equality.INSTANCE, y1, y2)
120 };
121
122 OWLOntologyManager m = OWLManager.createOWLOntologyManager();
123 OWLOntology emptyOntology = null;
124 try {
125 emptyOntology = m.createOntology();
126 } catch (Exception e) {
127 e.printStackTrace();
128 Assert.fail("failed to create a new ontology");
129 }
130 Clause c = new Clause(Clausifier.getInstance(emptyOntology), DLClause.create(headAtoms, bodyAtoms));
131 System.out.println(c.toString());
132 }
133
134 @Test
135 public void test_negFillter() {
136 Variable x = Variable.create("X"), y1 = Variable.create("y1"), y2 = Variable.create("y2");
137 AtomicConcept A = AtomicConcept.create("A");
138 AtomicConcept B = AtomicConcept.create("B");
139 AtomicRole r = AtomicRole.create("r");
140 Atom[] bodyAtoms = new Atom[] {
141 Atom.create(A, x),
142 Atom.create(r, y1, x),
143 Atom.create(r, y2, x)
144 };
145
146 Atom[] headAtoms = new Atom[] {
147 Atom.create(Equality.INSTANCE, y1, y2),
148 Atom.create(B, y1),
149 Atom.create(B, y2)
150 };
151
152 OWLOntologyManager m = OWLManager.createOWLOntologyManager();
153 OWLOntology emptyOntology = null;
154 try {
155 emptyOntology = m.createOntology();
156 } catch (Exception e) {
157 e.printStackTrace();
158 Assert.fail("failed to create a new ontology");
159 }
160 Clause c = new Clause(Clausifier.getInstance(emptyOntology), DLClause.create(headAtoms, bodyAtoms));
161 System.out.println(c.toString());
162 }
163
164}
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/CostEvaluation.java b/test/uk/ac/ox/cs/pagoda/test_units/CostEvaluation.java
deleted file mode 100644
index 968cf01..0000000
--- a/test/uk/ac/ox/cs/pagoda/test_units/CostEvaluation.java
+++ /dev/null
@@ -1,115 +0,0 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import org.semanticweb.owlapi.model.OWLOntology;
4import org.testng.annotations.Test;
5import uk.ac.ox.cs.pagoda.owl.OWLHelper;
6import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner;
7import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner.Type;
8import uk.ac.ox.cs.pagoda.tester.PagodaTester;
9import uk.ac.ox.cs.pagoda.util.TestUtil;
10import uk.ac.ox.cs.pagoda.util.Timer;
11import uk.ac.ox.cs.pagoda.util.Utility;
12
13public class CostEvaluation {
14
15 @Test
16 public void lubm100() {
17 int number = 1;
18 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
19 PagodaTester.main(
20 TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"),
21 TestUtil.combinePaths(ontoDir, "lubm/data/lubm" + number + ".ttl"),
22 TestUtil.combinePaths(ontoDir, "lubm/queries/test_all_pagoda.sparql")
23 );
24// AllTests.copy("output/log4j.log", "results-backup/jair/lubm" + number + ".out");
25 }
26
27 public void lubm1000() {
28 int number = 1000;
29 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
30 String[] args = new String[] {
31 TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"),
32 TestUtil.combinePaths(ontoDir, "lubm/data/lubm" + number + ".ttl"),
33 TestUtil.combinePaths(ontoDir, "lubm/queries/test_all_pagoda.sparql")
34 };
35 OWLOntology ontology = OWLHelper.loadOntology(args[0]);
36 QueryReasoner reasoner = QueryReasoner.getInstance(Type.ELHOU, ontology, true, true);
37 Timer t = new Timer();
38 reasoner.loadOntology(ontology);
39 reasoner.importData(args[1]);
40 if (!reasoner.preprocess())
41 return ;
42 Utility.logInfo("Preprocessing Done in " + t.duration() + " seconds.");
43
44 reasoner.evaluate(reasoner.getQueryManager().collectQueryRecords(args[2]));
45// AllTests.copy("output/log4j.log", "results-backup/jair/lubm" + number + ".out");
46 }
47
48 @Test
49 public void uobm5() {
50 int number = 1;
51 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
52 String[] args = new String[] {
53 TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"),
54 TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"),
55 TestUtil.combinePaths(ontoDir, "uobm/queries/standard_all_pagoda.sparql")
56 };
57 PagodaTester.main(args);
58// AllTests.copy("output/log4j.log", "results-backup/jair/uobm" + number + ".out");
59 }
60
61 public void uobm100() {
62 int number = 200;
63 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
64 String[] args = new String[] {
65 TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"),
66 TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"),
67 TestUtil.combinePaths(ontoDir, "uobm/queries/standard_group3_all.sparql")
68 };
69 PagodaTester.main(args);
70// AllTests.copy("output/log4j.log", "results-backup/jair/uobm" + number + ".out");
71 }
72
73 public void uobm500() {
74 int number = 500;
75 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
76 String[] args = new String[] {
77 TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"),
78 TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"),
79 TestUtil.combinePaths(ontoDir, "uobm/queries/standard_all_pagoda.sparql")
80 };
81
82 OWLOntology ontology = OWLHelper.loadOntology(args[0]);
83 QueryReasoner reasoner = QueryReasoner.getInstance(Type.ELHOU, ontology, true, true);
84 Timer t = new Timer();
85 reasoner.loadOntology(ontology);
86 reasoner.importData(args[1]);
87 if (!reasoner.preprocess())
88 return ;
89 Utility.logInfo("Preprocessing Done in " + t.duration() + " seconds.");
90
91 reasoner.evaluate(reasoner.getQueryManager().collectQueryRecords(args[2]));
92// AllTests.copy("output/log4j.log", "results-backup/jair/uobm" + number + ".out");
93 }
94
95
96 public static void main(String... args) {
97 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
98 args = new String[] {
99 TestUtil.combinePaths(ontoDir, "dbpedia/integratedOntology-all-in-one-minus-datatype.owl"),
100 TestUtil.combinePaths(ontoDir, "dbpedia/data/dbpedia-minus-datatype-new.ttl"),
101 TestUtil.combinePaths(ontoDir, "dbpedia/queries/atomic_ground.sparql")
102 };
103
104 OWLOntology ontology = OWLHelper.loadOntology(args[0]);
105 QueryReasoner reasoner = QueryReasoner.getInstance(Type.ELHOU, ontology, true, true);
106 Timer t = new Timer();
107 reasoner.loadOntology(ontology);
108 reasoner.importData(args[1]);
109 if (!reasoner.preprocess())
110 return ;
111 Utility.logInfo("Preprocessing Done in " + t.duration() + " seconds.");
112
113 reasoner.evaluate(reasoner.getQueryManager().collectQueryRecords(args[2]));
114 }
115}
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
deleted file mode 100644
index 10ac974..0000000
--- a/test/uk/ac/ox/cs/pagoda/test_units/JAIR_PAGOdA.java
+++ /dev/null
@@ -1,193 +0,0 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import org.testng.annotations.Test;
4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
5import uk.ac.ox.cs.pagoda.util.TestUtil;
6
7import java.io.IOException;
8
9public class JAIR_PAGOdA {
10
11 @Test
12 public void lubm1() throws IOException {
13 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
14 String[] args = new String[] {
15 TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"),
16 TestUtil.combinePaths(ontoDir, "lubm/data/lubm1.ttl"),
17 TestUtil.combinePaths(ontoDir, "lubm/queries/test.sparql")
18 };
19 PagodaTester.main(args);
20 TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/lubm1/pagoda");
21 }
22
23 @Test
24 public void lubm1_conj() throws IOException {
25 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
26 String[] args = new String[] {
27 TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"),
28 TestUtil.combinePaths(ontoDir, "lubm/data/lubm1.ttl"),
29 TestUtil.combinePaths(ontoDir, "lubm/queries/test_pellet.sparql")
30 };
31 PagodaTester.main(args);
32 TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/lubm1/pagoda_conj");
33 }
34
35 @Test
36 public void lubm1_rolledUp() throws IOException {
37 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
38 PagodaTester.main(
39 "/home/yzhou/backup/20141212/univ-bench-queries.owl",
40 TestUtil.combinePaths(ontoDir, "lubm/data/lubm1.ttl"),
41 TestUtil.combinePaths(ontoDir, "lubm/queries/atomic_lubm.sparql")
42 );
43 TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/lubm1/pagoda_rolledUp");
44 }
45
46 @Test
47 public void uobm1() throws IOException {
48 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
49 String[] args = new String[] {
50 TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"),
51 TestUtil.combinePaths(ontoDir, "uobm/data/uobm1.ttl"),
52 TestUtil.combinePaths(ontoDir, "uobm/queries/standard.sparql")
53 };
54 PagodaTester.main(args);
55 TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uobm1/pagoda");
56 }
57
58 @Test
59 public void uobm1_conj() throws IOException {
60 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
61 String[] args = new String[] {
62 TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"),
63 TestUtil.combinePaths(ontoDir, "uobm/data/uobm1.ttl"),
64 TestUtil.combinePaths(ontoDir, "uobm/queries/standard_pellet.sparql")
65 };
66 PagodaTester.main(args);
67 TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uobm1/pagoda_conj");
68 }
69
70 @Test
71 public void uobm1_rolledUp() {
72 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
73 String[] args = new String[] {
74 "/home/yzhou/backup/20141212/univ-bench-dl-queries.owl",
75 TestUtil.combinePaths(ontoDir, "uobm/data/uobm1.ttl"),
76 TestUtil.combinePaths(ontoDir, "uobm/queries/atomic_uobm.sparql")
77 };
78 PagodaTester.main(args);
79// TestUtil.copyFile(("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uobm1/pagoda_rolledUp");
80 }
81
82 @Test
83 public void fly() {
84 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
85 String[] args = new String[] {
86 TestUtil.combinePaths(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl"),
87 null,
88 TestUtil.combinePaths(ontoDir, "fly/queries/fly_pellet.sparql")
89 };
90 PagodaTester.main(args);
91// TestUtil.copyFile(("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/fly/pagoda");
92 }
93
94 @Test
95 public void fly_conj() throws IOException {
96 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
97 String[] args = new String[] {
98 TestUtil.combinePaths(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl"),
99 null,
100 TestUtil.combinePaths(ontoDir, "fly/queries/fly_pellet.sparql")
101 };
102 PagodaTester.main(args);
103 TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/fly/pagoda_conj");
104 }
105
106
107 public void fly_rolledUp() {
108 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
109 PagodaTester.main(
110// TestUtil.combinePaths(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl",
111 TestUtil.combinePaths(ontoDir, "fly/fly-all-in-one_rolledUp.owl"),
112 null,
113 TestUtil.combinePaths(ontoDir, "fly/queries/fly_atomic.sparql")
114 );
115// TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/fly/pagoda_rolledUp");
116 }
117
118 public void dbpedia() {
119 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
120 PagodaTester.main(
121 TestUtil.combinePaths(ontoDir, "dbpedia/integratedOntology-all-in-one-minus-datatype.owl"),
122 TestUtil.combinePaths(ontoDir, "dbpedia/data/dbpedia-minus-datatype-new.ttl"),
123 TestUtil.combinePaths(ontoDir, "dbpedia/queries/atomic_ground.sparql"),
124 "dbpedia.ans"
125 );
126
127// TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/dbpedia/pagoda");
128 }
129
130 public void npd() {
131 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
132 PagodaTester.main(
133 TestUtil.combinePaths(ontoDir, "npd/npd-all-minus-datatype.owl"),
134 TestUtil.combinePaths(ontoDir, "npd/data/npd-data-dump-minus-datatype-new.ttl"),
135 TestUtil.combinePaths(ontoDir, "npd/queries/atomic_ground.sparql")
136 , "npd.ans"
137 );
138
139// TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/npd/pagoda");
140 }
141
142 public void reactome() throws IOException {
143 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
144 PagodaTester.main(
145 TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/biopax-level3-processed.owl"),
146 TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/graph sampling/reactome_sample_10.ttl"),
147// null,
148// TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/queries/atomic_ground.sparql")
149 TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/queries/example.sparql")
150 , "pagoda_reactome.ans"
151 );
152 TestUtil.copyFile("log4j.log", "output/jair/pagoda_reactome.example");
153
154// TestUtil.copyFile(("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/reactome/pagoda_10p");
155 }
156
157 public void chembl() throws IOException {
158 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
159 PagodaTester.main(
160 TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/cco-noDPR.ttl"),
161 TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/graph sampling/sample_1.nt"),
162// TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/queries/atomic_ground.sparql")
163 TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/queries/example.sparql")
164 , "pagoda_chembl.ans"
165 );
166 TestUtil.copyFile("log4j.log", "output/jair/pagoda_chembl.example");
167// TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/chembl/pagoda_1p");
168 }
169
170 public void uniprot() throws IOException {
171 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
172 PagodaTester.main(
173 TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/core-sat-processed.owl"),
174 TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/graph sampling/sample_1.nt"),
175// null,
176// TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/queries/atomic_ground.sparql")
177 TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/queries/example.sparql")
178 , "pagoda_uniprot.ans"
179 );
180 TestUtil.copyFile("log4j.log", "output/jair/pagoda_uniprot.example");
181// TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uniprot/pagoda_1p");
182 }
183
184
185 public static void main(String... args) {
186 try {
187 new JAIR_PAGOdA().lubm1();
188 } catch (IOException e) {
189 e.printStackTrace();
190 }
191 }
192
193}
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
deleted file mode 100644
index 2cf8446..0000000
--- a/test/uk/ac/ox/cs/pagoda/test_units/JAIR_Scalability.java
+++ /dev/null
@@ -1,91 +0,0 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import org.testng.annotations.Test;
4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
5import uk.ac.ox.cs.pagoda.util.Properties;
6import uk.ac.ox.cs.pagoda.util.TestUtil;
7
8import java.io.IOException;
9
10public class JAIR_Scalability {
11
12 private static final String date = "_0123";
13
14 @Test
15 public void reactome() throws IOException {
16 testReactome(10, false);
17 }
18
19 @Test
20 public void chembl() throws IOException {
21 testChEMBL(1, false);
22 }
23
24 @Test
25 public void uniprot() throws IOException {
26 testUniProt(1, false);
27 }
28
29 public void testReactome(int percentage, boolean save) throws IOException {
30 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
31 String[] args = new String[] {
32 TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/biopax-level3-processed.owl"),
33 TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/graph sampling/simplifed_sample_" + percentage + ".ttl"),
34 TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/queries/test.sparql")
35 , "reactome.ans"
36 };
37 if (percentage == 10)
38 args[1] = args[1].replace("simplifed", "reactome");
39
40 PagodaTester.main(args);
41 if (save)
42 TestUtil.copyFile("log4j.log", "/home/yzhou/java-workspace/test-share/results_new/reactome/pagoda_" + percentage + "p" + date);
43 }
44
45 public void testChEMBL(int percentage, boolean save) throws IOException {
46 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
47 String[] args = new String[] {
48 TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/cco-noDPR.ttl"),
49 TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/sample_" + percentage + ".nt"),
50// TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/queries/atomic_ground.sparql")
51 TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/queries/test.sparql")
52 , "chembl.ans"
53 };
54 if (percentage == 1 || percentage == 10 || percentage == 50)
55 args[1] = args[1].replace("chembl", "chembl/graph sampling");
56 else
57 if (percentage == 100)
58 args[1] = "/home/yzhou/RDFData/ChEMBL/facts/ChEMBL.ttl";
59
60 PagodaTester.main(args);
61 if (save)
62 TestUtil.copyFile("log4j.log", "/home/yzhou/java-workspace/test-share/results_new/chembl/pagoda_" + percentage + "p" + date);
63 }
64
65 public void testUniProt(int percentage, boolean save) throws IOException {
66 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
67 String[] args = new String[] {
68 TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/core-sat-processed.owl"),
69 TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/sample_" + percentage + ".nt"),
70// TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/queries/atomic_ground.sparql")
71 TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/queries/test.sparql")
72 , "uniprot.ans"
73 };
74
75 if (percentage == 1 || percentage == 10 || percentage == 50)
76 args[1] = args[1].replace("uniprot", "uniprot/graph sampling");
77 else
78 if (percentage == 100)
79 args[1] = "/home/yzhou/krr-nas-share/Yujiao/ontologies/bio2rdf/uniprot/data/uniprot_cleaned.nt";
80
81 PagodaTester.main(args);
82 if (save)
83 TestUtil.copyFile("log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uniprot/pagoda_" + percentage + "p" + date);
84 }
85
86 public static void main(String... args) throws IOException {
87 Properties.ShellModeDefault = true;
88 new JAIR_Scalability().testUniProt(50, false);
89 }
90
91}
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/LightEvaluation.java b/test/uk/ac/ox/cs/pagoda/test_units/LightEvaluation.java
deleted file mode 100644
index 932c178..0000000
--- a/test/uk/ac/ox/cs/pagoda/test_units/LightEvaluation.java
+++ /dev/null
@@ -1,67 +0,0 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import org.junit.Test;
4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
5import uk.ac.ox.cs.pagoda.util.TestUtil;
6
7import java.io.IOException;
8
9public class LightEvaluation {
10
11 @Test
12 public void uobm1() throws IOException {
13 int number = 1;
14 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
15 PagodaTester.main(
16 TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"),
17 TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"),
18 TestUtil.combinePaths(ontoDir, "uobm/queries/standard.sparql")
19 );
20 TestUtil.copyFile("log4j.log", "output/jair/uobm1.out");
21 }
22
23 @Test
24 public void lubm100() throws IOException {
25 int number = 100;
26 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
27 PagodaTester.main(
28 TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"),
29 TestUtil.combinePaths(ontoDir, "lubm/data/lubm" + number + ".ttl"),
30 TestUtil.combinePaths(ontoDir, "lubm/queries/test.sparql")
31 );
32 TestUtil.copyFile("log4j.log", "results-backup/current/lubm100.out");
33 }
34
35 @Test
36 public void fly() throws IOException {
37 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
38 PagodaTester.main(
39 TestUtil.combinePaths(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl"),
40 TestUtil.combinePaths(ontoDir, "fly/queries/fly.sparql")
41 );
42 TestUtil.copyFile("log4j.log", "results-backup/current/fly.out");
43 }
44
45 @Test
46 public void dbpedia() throws IOException {
47 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
48 PagodaTester.main(
49 TestUtil.combinePaths(ontoDir, "dbpedia/integratedOntology-all-in-one-minus-datatype.owl"),
50 TestUtil.combinePaths(ontoDir, "dbpedia/data/dbpedia-minus-datatype-new.ttl"),
51 TestUtil.combinePaths(ontoDir, "dbpedia/atomic.sparql")
52 );
53 TestUtil.copyFile("log4j.log", "results-backup/current/dbpedia.out");
54 }
55
56 @Test
57 public void npdWithoutDataType() throws IOException {
58 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
59 PagodaTester.main(
60 TestUtil.combinePaths(ontoDir, "npd/npd-all-minus-datatype.owl"),
61 TestUtil.combinePaths(ontoDir, "npd/data/npd-data-dump-minus-datatype-new.ttl"),
62 TestUtil.combinePaths(ontoDir, "npd/queries/atomic.sparql")
63 );
64 TestUtil.copyFile("log4j.log", "results-backup/current/npd_minus.out");
65 }
66
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
deleted file mode 100644
index 1673179..0000000
--- a/test/uk/ac/ox/cs/pagoda/test_units/PagodaDBPedia.java
+++ /dev/null
@@ -1,30 +0,0 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import org.junit.Test;
4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
5import uk.ac.ox.cs.pagoda.tester.Statistics;
6import uk.ac.ox.cs.pagoda.util.TestUtil;
7
8import java.io.IOException;
9
10import static org.junit.Assert.fail;
11
12public class PagodaDBPedia {
13
14 @Test
15 public void test() throws IOException {
16 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
17 PagodaTester.main(
18 TestUtil.combinePaths(ontoDir, "dbpedia/integratedOntology-all-in-one-minus-datatype.owl"),
19 TestUtil.combinePaths(ontoDir, "dbpedia/data/dbpedia-minus-datatype-new.ttl"),
20 TestUtil.combinePaths(ontoDir, "dbpedia/atomic.sparql")
21 );
22
23 Statistics stat = new Statistics("output/log4j.log");
24 String diff = stat.diff("results-backup/benchmark/dbpedia.out");
25 TestUtil.copyFile("output/log4j.log", "results-backup/current/dbpedia.out");
26 if (!diff.isEmpty())
27 fail(diff);
28 }
29
30}
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/PagodaELU.java b/test/uk/ac/ox/cs/pagoda/test_units/PagodaELU.java
deleted file mode 100644
index 70d531d..0000000
--- a/test/uk/ac/ox/cs/pagoda/test_units/PagodaELU.java
+++ /dev/null
@@ -1,20 +0,0 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import org.junit.Test;
4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
5import uk.ac.ox.cs.pagoda.util.TestUtil;
6
7public class PagodaELU {
8
9 @Test void test() {
10 int number = 1;
11 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
12 PagodaTester.main(
13 TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"),
14 TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"),
15 TestUtil.combinePaths(ontoDir, "uobm/queries/standard.sparql")
16 );
17 }
18
19
20}
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/PagodaFLY.java b/test/uk/ac/ox/cs/pagoda/test_units/PagodaFLY.java
deleted file mode 100644
index bad533f..0000000
--- a/test/uk/ac/ox/cs/pagoda/test_units/PagodaFLY.java
+++ /dev/null
@@ -1,25 +0,0 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import org.junit.Test;
4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
5import uk.ac.ox.cs.pagoda.util.TestUtil;
6
7public class PagodaFLY {
8
9 @Test
10 public void test() {
11 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
12 PagodaTester.main(
13 TestUtil.combinePaths(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl"),
14 TestUtil.combinePaths(ontoDir, "fly/queries/fly_pellet.sparql")
15 );
16
17// Statistics stat = new Statistics("output/log4j.log");
18// String diff = stat.diff("results-backup/benchmark/fly.out");
19// AllTests.copy("output/log4j.log", "results-backup/current/fly.out");
20// if (!diff.isEmpty())
21// fail(diff);
22 }
23
24
25}
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java b/test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java
deleted file mode 100644
index 1aded5b..0000000
--- a/test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java
+++ /dev/null
@@ -1,24 +0,0 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import org.testng.annotations.Test;
4import uk.ac.ox.cs.pagoda.util.TestUtil;
5
6import java.io.IOException;
7import java.nio.file.Paths;
8
9public class PagodaLUBM {
10
11 private void testN(int number ) throws IOException {
12 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
13 TestGlobalCorrectness.test(Paths.get(ontoDir, "lubm/univ-bench.owl"),
14 Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl"),
15 Paths.get(ontoDir, "lubm/queries/test.sparql"),
16 Paths.get(ontoDir, "lubm/lubm" + number + ".json"));
17 }
18
19 @Test
20 public void test1() throws IOException {
21 testN(1);
22 }
23
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
deleted file mode 100644
index 5f89162..0000000
--- a/test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD.java
+++ /dev/null
@@ -1,46 +0,0 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import org.junit.Test;
4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
5import uk.ac.ox.cs.pagoda.tester.Statistics;
6import uk.ac.ox.cs.pagoda.util.TestUtil;
7
8import java.io.IOException;
9
10import static org.junit.Assert.fail;
11
12public class PagodaNPD {
13
14 @Test
15 public void testNPDwithoutDataType() throws IOException {
16 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
17 PagodaTester.main(
18 TestUtil.combinePaths(ontoDir, "npd/npd-all-minus-datatype.owl"),
19 TestUtil.combinePaths(ontoDir, "npd/data/npd-data-dump-minus-datatype-new.ttl"),
20 TestUtil.combinePaths(ontoDir, "npd/queries/atomic.sparql")
21 );
22
23 Statistics stat = new Statistics("output/log4j.log");
24 String diff = stat.diff("results-backup/benchmark/npd_minus.out");
25 TestUtil.copyFile("output/log4j.log", "results-backup/current/npd_minus.out");
26 if (!diff.isEmpty())
27 fail(diff);
28 }
29
30 @Test
31 public void testNPD() throws IOException {
32 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
33 PagodaTester.main(
34 TestUtil.combinePaths(ontoDir, "npd/npd-all.owl"),
35 TestUtil.combinePaths(ontoDir, "npd/data/npd-data-dump-processed.ttl"),
36 TestUtil.combinePaths(ontoDir, "npd/queries/atomic.sparql")
37 );
38
39 Statistics stat = new Statistics("output/log4j.log");
40 String diff = stat.diff("results-backup/benchmark/npd.out");
41 TestUtil.copyFile("output/log4j.log", "results-backup/current/npd.out");
42 if (!diff.isEmpty())
43 fail(diff);
44 }
45
46}
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
deleted file mode 100644
index 1aca36a..0000000
--- a/test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD_bench.java
+++ /dev/null
@@ -1,30 +0,0 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import org.junit.Test;
4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
5import uk.ac.ox.cs.pagoda.tester.Statistics;
6import uk.ac.ox.cs.pagoda.util.TestUtil;
7
8import java.io.IOException;
9
10import static org.junit.Assert.fail;
11
12public class PagodaNPD_bench {
13
14 @Test
15 public void test() throws IOException {
16 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
17 PagodaTester.main(
18 TestUtil.combinePaths(ontoDir, "npd-benchmark/npd-v2-ql_a.owl"),
19 TestUtil.combinePaths(ontoDir, "npd-benchmark/npd-v2-ql_a.ttl"),
20 TestUtil.combinePaths(ontoDir, "npd-benchmark/queries/all.sparql")
21 );
22
23 Statistics stat = new Statistics("output/log4j.log");
24 String diff = stat.diff("results-backup/benchmark/npd-bench.out");
25 TestUtil.copyFile("output/log4j.log", "results-backup/current/npd-bench.out");
26 if (!diff.isEmpty())
27 fail(diff);
28 }
29
30}
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/PagodaRLU.java b/test/uk/ac/ox/cs/pagoda/test_units/PagodaRLU.java
deleted file mode 100644
index c365196..0000000
--- a/test/uk/ac/ox/cs/pagoda/test_units/PagodaRLU.java
+++ /dev/null
@@ -1,20 +0,0 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import org.junit.Test;
4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
5import uk.ac.ox.cs.pagoda.util.TestUtil;
6
7public class PagodaRLU {
8
9 @Test
10 public void testRL() {
11 int number = 1;
12 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
13 PagodaTester.main(
14 TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"),
15 TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"),
16 TestUtil.combinePaths(ontoDir, "uobm/queries/standard.sparql")
17 );
18 }
19
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
deleted file mode 100644
index ee9cf13..0000000
--- a/test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java
+++ /dev/null
@@ -1,24 +0,0 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import org.testng.annotations.Test;
4import uk.ac.ox.cs.pagoda.util.TestUtil;
5
6import java.io.IOException;
7import java.nio.file.Paths;
8
9public class PagodaUOBM {
10
11 private void testN(int number ) throws IOException {
12 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
13 TestGlobalCorrectness.test(Paths.get(ontoDir, "uobm/univ-bench-dl.owl"),
14 Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl"),
15 Paths.get(ontoDir, "uobm/queries/test.sparql"),
16 Paths.get(ontoDir, "uobm/uobm" + number + ".json"));
17 }
18
19 @Test
20 public void test1() throws IOException {
21 testN(1);
22 }
23
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
deleted file mode 100644
index ffaf8fc..0000000
--- a/test/uk/ac/ox/cs/pagoda/test_units/TestGlobalCorrectness.java
+++ /dev/null
@@ -1,52 +0,0 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import com.google.gson.Gson;
4import com.google.gson.reflect.TypeToken;
5import org.apache.log4j.Level;
6import org.testng.Assert;
7import uk.ac.ox.cs.pagoda.query.QueryRecord;
8import uk.ac.ox.cs.pagoda.tester.PagodaTester;
9import uk.ac.ox.cs.pagoda.util.Utility;
10
11import java.io.BufferedReader;
12import java.io.File;
13import java.io.IOException;
14import java.lang.reflect.Type;
15import java.nio.file.Files;
16import java.nio.file.Path;
17import java.nio.file.Paths;
18import java.util.Set;
19
20/**
21 * This is a unit test for TestNG.
22 * <p>
23 * It tests the correctness on the final output.
24 * */
25public class TestGlobalCorrectness {
26
27 public static void test(Path ontology, Path data, Path queries, Path givenAnswers) {
28 try {
29 Utility.setLogLevel(Level.DEBUG);
30 Path computedAnswers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath());
31 PagodaTester.main(ontology.toString(), data.toString(), queries.toString(), computedAnswers.toString());
32 assertSameContent(computedAnswers, givenAnswers);
33 } catch (IOException e) {
34 e.printStackTrace();
35 }
36 }
37
38 private static void assertSameContent(Path computedAnswersFile, Path givenAnswersFile) throws IOException {
39 BufferedReader computedReader = Files.newBufferedReader(computedAnswersFile);
40 BufferedReader givenReader = Files.newBufferedReader(givenAnswersFile);
41
42 Gson gson = QueryRecord.GsonCreator.getInstance();
43
44 Type cqType = new TypeToken<Set<QueryRecord>>() {}.getType();
45 Set<QueryRecord> computedAnswers = gson.fromJson(computedReader, cqType);
46 Set<QueryRecord> givenAnswers = gson.fromJson(givenReader, cqType);
47
48 Assert.assertEquals(computedAnswers, givenAnswers);
49 }
50
51
52}