aboutsummaryrefslogtreecommitdiff
path: root/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java')
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java122
1 files changed, 0 insertions, 122 deletions
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java
deleted file mode 100644
index 4dae223..0000000
--- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java
+++ /dev/null
@@ -1,122 +0,0 @@
1package uk.ac.ox.cs.pagoda.global_tests;
2
3import org.testng.annotations.DataProvider;
4import org.testng.annotations.Test;
5import uk.ac.ox.cs.pagoda.Pagoda;
6import uk.ac.ox.cs.pagoda.query.CheckAnswers;
7import uk.ac.ox.cs.pagoda.util.TestUtil;
8
9import java.io.File;
10import java.io.IOException;
11import java.nio.file.Path;
12import java.nio.file.Paths;
13
14public class TestPagodaUOBM {
15
16 private static final int N_1 = 1;
17 private static final int N_2 = 4;
18
19 @DataProvider(name = "UOBMNumbers")
20 private static Object[][] UOBMNumbers() {
21 Integer[][] integers = new Integer[N_2 - N_1 + 1][1];
22 for(int i = 0; i < N_2 - N_1 + 1; i++)
23 integers[i][0] = N_1 + i;
24 return integers;
25 }
26
27 @Test(groups = {"light", "correctness"})
28 public void answersCorrectness_1() throws IOException {
29 answersCorrectness(1);
30 }
31
32 @Test(groups = {"heavy", "correctness"}, dataProvider = "UOBMNumbers")
33 public void answersCorrectness(int number) throws IOException {
34 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
35 Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath());
36 new File(answers.toString()).deleteOnExit();
37 Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-uobm" + number + ".json");
38
39 Pagoda pagoda = Pagoda.builder()
40 .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl"))
41 .data(Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl"))
42 .query(Paths.get(ontoDir, "uobm/queries/test.sparql"))
43 .answer(answers)
44 .build();
45
46 pagoda.run();
47 CheckAnswers.assertSameAnswers(answers, givenAnswers);
48 }
49
50 @Test(groups = {"sygenia"})
51 public void answersCorrectness_sygenia_1() throws IOException {
52 answersCorrectness_sygenia(1);
53 }
54
55 @Test(groups = {"heavy",}, dataProvider = "UOBMNumbers")
56 public void answersCorrectness_sygenia(int number) throws IOException {
57 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
58// Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath());
59// new File(answers.toString()).deleteOnExit();
60// Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-uobm" + number + ".json");
61
62 Pagoda pagoda = Pagoda.builder()
63 .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl"))
64 .data(Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl"))
65 .query(Paths.get(ontoDir, "uobm/queries/uobm_sygenia.sparql"))
66 .build();
67
68 pagoda.run();
69 }
70
71 @Test(groups = {"sygenia"})
72 public void answersCorrectness_sygenia_allBlanks_1() throws IOException {
73 answersCorrectness_sygenia(1);
74 }
75
76 @Test(groups = {"heavy"}, dataProvider = "UOBMNumbers")
77 public void answersCorrectness_sygenia_allBlanks(int number) throws IOException {
78 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
79
80 Pagoda.builder()
81 .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl"))
82 .data(Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl"))
83 .query(Paths.get(ontoDir, "uobm/queries/uobm_sygenia_all-blanks.sparql"))
84 .build()
85 .run();
86 }
87
88 @Test(groups = {"justExecute", "heavy", "nonOriginal", "existential"})
89 public void justExecute_modifiedUOBM() throws IOException {
90 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
91
92 Pagoda.builder()
93 .ontology(Paths.get(ontoDir, "uobm_modified/univ-bench-dl-modified.owl"))
94 .data(Paths.get(ontoDir, "uobm_modified/data/uobm1.ttl"))
95 .query(Paths.get(ontoDir, "uobm_modified/queries/additional_queries.sparql"))
96 .build()
97 .run();
98 }
99
100 @Test(groups = {"justExecute"})
101 public void justExecute_additionalQueries() throws IOException {
102 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
103
104 Pagoda.builder()
105 .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl"))
106 .data(Paths.get(ontoDir, "uobm/data/uobm1.ttl"))
107 .query(Paths.get(ontoDir, "uobm/queries/additional_queries.sparql"))
108 .build()
109 .run();
110 }
111
112 @Test(groups = {"justExecute", "UOBM50"})
113 public void justExecuteUOBM_50() throws IOException {
114 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
115 Pagoda.builder()
116 .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl"))
117 .data(Paths.get(ontoDir, "uobm/data/uobm50.ttl"))
118 .query(Paths.get(ontoDir, "uobm/queries/test.sparql"))
119 .build()
120 .run();
121 }
122}