diff options
| author | RncLsn <rnc.lsn@gmail.com> | 2015-06-09 18:23:15 +0100 |
|---|---|---|
| committer | RncLsn <rnc.lsn@gmail.com> | 2015-06-09 18:23:15 +0100 |
| commit | 6e8ee40e41d84e0466153802a2c9b4ae88af3544 (patch) | |
| tree | 74d5d4fa04f2c8339433fffd6ababc2b21afc2e1 /test/uk/ac/ox/cs/pagoda/global_tests | |
| parent | dcdf7f8062919e5746b0b15c77ba8279d5f526c1 (diff) | |
| download | ACQuA-6e8ee40e41d84e0466153802a2c9b4ae88af3544.tar.gz ACQuA-6e8ee40e41d84e0466153802a2c9b4ae88af3544.zip | |
Fixed marking original individuals in the relevant upper store.
Diffstat (limited to 'test/uk/ac/ox/cs/pagoda/global_tests')
| -rw-r--r-- | test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java | 60 |
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; | |||
| 4 | import uk.ac.ox.cs.pagoda.Pagoda; | 4 | import uk.ac.ox.cs.pagoda.Pagoda; |
| 5 | import uk.ac.ox.cs.pagoda.query.CheckAnswers; | 5 | import uk.ac.ox.cs.pagoda.query.CheckAnswers; |
| 6 | import uk.ac.ox.cs.pagoda.util.TestUtil; | 6 | import uk.ac.ox.cs.pagoda.util.TestUtil; |
| 7 | import uk.ac.ox.cs.pagoda.util.Timer; | ||
| 7 | 8 | ||
| 8 | import java.io.File; | 9 | import java.io.File; |
| 9 | import java.io.IOException; | 10 | import 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 | } |
