aboutsummaryrefslogtreecommitdiff
path: root/test/uk/ac/ox/cs/pagoda/test_units
diff options
context:
space:
mode:
authorRonca <alessandro.a.ronca@gmail.com>2015-05-06 18:11:08 +0100
committerRonca <alessandro.a.ronca@gmail.com>2015-05-06 18:11:08 +0100
commitfbbbfbeb79097e5ce8f9ff2682d2c21368971654 (patch)
tree02962a710fe27ea1c7a2704a356b7f663a42cb52 /test/uk/ac/ox/cs/pagoda/test_units
parent58e6d87cb604702e7b307bad73c4fd42a694c3ec (diff)
downloadACQuA-fbbbfbeb79097e5ce8f9ff2682d2c21368971654.tar.gz
ACQuA-fbbbfbeb79097e5ce8f9ff2682d2c21368971654.zip
Switch from JUnit to TestNG.
Plus minor fixes.
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.java109
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/JAIR_PAGOdA.java180
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/JAIR_Scalability.java88
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/LightEvaluation.java62
-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.java18
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaFLY.java24
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java68
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD.java45
-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.java18
-rw-r--r--test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java79
13 files changed, 915 insertions, 0 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
new file mode 100644
index 0000000..a0f16d4
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/test_units/ClauseTester.java
@@ -0,0 +1,164 @@
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
new file mode 100644
index 0000000..4e32297
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/test_units/CostEvaluation.java
@@ -0,0 +1,109 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import org.semanticweb.owlapi.model.OWLOntology;
4
5import org.testng.annotations.Test;
6import uk.ac.ox.cs.pagoda.owl.OWLHelper;
7import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner;
8import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner.Type;
9import uk.ac.ox.cs.pagoda.tester.PagodaTester;
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 PagodaTester.main(
19 PagodaTester.onto_dir + "lubm/univ-bench.owl",
20 PagodaTester.onto_dir + "lubm/data/lubm" + number + ".ttl",
21 PagodaTester.onto_dir + "lubm/queries/test_all_pagoda.sparql"
22 );
23// AllTests.copy("output/log4j.log", "results-backup/jair/lubm" + number + ".out");
24 }
25
26 public void lubm1000() {
27 int number = 1000;
28 String[] args = new String[] {
29 PagodaTester.onto_dir + "lubm/univ-bench.owl",
30 PagodaTester.onto_dir + "lubm/data/lubm" + number + ".ttl",
31 PagodaTester.onto_dir + "lubm/queries/test_all_pagoda.sparql"
32 };
33 OWLOntology ontology = OWLHelper.loadOntology(args[0]);
34 QueryReasoner reasoner = QueryReasoner.getInstance(Type.ELHOU, ontology, true, true);
35 Timer t = new Timer();
36 reasoner.loadOntology(ontology);
37 reasoner.importData(args[1]);
38 if (!reasoner.preprocess())
39 return ;
40 Utility.logInfo("Preprocessing Done in " + t.duration() + " seconds.");
41
42 reasoner.evaluate(reasoner.getQueryManager().collectQueryRecords(args[2]));
43// AllTests.copy("output/log4j.log", "results-backup/jair/lubm" + number + ".out");
44 }
45
46 @Test
47 public void uobm5() {
48 int number = 1;
49 String[] args = new String[] {
50 PagodaTester.onto_dir + "uobm/univ-bench-dl.owl",
51 PagodaTester.onto_dir + "uobm/data/uobm" + number + ".ttl",
52 PagodaTester.onto_dir + "uobm/queries/standard_all_pagoda.sparql"
53 };
54 PagodaTester.main(args);
55// AllTests.copy("output/log4j.log", "results-backup/jair/uobm" + number + ".out");
56 }
57
58 public void uobm100() {
59 int number = 200;
60 String[] args = new String[] {
61 PagodaTester.onto_dir + "uobm/univ-bench-dl.owl",
62 PagodaTester.onto_dir + "uobm/data/uobm" + number + ".ttl",
63 PagodaTester.onto_dir + "uobm/queries/standard_group3_all.sparql"
64 };
65 PagodaTester.main(args);
66// AllTests.copy("output/log4j.log", "results-backup/jair/uobm" + number + ".out");
67 }
68
69 public void uobm500() {
70 int number = 500;
71 String[] args = new String[] {
72 PagodaTester.onto_dir + "uobm/univ-bench-dl.owl",
73 PagodaTester.onto_dir + "uobm/data/uobm" + number + ".ttl",
74 PagodaTester.onto_dir + "uobm/queries/standard_all_pagoda.sparql"
75 };
76
77 OWLOntology ontology = OWLHelper.loadOntology(args[0]);
78 QueryReasoner reasoner = QueryReasoner.getInstance(Type.ELHOU, ontology, true, true);
79 Timer t = new Timer();
80 reasoner.loadOntology(ontology);
81 reasoner.importData(args[1]);
82 if (!reasoner.preprocess())
83 return ;
84 Utility.logInfo("Preprocessing Done in " + t.duration() + " seconds.");
85
86 reasoner.evaluate(reasoner.getQueryManager().collectQueryRecords(args[2]));
87// AllTests.copy("output/log4j.log", "results-backup/jair/uobm" + number + ".out");
88 }
89
90
91 public static void main(String... args) {
92 args = new String[] {
93 PagodaTester.onto_dir + "dbpedia/integratedOntology-all-in-one-minus-datatype.owl",
94 PagodaTester.onto_dir + "dbpedia/data/dbpedia-minus-datatype-new.ttl",
95 PagodaTester.onto_dir + "dbpedia/queries/atomic_ground.sparql"
96 };
97
98 OWLOntology ontology = OWLHelper.loadOntology(args[0]);
99 QueryReasoner reasoner = QueryReasoner.getInstance(Type.ELHOU, ontology, true, true);
100 Timer t = new Timer();
101 reasoner.loadOntology(ontology);
102 reasoner.importData(args[1]);
103 if (!reasoner.preprocess())
104 return ;
105 Utility.logInfo("Preprocessing Done in " + t.duration() + " seconds.");
106
107 reasoner.evaluate(reasoner.getQueryManager().collectQueryRecords(args[2]));
108 }
109}
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
new file mode 100644
index 0000000..ff616f7
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/test_units/JAIR_PAGOdA.java
@@ -0,0 +1,180 @@
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.Utility;
6
7import java.io.IOException;
8
9public class JAIR_PAGOdA {
10
11 @Test
12 public void lubm1() throws IOException {
13 String[] args = new String[] {
14 PagodaTester.onto_dir + "lubm/univ-bench.owl",
15 PagodaTester.onto_dir + "lubm/data/lubm1.ttl",
16 PagodaTester.onto_dir + "lubm/queries/test.sparql"
17 };
18 PagodaTester.main(args);
19 Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/lubm1/pagoda");
20 }
21
22 @Test
23 public void lubm1_conj() throws IOException {
24 String[] args = new String[] {
25 PagodaTester.onto_dir + "lubm/univ-bench.owl",
26 PagodaTester.onto_dir + "lubm/data/lubm1.ttl",
27 PagodaTester.onto_dir + "lubm/queries/test_pellet.sparql"
28 };
29 PagodaTester.main(args);
30 Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/lubm1/pagoda_conj");
31 }
32
33 @Test
34 public void lubm1_rolledUp() throws IOException {
35 String[] args = new String[] {
36 "/home/yzhou/backup/20141212/univ-bench-queries.owl",
37 PagodaTester.onto_dir + "lubm/data/lubm1.ttl",
38 PagodaTester.onto_dir + "lubm/queries/atomic_lubm.sparql"
39 };
40 PagodaTester.main(args);
41 Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/lubm1/pagoda_rolledUp");
42 }
43
44 @Test
45 public void uobm1() throws IOException {
46 String[] args = new String[] {
47 PagodaTester.onto_dir + "uobm/univ-bench-dl.owl",
48 PagodaTester.onto_dir + "uobm/data/uobm1.ttl",
49 PagodaTester.onto_dir + "uobm/queries/standard.sparql"
50 };
51 PagodaTester.main(args);
52 Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uobm1/pagoda");
53 }
54
55 @Test
56 public void uobm1_conj() throws IOException {
57 String[] args = new String[] {
58 PagodaTester.onto_dir + "uobm/univ-bench-dl.owl",
59 PagodaTester.onto_dir + "uobm/data/uobm1.ttl",
60 PagodaTester.onto_dir + "uobm/queries/standard_pellet.sparql"
61 };
62 PagodaTester.main(args);
63 Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uobm1/pagoda_conj");
64 }
65
66 @Test
67 public void uobm1_rolledUp() {
68 String[] args = new String[] {
69 "/home/yzhou/backup/20141212/univ-bench-dl-queries.owl",
70 PagodaTester.onto_dir + "uobm/data/uobm1.ttl",
71 PagodaTester.onto_dir + "uobm/queries/atomic_uobm.sparql"
72 };
73 PagodaTester.main(args);
74// AllTests.copy("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uobm1/pagoda_rolledUp");
75 }
76
77 @Test
78 public void fly() {
79 String[] args = new String[] {
80 PagodaTester.onto_dir + "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl",
81 null,
82 PagodaTester.onto_dir + "fly/queries/fly_pellet.sparql"
83 };
84 PagodaTester.main(args);
85// AllTests.copy("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/fly/pagoda");
86 }
87
88 @Test
89 public void fly_conj() throws IOException {
90 String[] args = new String[] {
91 PagodaTester.onto_dir + "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl",
92 null,
93 PagodaTester.onto_dir + "fly/queries/fly_pellet.sparql"
94 };
95 PagodaTester.main(args);
96 Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/fly/pagoda_conj");
97 }
98
99
100 public void fly_rolledUp() {
101 PagodaTester.main(new String[] {
102// PagodaTester.onto_dir + "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl",
103 PagodaTester.onto_dir + "fly/fly-all-in-one_rolledUp.owl",
104 null,
105 PagodaTester.onto_dir + "fly/queries/fly_atomic.sparql"
106 });
107// Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/fly/pagoda_rolledUp");
108 }
109
110 public void dbpedia() {
111 PagodaTester.main(
112 PagodaTester.onto_dir + "dbpedia/integratedOntology-all-in-one-minus-datatype.owl",
113 PagodaTester.onto_dir + "dbpedia/data/dbpedia-minus-datatype-new.ttl",
114 PagodaTester.onto_dir + "dbpedia/queries/atomic_ground.sparql"
115 , "dbpedia.ans"
116 );
117
118// Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/dbpedia/pagoda");
119 }
120
121 public void npd() {
122 PagodaTester.main(
123 PagodaTester.onto_dir + "npd/npd-all-minus-datatype.owl",
124 PagodaTester.onto_dir + "npd/data/npd-data-dump-minus-datatype-new.ttl",
125 PagodaTester.onto_dir + "npd/queries/atomic_ground.sparql"
126 , "npd.ans"
127 );
128
129// Utility.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/npd/pagoda");
130 }
131
132 public void reactome() throws IOException {
133 PagodaTester.main(
134 PagodaTester.onto_dir + "bio2rdf/reactome/biopax-level3-processed.owl",
135 PagodaTester.onto_dir + "bio2rdf/reactome/graph sampling/reactome_sample_10.ttl",
136// null,
137// PagodaTester.onto_dir + "bio2rdf/reactome/queries/atomic_ground.sparql"
138 PagodaTester.onto_dir + "bio2rdf/reactome/queries/example.sparql"
139 , "pagoda_reactome.ans"
140 );
141 Utility.copyFile("log4j.log", "output/jair/pagoda_reactome.example");
142
143// AllTests.copy("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/reactome/pagoda_10p");
144 }
145
146 public void chembl() throws IOException {
147 PagodaTester.main(
148 PagodaTester.onto_dir + "bio2rdf/chembl/cco-noDPR.ttl",
149 PagodaTester.onto_dir + "bio2rdf/chembl/graph sampling/sample_1.nt",
150// PagodaTester.onto_dir + "bio2rdf/chembl/queries/atomic_ground.sparql"
151 PagodaTester.onto_dir + "bio2rdf/chembl/queries/example.sparql"
152 , "pagoda_chembl.ans"
153 );
154 Utility.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");
156 }
157
158 public void uniprot() throws IOException {
159 PagodaTester.main(
160 PagodaTester.onto_dir + "bio2rdf/uniprot/core-sat-processed.owl",
161 PagodaTester.onto_dir + "bio2rdf/uniprot/graph sampling/sample_1.nt",
162// null,
163// PagodaTester.onto_dir + "bio2rdf/uniprot/queries/atomic_ground.sparql"
164 PagodaTester.onto_dir + "bio2rdf/uniprot/queries/example.sparql"
165 , "pagoda_uniprot.ans"
166 );
167 Utility.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");
169 }
170
171
172 public static void main(String... args) {
173 try {
174 new JAIR_PAGOdA().lubm1();
175 } catch (IOException e) {
176 e.printStackTrace();
177 }
178 }
179
180}
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
new file mode 100644
index 0000000..43cb810
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/test_units/JAIR_Scalability.java
@@ -0,0 +1,88 @@
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.Utility;
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[] args = new String[] {
31 PagodaTester.onto_dir + "bio2rdf/reactome/biopax-level3-processed.owl",
32 PagodaTester.onto_dir + "bio2rdf/reactome/graph sampling/simplifed_sample_" + percentage + ".ttl",
33 PagodaTester.onto_dir + "bio2rdf/reactome/queries/test.sparql"
34 , "reactome.ans"
35 };
36 if (percentage == 10)
37 args[1] = args[1].replace("simplifed", "reactome");
38
39 PagodaTester.main(args);
40 if (save)
41 Utility.copyFile("log4j.log", "/home/yzhou/java-workspace/test-share/results_new/reactome/pagoda_" + percentage + "p" + date);
42 }
43
44 public void testChEMBL(int percentage, boolean save) throws IOException {
45 String[] args = new String[] {
46 PagodaTester.onto_dir + "bio2rdf/chembl/cco-noDPR.ttl",
47 PagodaTester.onto_dir + "bio2rdf/chembl/sample_" + percentage + ".nt",
48// PagodaTester.onto_dir + "bio2rdf/chembl/queries/atomic_ground.sparql"
49 PagodaTester.onto_dir + "bio2rdf/chembl/queries/test.sparql"
50 , "chembl.ans"
51 };
52 if (percentage == 1 || percentage == 10 || percentage == 50)
53 args[1] = args[1].replace("chembl", "chembl/graph sampling");
54 else
55 if (percentage == 100)
56 args[1] = "/home/yzhou/RDFData/ChEMBL/facts/ChEMBL.ttl";
57
58 PagodaTester.main(args);
59 if (save)
60 Utility.copyFile("log4j.log", "/home/yzhou/java-workspace/test-share/results_new/chembl/pagoda_" + percentage + "p" + date);
61 }
62
63 public void testUniProt(int percentage, boolean save) throws IOException {
64 String[] args = new String[] {
65 PagodaTester.onto_dir + "bio2rdf/uniprot/core-sat-processed.owl",
66 PagodaTester.onto_dir + "bio2rdf/uniprot/sample_" + percentage + ".nt",
67// PagodaTester.onto_dir + "bio2rdf/uniprot/queries/atomic_ground.sparql"
68 PagodaTester.onto_dir + "bio2rdf/uniprot/queries/test.sparql"
69 , "uniprot.ans"
70 };
71
72 if (percentage == 1 || percentage == 10 || percentage == 50)
73 args[1] = args[1].replace("uniprot", "uniprot/graph sampling");
74 else
75 if (percentage == 100)
76 args[1] = "/home/yzhou/krr-nas-share/Yujiao/ontologies/bio2rdf/uniprot/data/uniprot_cleaned.nt";
77
78 PagodaTester.main(args);
79 if (save)
80 Utility.copyFile("log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uniprot/pagoda_" + percentage + "p" + date);
81 }
82
83 public static void main(String... args) throws IOException {
84 Properties.ShellModeDefault = true;
85 new JAIR_Scalability().testUniProt(50, false);
86 }
87
88}
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/LightEvaluation.java b/test/uk/ac/ox/cs/pagoda/test_units/LightEvaluation.java
new file mode 100644
index 0000000..29006de
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/test_units/LightEvaluation.java
@@ -0,0 +1,62 @@
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.Utility;
6
7import java.io.IOException;
8
9public class LightEvaluation {
10
11 @Test
12 public void uobm1() throws IOException {
13 int number = 1;
14 PagodaTester.main(
15 PagodaTester.onto_dir + "uobm/univ-bench-dl.owl",
16 PagodaTester.onto_dir + "uobm/data/uobm" + number + ".ttl",
17 PagodaTester.onto_dir + "uobm/queries/standard.sparql"
18 );
19 Utility.copyFile("log4j.log", "output/jair/uobm1.out");
20 }
21
22 @Test
23 public void lubm100() throws IOException {
24 int number = 100;
25 PagodaTester.main(
26 PagodaTester.onto_dir + "lubm/univ-bench.owl",
27 PagodaTester.onto_dir + "lubm/data/lubm" + number + ".ttl",
28 PagodaTester.onto_dir + "lubm/queries/test.sparql"
29 );
30 Utility.copyFile("log4j.log", "results-backup/current/lubm100.out");
31 }
32
33 @Test
34 public void fly() throws IOException {
35 PagodaTester.main(
36 PagodaTester.onto_dir + "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl",
37 PagodaTester.onto_dir + "fly/queries/fly.sparql"
38 );
39 Utility.copyFile("log4j.log", "results-backup/current/fly.out");
40 }
41
42 @Test
43 public void dbpedia() throws IOException {
44 PagodaTester.main(
45 PagodaTester.onto_dir + "dbpedia/integratedOntology-all-in-one-minus-datatype.owl",
46 PagodaTester.onto_dir + "dbpedia/data/dbpedia-minus-datatype-new.ttl",
47 PagodaTester.onto_dir + "dbpedia/atomic.sparql"
48 );
49 Utility.copyFile("log4j.log", "results-backup/current/dbpedia.out");
50 }
51
52 @Test
53 public void npdWithoutDataType() throws IOException {
54 PagodaTester.main(
55 PagodaTester.onto_dir + "npd/npd-all-minus-datatype.owl",
56 PagodaTester.onto_dir + "npd/data/npd-data-dump-minus-datatype-new.ttl",
57 PagodaTester.onto_dir + "npd/queries/atomic.sparql"
58 );
59 Utility.copyFile("log4j.log", "results-backup/current/npd_minus.out");
60 }
61
62}
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/PagodaDBPedia.java b/test/uk/ac/ox/cs/pagoda/test_units/PagodaDBPedia.java
new file mode 100644
index 0000000..aaf542e
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaDBPedia.java
@@ -0,0 +1,30 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import static org.junit.Assert.fail;
4
5import org.junit.Test;
6
7import uk.ac.ox.cs.pagoda.tester.PagodaTester;
8import uk.ac.ox.cs.pagoda.tester.Statistics;
9import uk.ac.ox.cs.pagoda.util.Utility;
10
11import java.io.IOException;
12
13public class PagodaDBPedia {
14
15 @Test
16 public void test() throws IOException {
17 PagodaTester.main(
18 PagodaTester.onto_dir + "dbpedia/integratedOntology-all-in-one-minus-datatype.owl",
19 PagodaTester.onto_dir + "dbpedia/data/dbpedia-minus-datatype-new.ttl",
20 PagodaTester.onto_dir + "dbpedia/atomic.sparql"
21 );
22
23 Statistics stat = new Statistics("output/log4j.log");
24 String diff = stat.diff("results-backup/benchmark/dbpedia.out");
25 Utility.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
new file mode 100644
index 0000000..c2fa838
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaELU.java
@@ -0,0 +1,18 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import org.junit.Test;
4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
5
6public class PagodaELU {
7
8 @Test void test() {
9 int number = 1;
10 PagodaTester.main(
11 PagodaTester.onto_dir + "uobm/univ-bench-dl.owl",
12 PagodaTester.onto_dir + "uobm/data/uobm" + number + ".ttl",
13 PagodaTester.onto_dir + "uobm/queries/standard.sparql"
14 );
15 }
16
17
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
new file mode 100644
index 0000000..2fe07f0
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaFLY.java
@@ -0,0 +1,24 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import org.junit.Test;
4
5import uk.ac.ox.cs.pagoda.tester.PagodaTester;
6
7public class PagodaFLY {
8
9 @Test
10 public void test() {
11 PagodaTester.main(
12 PagodaTester.onto_dir + "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl",
13 PagodaTester.onto_dir + "fly/queries/fly_pellet.sparql"
14 );
15
16// Statistics stat = new Statistics("output/log4j.log");
17// String diff = stat.diff("results-backup/benchmark/fly.out");
18// AllTests.copy("output/log4j.log", "results-backup/current/fly.out");
19// if (!diff.isEmpty())
20// fail(diff);
21 }
22
23
24}
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java b/test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java
new file mode 100644
index 0000000..f40e41b
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaLUBM.java
@@ -0,0 +1,68 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import org.testng.Assert;
4import org.testng.annotations.Test;
5import uk.ac.ox.cs.pagoda.tester.PagodaTester;
6import uk.ac.ox.cs.pagoda.tester.Statistics;
7import uk.ac.ox.cs.pagoda.util.Utility;
8
9import java.io.FileInputStream;
10import java.io.IOException;
11import java.util.Properties;
12
13public class PagodaLUBM {
14
15 public static final String CONFIG_FILE = "config/test.properties";
16
17 private static boolean isInit = false;
18 private static String ontoDir;
19
20 private static void init() {
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 }
47
48 @Test
49 public void test1() {
50 test_all(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 }
67
68}
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD.java b/test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD.java
new file mode 100644
index 0000000..8fbe793
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD.java
@@ -0,0 +1,45 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import static org.junit.Assert.fail;
4
5import org.junit.Test;
6
7import uk.ac.ox.cs.pagoda.tester.PagodaTester;
8import uk.ac.ox.cs.pagoda.tester.Statistics;
9import uk.ac.ox.cs.pagoda.util.Utility;
10
11import java.io.IOException;
12
13public class PagodaNPD {
14
15 @Test
16 public void testNPDwithoutDataType() throws IOException {
17 PagodaTester.main(
18 PagodaTester.onto_dir + "npd/npd-all-minus-datatype.owl",
19 PagodaTester.onto_dir + "npd/data/npd-data-dump-minus-datatype-new.ttl",
20 PagodaTester.onto_dir + "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 Utility.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 PagodaTester.main(
33 PagodaTester.onto_dir + "npd/npd-all.owl",
34 PagodaTester.onto_dir + "npd/data/npd-data-dump-processed.ttl",
35 PagodaTester.onto_dir + "npd/queries/atomic.sparql"
36 );
37
38 Statistics stat = new Statistics("output/log4j.log");
39 String diff = stat.diff("results-backup/benchmark/npd.out");
40 Utility.copyFile("output/log4j.log", "results-backup/current/npd.out");
41 if (!diff.isEmpty())
42 fail(diff);
43 }
44
45}
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
new file mode 100644
index 0000000..1243180
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaNPD_bench.java
@@ -0,0 +1,30 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import static org.junit.Assert.fail;
4
5import org.junit.Test;
6
7import uk.ac.ox.cs.pagoda.tester.PagodaTester;
8import uk.ac.ox.cs.pagoda.tester.Statistics;
9import uk.ac.ox.cs.pagoda.util.Utility;
10
11import java.io.IOException;
12
13public class PagodaNPD_bench {
14
15 @Test
16 public void test() throws IOException {
17 PagodaTester.main(
18 PagodaTester.onto_dir + "npd-benchmark/npd-v2-ql_a.owl",
19 PagodaTester.onto_dir + "npd-benchmark/npd-v2-ql_a.ttl",
20 PagodaTester.onto_dir + "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 Utility.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
new file mode 100644
index 0000000..8b31c99
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaRLU.java
@@ -0,0 +1,18 @@
1package uk.ac.ox.cs.pagoda.test_units;
2
3import org.junit.Test;
4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
5
6public class PagodaRLU {
7
8 @Test
9 public void testRL() {
10 int number = 1;
11 PagodaTester.main(
12 PagodaTester.onto_dir + "uobm/univ-bench-dl.owl",
13 PagodaTester.onto_dir + "uobm/data/uobm" + number + ".ttl",
14 PagodaTester.onto_dir + "uobm/queries/standard.sparql"
15 );
16 }
17
18}
diff --git a/test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java b/test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java
new file mode 100644
index 0000000..29a9056
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/test_units/PagodaUOBM.java
@@ -0,0 +1,79 @@
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.tester.Statistics;
6import uk.ac.ox.cs.pagoda.util.Utility;
7
8import java.io.FileInputStream;
9import java.io.IOException;
10import java.util.Properties;
11
12public class PagodaUOBM {
13
14 public static final String CONFIG_FILE = "config/test.properties";
15
16 private static boolean isInit = false;
17 private static String ontoDir;
18
19 private static void init() {
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 }
62
63 @Test
64 public void test1() { test_all(1); }
65
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 }
78
79}