aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRncLsn <rnc.lsn@gmail.com>2015-06-10 17:12:36 +0100
committerRncLsn <rnc.lsn@gmail.com>2015-06-10 17:12:36 +0100
commit3a276b7c7836e56a171ab753b018913ce022ba8e (patch)
treea6c25a1f68a5ff68e7b92d94f08aac19412c9b72
parent6e8ee40e41d84e0466153802a2c9b4ae88af3544 (diff)
downloadACQuA-3a276b7c7836e56a171ab753b018913ce022ba8e.tar.gz
ACQuA-3a276b7c7836e56a171ab753b018913ce022ba8e.zip
Small changes.
-rw-r--r--src/uk/ac/ox/cs/pagoda/reasoner/MyQueryReasoner.java2
-rw-r--r--test/resources/LightTests.xml4
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java177
-rw-r--r--test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java17
4 files changed, 108 insertions, 92 deletions
diff --git a/src/uk/ac/ox/cs/pagoda/reasoner/MyQueryReasoner.java b/src/uk/ac/ox/cs/pagoda/reasoner/MyQueryReasoner.java
index e689de6..93fbc98 100644
--- a/src/uk/ac/ox/cs/pagoda/reasoner/MyQueryReasoner.java
+++ b/src/uk/ac/ox/cs/pagoda/reasoner/MyQueryReasoner.java
@@ -370,7 +370,7 @@ class MyQueryReasoner extends QueryReasoner {
370 relevantStore.importDataFromABoxOf(relevantSubset); 370 relevantStore.importDataFromABoxOf(relevantSubset);
371 String relevantOriginalMarkProgram = OWLHelper.getOriginalMarkProgram(relevantSubset); 371 String relevantOriginalMarkProgram = OWLHelper.getOriginalMarkProgram(relevantSubset);
372 372
373 int queryDependentMaxTermDepth = 5; // TODO make it dynamic 373 int queryDependentMaxTermDepth = 10; // TODO make it dynamic
374 relevantStore.materialise("Mark original individuals", relevantOriginalMarkProgram); 374 relevantStore.materialise("Mark original individuals", relevantOriginalMarkProgram);
375 int materialisationTag = relevantStore.materialiseSkolemly(relevantProgram, null, 375 int materialisationTag = relevantStore.materialiseSkolemly(relevantProgram, null,
376 queryDependentMaxTermDepth); 376 queryDependentMaxTermDepth);
diff --git a/test/resources/LightTests.xml b/test/resources/LightTests.xml
index 8d9a700..2bc8dac 100644
--- a/test/resources/LightTests.xml
+++ b/test/resources/LightTests.xml
@@ -10,10 +10,10 @@
10 </run> 10 </run>
11 </groups> 11 </groups>
12 <classes> 12 <classes>
13 <!--<class name="uk.ac.ox.cs.pagoda.global_tests.TestPagodaUOBM"/>--> 13 <class name="uk.ac.ox.cs.pagoda.global_tests.TestPagodaUOBM"/>
14 <!--<class name="uk.ac.ox.cs.pagoda.global_tests.TestPagodaLUBM"/>--> 14 <!--<class name="uk.ac.ox.cs.pagoda.global_tests.TestPagodaLUBM"/>-->
15 <!--Fly does not terminate: query-5 looks really hard--> 15 <!--Fly does not terminate: query-5 looks really hard-->
16 <class name="uk.ac.ox.cs.pagoda.global_tests.TestPagodaFLY"/> 16 <!--<class name="uk.ac.ox.cs.pagoda.global_tests.TestPagodaFLY"/>-->
17 </classes> 17 </classes>
18 </test> 18 </test>
19</suite> \ No newline at end of file 19</suite> \ No newline at end of file
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 42827a0..a0ccb1a 100644
--- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java
+++ b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java
@@ -13,92 +13,93 @@ import java.nio.file.Paths;
13 13
14public class TestPagodaFLY { 14public class TestPagodaFLY {
15 15
16 // @Test(groups = {"light"}) 16 // @Test(groups = {"light"})
17 public void answersCorrectness_withGJFC() throws IOException { 17 public void answersCorrectness_withGJFC() throws IOException {
18 String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); 18 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
19 Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); 19 Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath());
20 new File(answers.toString()).deleteOnExit(); 20 new File(answers.toString()).deleteOnExit();
21 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");
22 22
23 Pagoda pagoda = Pagoda.builder() 23 Pagoda pagoda = Pagoda.builder()
24 .ontology(Paths.get(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl")) 24 .ontology(Paths.get(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl"))
25 .query(Paths.get(ontoDir, "fly/queries/fly.sparql")) 25 .query(Paths.get(ontoDir, "fly/queries/fly.sparql"))
26 .answer(answers) 26 .answer(answers)
27 .classify(false) 27 .classify(false)
28 .hermit(true) 28 .hermit(true)
29 .build(); 29 .build();
30 30
31 pagoda.run(); 31 pagoda.run();
32 CheckAnswers.assertSameAnswers(answers, givenAnswers); 32 CheckAnswers.assertSameAnswers(answers, givenAnswers);
33 } 33 }
34 34
35 @Test(groups = {"light"}) 35 @Test(groups = {"light"})
36 public void answersCorrectness_rolledUp() throws IOException { 36 public void answersCorrectness_rolledUp() throws IOException {
37 String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); 37 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
38 Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); 38 Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath());
39 new File(answers.toString()).deleteOnExit(); 39 new File(answers.toString()).deleteOnExit();
40 Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-fly-rolledup.json"); 40 Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-fly-rolledup.json");
41 41
42 Pagoda pagoda = Pagoda.builder() 42 Pagoda pagoda = Pagoda.builder()
43 .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl")) 43 .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl"))
44 .query(Paths.get(ontoDir, "fly/queries/fly_rolledUp.sparql")) 44 .query(Paths.get(ontoDir, "fly/queries/fly_rolledUp.sparql"))
45 .answer(answers) 45 .answer(answers)
46 .answer(Paths.get("/home/alessandro/Desktop/answers.json")) 46 .answer(Paths.get("/home/alessandro/Desktop/answers.json"))
47 .classify(false) 47 .classify(false)
48 .hermit(true) 48 .hermit(true)
49 .build(); 49 .build();
50 50
51 pagoda.run(); 51 pagoda.run();
52 CheckAnswers.assertSameAnswers(answers, givenAnswers); 52 CheckAnswers.assertSameAnswers(answers, givenAnswers);
53 } 53 }
54 54
55 @Test(groups = {"light", "justExecute"}) 55 @Test(groups = {"light", "justExecute"})
56 public void justExecute_newQueries() throws IOException { 56 public void justExecute_newQueries() throws IOException {
57 String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); 57 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
58 58
59 Pagoda pagoda = Pagoda.builder() 59 Pagoda.builder()
60 .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl")) 60 .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl"))
61// .ontology(Paths.get(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.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")) 62 .query(Paths.get(ontoDir, "fly/queries/new_queries.sparql"))
63// .answer(Paths.get("/home/alessandro/Desktop/answers.json")) 63// .answer(Paths.get("/home/alessandro/Desktop/answers.json"))
64 .classify(false) 64 .classify(false)
65 .hermit(true) 65 .hermit(true)
66 .skolem(false) 66 .skolem(true)
67 .build(); 67 .build()
68 68 .run();
69 pagoda.run(); 69 }
70 } 70
71 71 @Test(groups = {"light", "comparison"})
72 @Test(groups = {"light", "comparison"}) 72 public void compare_newQueries() throws IOException {
73 public void compare_newQueries() throws IOException { 73 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
74 String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); 74
75 75 Timer timer = new Timer();
76 Timer timer = new Timer(); 76 Pagoda.builder()
77 Pagoda.builder() 77 .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl"))
78 .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl")) 78 .query(Paths.get(ontoDir, "fly/queries/new_queries.sparql"))
79 .query(Paths.get(ontoDir, "fly/queries/new_queries.sparql")) 79 .classify(false)
80 .classify(false) 80 .hermit(true)
81 .hermit(true) 81 .skolem(true) // <----<< Skolem upper bound is ENABLED <<<
82 .skolem(true) // <----<< Skolem upper bound is ENABLED <<< 82 .build()
83 .build() 83 .run();
84 .run(); 84 double t1 = timer.duration();
85 double t1 = timer.duration(); 85
86 86 timer.reset();
87 timer.reset(); 87
88 88 Pagoda.builder()
89 Pagoda.builder() 89 .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl"))
90 .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl")) 90 .query(Paths.get(ontoDir, "fly/queries/new_queries.sparql"))
91 .query(Paths.get(ontoDir, "fly/queries/new_queries.sparql")) 91 .classify(false)
92 .classify(false) 92 .hermit(true)
93 .hermit(true) 93 .skolem(false) // <----<< Skolem upper bound is DISABLED <<<
94 .skolem(false) // <----<< Skolem upper bound is DISABLED <<< 94 .build()
95 .build() 95 .run();
96 .run(); 96 double t2 = timer.duration();
97 double t2 = timer.duration(); 97
98 98 if(t1 < t2)
99 if(t1 < t2) 99 TestUtil.logInfo(
100 TestUtil.logInfo("Overall reasoning with Skolem upper bound was " + (int) (t2 / t1 * 100 - 100) + "x faster!"); 100 "Overall reasoning with Skolem upper bound was " + (int) (t2 / t1 * 100 - 100) + "x faster!");
101 else 101 else
102 TestUtil.logInfo("Overall reasoning with Skolem upper bound was " + (int) (t1 / t2 * 100 - 100) + "x slower..."); 102 TestUtil.logInfo(
103 } 103 "Overall reasoning with Skolem upper bound was " + (int) (t1 / t2 * 100 - 100) + "x slower...");
104 }
104} 105}
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java
index bdfb818..1d9f1e6 100644
--- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java
+++ b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java
@@ -79,7 +79,7 @@ public class TestPagodaUOBM {
79 answersCorrectness_sygenia(1); 79 answersCorrectness_sygenia(1);
80 } 80 }
81 81
82 @Test(groups = {"heavy",}, dataProvider = "UOBMNumbers") 82 @Test(groups = {"heavy"}, dataProvider = "UOBMNumbers")
83 public void answersCorrectness_sygenia_allBlanks(int number) throws IOException { 83 public void answersCorrectness_sygenia_allBlanks(int number) throws IOException {
84 String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); 84 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
85// Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); 85// Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath());
@@ -99,4 +99,19 @@ public class TestPagodaUOBM {
99// CheckAnswers.assertSameAnswers(answers, givenAnswers); 99// CheckAnswers.assertSameAnswers(answers, givenAnswers);
100 } 100 }
101 101
102 @Test(groups = {"justExecute"})
103 public void justExecute_existentialQueries() throws IOException {
104 String ontoDir = TestUtil.getConfig().getProperty("ontoDir");
105
106 Pagoda.builder()
107 .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl"))
108 .data(Paths.get(ontoDir, "uobm/data/uobm1.ttl"))
109 .query(Paths.get(ontoDir, "uobm/queries/existential_queries.sparql"))
110// .answer(answers)
111 .classify(true)
112 .hermit(true)
113 .skolem(false)
114 .build()
115 .run();
116 }
102} 117}