aboutsummaryrefslogtreecommitdiff
path: root/test/uk/ac/ox/cs/pagoda/global_tests
diff options
context:
space:
mode:
Diffstat (limited to 'test/uk/ac/ox/cs/pagoda/global_tests')
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/CheckAnswersOverDataset.java (renamed from test/uk/ac/ox/cs/pagoda/global_tests/TestGlobalCorrectness.java)19
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/JAIR_Scalability.java2
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/LightEvaluation.java64
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/PagodaDBPedia.java30
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/PagodaELU.java20
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/PagodaFLY.java25
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/PagodaLUBM.java24
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/PagodaNPD.java46
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/PagodaNPD_bench.java30
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/PagodaRLU.java20
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaDBPedia.java33
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java28
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java45
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaNPD.java38
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java (renamed from test/uk/ac/ox/cs/pagoda/global_tests/PagodaUOBM.java)30
15 files changed, 174 insertions, 280 deletions
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestGlobalCorrectness.java b/test/uk/ac/ox/cs/pagoda/global_tests/CheckAnswersOverDataset.java
index dff2366..424afa2 100644
--- a/test/uk/ac/ox/cs/pagoda/global_tests/TestGlobalCorrectness.java
+++ b/test/uk/ac/ox/cs/pagoda/global_tests/CheckAnswersOverDataset.java
@@ -2,11 +2,9 @@ package uk.ac.ox.cs.pagoda.global_tests;
2 2
3import com.google.gson.Gson; 3import com.google.gson.Gson;
4import com.google.gson.reflect.TypeToken; 4import com.google.gson.reflect.TypeToken;
5import org.apache.log4j.Level;
6import org.testng.Assert; 5import org.testng.Assert;
6import uk.ac.ox.cs.pagoda.Pagoda;
7import uk.ac.ox.cs.pagoda.query.QueryRecord; 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 8
11import java.io.BufferedReader; 9import java.io.BufferedReader;
12import java.io.File; 10import java.io.File;
@@ -18,18 +16,17 @@ import java.nio.file.Paths;
18import java.util.Set; 16import java.util.Set;
19 17
20/** 18/**
21 * This is a unit test for TestNG. 19 * Given an instance of Pagoda, it checks the returned answers.
22 * <p>
23 * It tests the correctness on the final output.
24 * */ 20 * */
25public class TestGlobalCorrectness { 21public class CheckAnswersOverDataset {
26 22
27 public static void test(Path ontology, Path data, Path queries, Path givenAnswers) { 23 public static void check(Pagoda pagoda, Path givenAnswers) {
28 try { 24 try {
29 Utility.setLogLevel(Level.DEBUG); 25// Utility.setLogLevel(Level.DEBUG); // uncomment for outputting partial results
30 Path computedAnswers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); 26 Path computedAnswers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath());
31 new File(computedAnswers.toString()).deleteOnExit(); 27 new File(computedAnswers.toString()).deleteOnExit();
32 PagodaTester.main(ontology.toString(), data.toString(), queries.toString(), computedAnswers.toString()); 28
29 pagoda.run();
33 assertSameContent(computedAnswers, givenAnswers); 30 assertSameContent(computedAnswers, givenAnswers);
34 } catch (IOException e) { 31 } catch (IOException e) {
35 e.printStackTrace(); 32 e.printStackTrace();
@@ -48,6 +45,4 @@ public class TestGlobalCorrectness {
48 45
49 Assert.assertEquals(computedAnswers, givenAnswers); 46 Assert.assertEquals(computedAnswers, givenAnswers);
50 } 47 }
51
52
53} 48}
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/JAIR_Scalability.java b/test/uk/ac/ox/cs/pagoda/global_tests/JAIR_Scalability.java
index cdf55bd..687ffee 100644
--- a/test/uk/ac/ox/cs/pagoda/global_tests/JAIR_Scalability.java
+++ b/test/uk/ac/ox/cs/pagoda/global_tests/JAIR_Scalability.java
@@ -84,7 +84,7 @@ public class JAIR_Scalability {
84 } 84 }
85 85
86 public static void main(String... args) throws IOException { 86 public static void main(String... args) throws IOException {
87 Properties.ShellModeDefault = true; 87 Properties.shellModeDefault = true;
88 new JAIR_Scalability().testUniProt(50, false); 88 new JAIR_Scalability().testUniProt(50, false);
89 } 89 }
90 90
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/LightEvaluation.java b/test/uk/ac/ox/cs/pagoda/global_tests/LightEvaluation.java
index 3ee268e..b073a26 100644
--- a/test/uk/ac/ox/cs/pagoda/global_tests/LightEvaluation.java
+++ b/test/uk/ac/ox/cs/pagoda/global_tests/LightEvaluation.java
@@ -1,67 +1,17 @@
1package uk.ac.ox.cs.pagoda.global_tests; 1package uk.ac.ox.cs.pagoda.global_tests;
2 2
3import org.junit.Test; 3import org.testng.annotations.Test;
4import uk.ac.ox.cs.pagoda.tester.PagodaTester;
5import uk.ac.ox.cs.pagoda.util.TestUtil;
6 4
7import java.io.IOException; 5import java.io.IOException;
8 6
9public class LightEvaluation { 7public class LightEvaluation {
10 8
11 @Test 9 @Test
12 public void uobm1() throws IOException { 10 public void evaluation() throws IOException {
13 int number = 1; 11 new TestPagodaUOBM().test(1);
14 String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); 12 new TestPagodaLUBM().test(100);
15 PagodaTester.main( 13 new TestPagodaFLY().test();
16 TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"), 14 new TestPagodaDBPedia().test();
17 TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"), 15 new TestPagodaNPD().testNPDwithoutDataType();
18 TestUtil.combinePaths(ontoDir, "uobm/queries/standard.sparql")
19 );
20 TestUtil.copyFile("log4j.log", "output/jair/uobm1.out");
21 } 16 }
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} 17}
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/PagodaDBPedia.java b/test/uk/ac/ox/cs/pagoda/global_tests/PagodaDBPedia.java
deleted file mode 100644
index 2b9cdbd..0000000
--- a/test/uk/ac/ox/cs/pagoda/global_tests/PagodaDBPedia.java
+++ /dev/null
@@ -1,30 +0,0 @@
1package uk.ac.ox.cs.pagoda.global_tests;
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/global_tests/PagodaELU.java b/test/uk/ac/ox/cs/pagoda/global_tests/PagodaELU.java
deleted file mode 100644
index da059f9..0000000
--- a/test/uk/ac/ox/cs/pagoda/global_tests/PagodaELU.java
+++ /dev/null
@@ -1,20 +0,0 @@
1package uk.ac.ox.cs.pagoda.global_tests;
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/global_tests/PagodaFLY.java b/test/uk/ac/ox/cs/pagoda/global_tests/PagodaFLY.java
deleted file mode 100644
index d558e0f..0000000
--- a/test/uk/ac/ox/cs/pagoda/global_tests/PagodaFLY.java
+++ /dev/null
@@ -1,25 +0,0 @@
1package uk.ac.ox.cs.pagoda.global_tests;
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/global_tests/PagodaLUBM.java b/test/uk/ac/ox/cs/pagoda/global_tests/PagodaLUBM.java
deleted file mode 100644
index 2014ec1..0000000
--- a/test/uk/ac/ox/cs/pagoda/global_tests/PagodaLUBM.java
+++ /dev/null
@@ -1,24 +0,0 @@
1package uk.ac.ox.cs.pagoda.global_tests;
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/global_tests/PagodaNPD.java b/test/uk/ac/ox/cs/pagoda/global_tests/PagodaNPD.java
deleted file mode 100644
index 17d1e82..0000000
--- a/test/uk/ac/ox/cs/pagoda/global_tests/PagodaNPD.java
+++ /dev/null
@@ -1,46 +0,0 @@
1package uk.ac.ox.cs.pagoda.global_tests;
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/global_tests/PagodaNPD_bench.java b/test/uk/ac/ox/cs/pagoda/global_tests/PagodaNPD_bench.java
deleted file mode 100644
index c908cb4..0000000
--- a/test/uk/ac/ox/cs/pagoda/global_tests/PagodaNPD_bench.java
+++ /dev/null
@@ -1,30 +0,0 @@
1package uk.ac.ox.cs.pagoda.global_tests;
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/global_tests/PagodaRLU.java b/test/uk/ac/ox/cs/pagoda/global_tests/PagodaRLU.java
deleted file mode 100644
index 88e0835..0000000
--- a/test/uk/ac/ox/cs/pagoda/global_tests/PagodaRLU.java
+++ /dev/null
@@ -1,20 +0,0 @@
1package uk.ac.ox.cs.pagoda.global_tests;
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/global_tests/TestPagodaDBPedia.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaDBPedia.java
new file mode 100644
index 0000000..04c9f3b
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaDBPedia.java
@@ -0,0 +1,33 @@
1package uk.ac.ox.cs.pagoda.global_tests;
2
3import org.testng.annotations.Test;
4import uk.ac.ox.cs.pagoda.Pagoda;
5import uk.ac.ox.cs.pagoda.util.TestUtil;
6
7import java.io.IOException;
8import java.nio.file.Paths;
9
10public class TestPagodaDBPedia {
11
12 public static final String ANSWER_PATH = "~/TestPagodaDEBPedia.json";
13
14 @Test
15 public void just_execute() throws IOException {
16 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
17 Pagoda pagoda = Pagoda.builder()
18 .ontology(Paths.get(ontoDir, "dbpedia/integratedOntology-all-in-one-minus-datatype.owl"))
19 .data(Paths.get(ontoDir, "dbpedia/data/dbpedia-minus-datatype-new.ttl"))
20 .query(Paths.get(ontoDir, "dbpedia/atomic.sparql"))
21 .answer(ANSWER_PATH)
22 .classify(true)
23 .hermit(true)
24 .build();
25 pagoda.run();
26 }
27
28 @Test
29 public void test() {
30 // TODO implement
31 }
32
33}
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java
new file mode 100644
index 0000000..623034e
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java
@@ -0,0 +1,28 @@
1package uk.ac.ox.cs.pagoda.global_tests;
2
3import org.testng.annotations.Test;
4import uk.ac.ox.cs.pagoda.Pagoda;
5import uk.ac.ox.cs.pagoda.util.TestUtil;
6
7public class TestPagodaFLY {
8
9 public static final String ANSWER_PATH = "~/TestPagodaFLY.json";
10
11 @Test
12 public void just_execute() {
13 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
14 Pagoda pagoda = Pagoda.builder()
15 .ontology(TestUtil.combinePaths(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl"))
16 .query(TestUtil.combinePaths(ontoDir, "fly/queries/fly.sparql"))
17// .answer(ANSWER_PATH)
18 .classify(true)
19 .hermit(true)
20 .build();
21 pagoda.run();
22 }
23
24 @Test
25 public void test() {
26 // TODO implement
27 }
28}
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java
new file mode 100644
index 0000000..bb58681
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java
@@ -0,0 +1,45 @@
1package uk.ac.ox.cs.pagoda.global_tests;
2
3import org.testng.annotations.Test;
4import uk.ac.ox.cs.pagoda.Pagoda;
5import uk.ac.ox.cs.pagoda.util.TestUtil;
6
7import java.io.IOException;
8import java.nio.file.Paths;
9
10public class TestPagodaLUBM {
11
12 public void test(int number) throws IOException {
13 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
14 Pagoda pagoda = Pagoda.builder()
15 .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl"))
16 .data(Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl"))
17 .query(Paths.get(ontoDir, "lubm/queries/test.sparql"))
18 .classify(true)
19 .hermit(true)
20 .build();
21 CheckAnswersOverDataset.check(pagoda, Paths.get(ontoDir, "lubm/lubm" + number + ".json"));
22 }
23
24 @Test
25 public void test_1() throws IOException {
26 test(1);
27 }
28
29 public void justExecute_100() {
30 int number = 100;
31 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
32 Pagoda pagoda = Pagoda.builder()
33 .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl"))
34 .data(Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl"))
35 .query(Paths.get(ontoDir, "lubm/queries/test.sparql"))
36 .classify(true)
37 .hermit(true)
38 .build();
39 pagoda.run();
40 }
41
42 public static void main(String... args) {
43 new TestPagodaLUBM().justExecute_100();
44 }
45}
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaNPD.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaNPD.java
new file mode 100644
index 0000000..939ee6e
--- /dev/null
+++ b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaNPD.java
@@ -0,0 +1,38 @@
1package uk.ac.ox.cs.pagoda.global_tests;
2
3import org.testng.annotations.Test;
4import uk.ac.ox.cs.pagoda.Pagoda;
5import uk.ac.ox.cs.pagoda.util.TestUtil;
6
7import java.io.IOException;
8import java.nio.file.Paths;
9
10public class TestPagodaNPD {
11
12 public static final String ANSWER_PATH = "~/PagodaNPDWithoutDatatype.json";
13
14 @Test
15 public void justExecuteNPDWithoutDataType() {
16 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
17 Pagoda pagoda = Pagoda.builder()
18 .ontology(Paths.get(ontoDir, "npd/npd-all-minus-datatype.owl"))
19 .data(Paths.get(ontoDir, "npd/data/npd-data-dump-minus-datatype-new.ttl"))
20 .query(Paths.get(ontoDir, "npd/queries/atomic.sparql"))
21 .answer(ANSWER_PATH)
22 .classify(true)
23 .hermit(true)
24 .build();
25 pagoda.run();
26 }
27
28 @Test
29 public void testNPDwithoutDataType() throws IOException {
30 // TODO implement
31 }
32
33 @Test
34 public void testNPD() throws IOException {
35 // TODO implement
36 }
37
38}
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/PagodaUOBM.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java
index 065fb29..61235d3 100644
--- a/test/uk/ac/ox/cs/pagoda/global_tests/PagodaUOBM.java
+++ b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java
@@ -2,6 +2,7 @@ package uk.ac.ox.cs.pagoda.global_tests;
2 2
3import org.testng.annotations.DataProvider; 3import org.testng.annotations.DataProvider;
4import org.testng.annotations.Test; 4import org.testng.annotations.Test;
5import uk.ac.ox.cs.pagoda.Pagoda;
5import uk.ac.ox.cs.pagoda.tester.PagodaTester; 6import uk.ac.ox.cs.pagoda.tester.PagodaTester;
6import uk.ac.ox.cs.pagoda.util.TestUtil; 7import uk.ac.ox.cs.pagoda.util.TestUtil;
7 8
@@ -10,25 +11,29 @@ import java.nio.file.Paths;
10 11
11import static uk.ac.ox.cs.pagoda.util.TestUtil.combinePaths; 12import static uk.ac.ox.cs.pagoda.util.TestUtil.combinePaths;
12 13
13public class PagodaUOBM { 14public class TestPagodaUOBM {
14 15
15 private void testN(int number ) throws IOException { 16 public void test(int number) throws IOException {
16 String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); 17 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
17 TestGlobalCorrectness.test(Paths.get(ontoDir, "uobm/univ-bench-dl.owl"), 18 Pagoda pagoda = Pagoda.builder()
18 Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl"), 19 .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl"))
19 Paths.get(ontoDir, "uobm/queries/test.sparql"), 20 .data(Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl"))
20 Paths.get(ontoDir, "uobm/uobm" + number + ".json")); 21 .query(Paths.get(ontoDir, "uobm/queries/test.sparql"))
22 .classify(true)
23 .hermit(true)
24 .build();
25 CheckAnswersOverDataset.check(pagoda,
26 Paths.get(ontoDir, "uobm/uobm" + number + ".json"));
21 } 27 }
22 28
23 @Test 29 @Test
24 public void test1() throws IOException { 30 public void test_1() throws IOException {
25 testN(1); 31 test(1);
26 } 32 }
27 33
28 private static final int N_1 = 8; 34 private static final int N_1 = 1;
29 private static final int N_2 = 10; 35 private static final int N_2 = 10;
30 36
31
32 @DataProvider(name = "uobmNumbers") 37 @DataProvider(name = "uobmNumbers")
33 public static Object[][] uobmNumbers() { 38 public static Object[][] uobmNumbers() {
34 Integer[][] integers = new Integer[N_2 - N_1 + 1][1]; 39 Integer[][] integers = new Integer[N_2 - N_1 + 1][1];
@@ -37,11 +42,6 @@ public class PagodaUOBM {
37 return integers; 42 return integers;
38 } 43 }
39 44
40// @Test
41// public void justExecute3() {
42// justExecute(1);
43// }
44
45 @Test(dataProvider = "uobmNumbers") 45 @Test(dataProvider = "uobmNumbers")
46 public void justExecute(int number) { 46 public void justExecute(int number) {
47 String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); 47 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");