aboutsummaryrefslogtreecommitdiff
path: root/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java')
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java107
1 files changed, 0 insertions, 107 deletions
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java
deleted file mode 100644
index 3eb956f..0000000
--- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java
+++ /dev/null
@@ -1,107 +0,0 @@
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.query.CheckAnswers;
6import uk.ac.ox.cs.pagoda.util.PagodaProperties;
7import uk.ac.ox.cs.pagoda.util.TestUtil;
8import uk.ac.ox.cs.pagoda.util.Timer;
9
10import java.io.File;
11import java.io.IOException;
12import java.nio.file.Path;
13import java.nio.file.Paths;
14
15public class TestPagodaFLY {
16
17 // @Test(groups = {"light"})
18 public void answersCorrectness_withGJFC() throws IOException {
19 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
20 Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath());
21 new File(answers.toString()).deleteOnExit();
22 Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-fly-with-GJ-FC-individuals.json");
23
24 Pagoda pagoda = Pagoda.builder()
25 .ontology(Paths.get(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl"))
26 .query(Paths.get(ontoDir, "fly/queries/fly.sparql"))
27 .answer(answers)
28 .classify(false)
29 .build();
30
31 pagoda.run();
32 CheckAnswers.assertSameAnswers(answers, givenAnswers);
33 }
34
35 @Test(groups = {"light", "correctness"})
36 public void answersCorrectness_rolledUp() throws IOException {
37 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
38 Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath());
39 new File(answers.toString()).deleteOnExit();
40 Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-fly-rolledup.json");
41
42 Pagoda pagoda = Pagoda.builder()
43 .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl"))
44 .query(Paths.get(ontoDir, "fly/queries/fly_rolledUp.sparql"))
45 .answer(answers)
46// .answer(Paths.get("/home/alessandro/Desktop/answers.json"))
47 .classify(false)
48 .build();
49
50 pagoda.run();
51 CheckAnswers.assertSameAnswers(answers, givenAnswers);
52 }
53
54 @Test(groups = {"light", "justExecute", "nonOriginal", "existential"})
55 public void justExecute_newQueries() throws IOException {
56 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
57
58 Pagoda.builder()
59// .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl"))
60 .ontology(Paths.get(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl"))
61// .query(Paths.get(ontoDir, "fly/queries/fly_rolledUp.sparql"))
62// .query(Paths.get(ontoDir, "fly/queries/new_queries.sparql"))
63 .query("/home/alessandro/Desktop/query-8.sparql")
64// .answer(Paths.get("/home/alessandro/Desktop/answers.json"))
65 .classify(false)
66 .hermit(true)
67 .skolemDepth(3)
68 .skolem(PagodaProperties.SkolemUpperBoundOptions.BEFORE_SUMMARISATION)
69 .build()
70 .run();
71 }
72
73 @Test(groups = {"comparison"})
74 public void compare_newQueries() throws IOException {
75 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
76
77 Timer timer = new Timer();
78 Pagoda.builder()
79 .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl"))
80 .query(Paths.get(ontoDir, "fly/queries/new_queries.sparql"))
81 .classify(false)
82 .hermit(true)
83 .skolem(PagodaProperties.SkolemUpperBoundOptions.AFTER_SUMMARISATION) // <----<< Skolem upper bound is ENABLED <<<
84 .build()
85 .run();
86 double t1 = timer.duration();
87
88 timer.reset();
89
90 Pagoda.builder()
91 .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl"))
92 .query(Paths.get(ontoDir, "fly/queries/new_queries.sparql"))
93 .classify(false)
94 .hermit(true)
95 .skolem(PagodaProperties.SkolemUpperBoundOptions.DISABLED) // <----<< Skolem upper bound is DISABLED <<<
96 .build()
97 .run();
98 double t2 = timer.duration();
99
100 if(t1 < t2)
101 TestUtil.logInfo(
102 "Overall reasoning with Skolem upper bound was " + (int) (t2 / t1 * 100 - 100) + "x faster!");
103 else
104 TestUtil.logInfo(
105 "Overall reasoning with Skolem upper bound was " + (int) (t1 / t2 * 100 - 100) + "x slower...");
106 }
107}