diff options
| author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2022-05-10 18:17:06 +0100 |
|---|---|---|
| committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2022-05-11 12:34:47 +0100 |
| commit | 17bd9beaf7f358a44e5bf36a5855fe6727d506dc (patch) | |
| tree | 47e9310a0cff869d9ec017dcb2c81876407782c8 /test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java | |
| parent | 8651164cd632a5db310b457ce32d4fbc97bdc41c (diff) | |
| download | ACQuA-17bd9beaf7f358a44e5bf36a5855fe6727d506dc.tar.gz ACQuA-17bd9beaf7f358a44e5bf36a5855fe6727d506dc.zip | |
[pagoda] Move project to Scala
This commit includes a few changes:
- The repository still uses Maven to manage dependency but it is now a
Scala project.
- The code has been ported from OWLAPI 3.4.10 to 5.1.20
- A proof of concept program using both RSAComb and PAGOdA has been
added.
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.java | 107 |
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 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.global_tests; | ||
| 2 | |||
| 3 | import org.testng.annotations.Test; | ||
| 4 | import uk.ac.ox.cs.pagoda.Pagoda; | ||
| 5 | import uk.ac.ox.cs.pagoda.query.CheckAnswers; | ||
| 6 | import uk.ac.ox.cs.pagoda.util.PagodaProperties; | ||
| 7 | import uk.ac.ox.cs.pagoda.util.TestUtil; | ||
| 8 | import uk.ac.ox.cs.pagoda.util.Timer; | ||
| 9 | |||
| 10 | import java.io.File; | ||
| 11 | import java.io.IOException; | ||
| 12 | import java.nio.file.Path; | ||
| 13 | import java.nio.file.Paths; | ||
| 14 | |||
| 15 | public 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 | } | ||
