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.java60
1 files changed, 56 insertions, 4 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
index 4fdccf8..42827a0 100644
--- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java
+++ b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java
@@ -4,6 +4,7 @@ import org.testng.annotations.Test;
4import uk.ac.ox.cs.pagoda.Pagoda; 4import uk.ac.ox.cs.pagoda.Pagoda;
5import uk.ac.ox.cs.pagoda.query.CheckAnswers; 5import uk.ac.ox.cs.pagoda.query.CheckAnswers;
6import uk.ac.ox.cs.pagoda.util.TestUtil; 6import uk.ac.ox.cs.pagoda.util.TestUtil;
7import uk.ac.ox.cs.pagoda.util.Timer;
7 8
8import java.io.File; 9import java.io.File;
9import java.io.IOException; 10import java.io.IOException;
@@ -20,8 +21,8 @@ public class TestPagodaFLY {
20 Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-fly-with-GJ-FC-individuals.json"); 21 Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-fly-with-GJ-FC-individuals.json");
21 22
22 Pagoda pagoda = Pagoda.builder() 23 Pagoda pagoda = Pagoda.builder()
23 .ontology(TestUtil.combinePaths(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl")) 24 .ontology(Paths.get(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl"))
24 .query(TestUtil.combinePaths(ontoDir, "fly/queries/fly.sparql")) 25 .query(Paths.get(ontoDir, "fly/queries/fly.sparql"))
25 .answer(answers) 26 .answer(answers)
26 .classify(false) 27 .classify(false)
27 .hermit(true) 28 .hermit(true)
@@ -39,9 +40,10 @@ public class TestPagodaFLY {
39 Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-fly-rolledup.json"); 40 Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-fly-rolledup.json");
40 41
41 Pagoda pagoda = Pagoda.builder() 42 Pagoda pagoda = Pagoda.builder()
42 .ontology(TestUtil.combinePaths(ontoDir, "fly/fly_rolledUp.owl")) 43 .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl"))
43 .query(TestUtil.combinePaths(ontoDir, "fly/queries/fly_rolledUp.sparql")) 44 .query(Paths.get(ontoDir, "fly/queries/fly_rolledUp.sparql"))
44 .answer(answers) 45 .answer(answers)
46 .answer(Paths.get("/home/alessandro/Desktop/answers.json"))
45 .classify(false) 47 .classify(false)
46 .hermit(true) 48 .hermit(true)
47 .build(); 49 .build();
@@ -49,4 +51,54 @@ public class TestPagodaFLY {
49 pagoda.run(); 51 pagoda.run();
50 CheckAnswers.assertSameAnswers(answers, givenAnswers); 52 CheckAnswers.assertSameAnswers(answers, givenAnswers);
51 } 53 }
54
55 @Test(groups = {"light", "justExecute"})
56 public void justExecute_newQueries() throws IOException {
57 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
58
59 Pagoda pagoda = Pagoda.builder()
60 .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl"))
61// .ontology(Paths.get(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl"))
62 .query(Paths.get(ontoDir, "fly/queries/new_queries.sparql"))
63// .answer(Paths.get("/home/alessandro/Desktop/answers.json"))
64 .classify(false)
65 .hermit(true)
66 .skolem(false)
67 .build();
68
69 pagoda.run();
70 }
71
72 @Test(groups = {"light", "comparison"})
73 public void compare_newQueries() throws IOException {
74 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
75
76 Timer timer = new Timer();
77 Pagoda.builder()
78 .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl"))
79 .query(Paths.get(ontoDir, "fly/queries/new_queries.sparql"))
80 .classify(false)
81 .hermit(true)
82 .skolem(true) // <----<< Skolem upper bound is ENABLED <<<
83 .build()
84 .run();
85 double t1 = timer.duration();
86
87 timer.reset();
88
89 Pagoda.builder()
90 .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl"))
91 .query(Paths.get(ontoDir, "fly/queries/new_queries.sparql"))
92 .classify(false)
93 .hermit(true)
94 .skolem(false) // <----<< Skolem upper bound is DISABLED <<<
95 .build()
96 .run();
97 double t2 = timer.duration();
98
99 if(t1 < t2)
100 TestUtil.logInfo("Overall reasoning with Skolem upper bound was " + (int) (t2 / t1 * 100 - 100) + "x faster!");
101 else
102 TestUtil.logInfo("Overall reasoning with Skolem upper bound was " + (int) (t1 / t2 * 100 - 100) + "x slower...");
103 }
52} 104}