aboutsummaryrefslogtreecommitdiff
path: root/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java')
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java39
1 files changed, 8 insertions, 31 deletions
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java
index 8cbe022..d261d84 100644
--- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java
+++ b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java
@@ -11,50 +11,27 @@ import java.nio.file.Paths;
11 11
12public class TestPagodaLUBM { 12public class TestPagodaLUBM {
13 13
14 /** 14 public void answersCorrectness(int number) throws IOException {
15 * Just execute on LUBM 100
16 */
17 public static void main(String... args) {
18 new TestPagodaLUBM().justExecute_100();
19 }
20
21 public void answersCorrecntess(int number) throws IOException {
22 String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); 15 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
23 Path computedAnswers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); 16 Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath());
24 new File(computedAnswers.toString()).deleteOnExit(); 17 new File(answers.toString()).deleteOnExit();
18 Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-lubm" + number + ".json");
25 19
26 Pagoda pagoda = Pagoda.builder() 20 Pagoda pagoda = Pagoda.builder()
27 .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl")) 21 .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl"))
28 .data(Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl")) 22 .data(Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl"))
29 .query(Paths.get(ontoDir, "lubm/queries/test.sparql")) 23 .query(Paths.get(ontoDir, "lubm/queries/test.sparql"))
30 .answer(computedAnswers) 24 .answer(answers)
31 .classify(true) 25 .classify(true)
32 .hermit(true) 26 .hermit(true)
33 .build(); 27 .build();
34 pagoda.run();
35 28
36 Path givenAnswers = Paths.get(ontoDir, "lubm/lubm" + number + ".json"); 29 pagoda.run();
37 CheckAnswers.assertSameAnswers(computedAnswers, givenAnswers); 30 CheckAnswers.assertSameAnswers(answers, givenAnswers);
38 } 31 }
39 32
40 @Test(groups = {"light"}) 33 @Test(groups = {"light"})
41 public void answersCorrectness_1() throws IOException { 34 public void answersCorrectness_1() throws IOException {
42 answersCorrecntess(1); 35 answersCorrectness(1);
43 }
44
45 /**
46 * Just execute on LUBM 100
47 * */
48 public void justExecute_100() {
49 int number = 100;
50 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
51 Pagoda pagoda = Pagoda.builder()
52 .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl"))
53 .data(Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl"))
54 .query(Paths.get(ontoDir, "lubm/queries/answersCorrectness.sparql"))
55 .classify(true)
56 .hermit(true)
57 .build();
58 pagoda.run();
59 } 36 }
60} 37}