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/TestPagodaUOBM.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/TestPagodaUOBM.java')
| -rw-r--r-- | test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java | 122 |
1 files changed, 0 insertions, 122 deletions
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java deleted file mode 100644 index 4dae223..0000000 --- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java +++ /dev/null | |||
| @@ -1,122 +0,0 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.global_tests; | ||
| 2 | |||
| 3 | import org.testng.annotations.DataProvider; | ||
| 4 | import org.testng.annotations.Test; | ||
| 5 | import uk.ac.ox.cs.pagoda.Pagoda; | ||
| 6 | import uk.ac.ox.cs.pagoda.query.CheckAnswers; | ||
| 7 | import uk.ac.ox.cs.pagoda.util.TestUtil; | ||
| 8 | |||
| 9 | import java.io.File; | ||
| 10 | import java.io.IOException; | ||
| 11 | import java.nio.file.Path; | ||
| 12 | import java.nio.file.Paths; | ||
| 13 | |||
| 14 | public class TestPagodaUOBM { | ||
| 15 | |||
| 16 | private static final int N_1 = 1; | ||
| 17 | private static final int N_2 = 4; | ||
| 18 | |||
| 19 | @DataProvider(name = "UOBMNumbers") | ||
| 20 | private static Object[][] UOBMNumbers() { | ||
| 21 | Integer[][] integers = new Integer[N_2 - N_1 + 1][1]; | ||
| 22 | for(int i = 0; i < N_2 - N_1 + 1; i++) | ||
| 23 | integers[i][0] = N_1 + i; | ||
| 24 | return integers; | ||
| 25 | } | ||
| 26 | |||
| 27 | @Test(groups = {"light", "correctness"}) | ||
| 28 | public void answersCorrectness_1() throws IOException { | ||
| 29 | answersCorrectness(1); | ||
| 30 | } | ||
| 31 | |||
| 32 | @Test(groups = {"heavy", "correctness"}, dataProvider = "UOBMNumbers") | ||
| 33 | public void answersCorrectness(int number) throws IOException { | ||
| 34 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 35 | Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); | ||
| 36 | new File(answers.toString()).deleteOnExit(); | ||
| 37 | Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-uobm" + number + ".json"); | ||
| 38 | |||
| 39 | Pagoda pagoda = Pagoda.builder() | ||
| 40 | .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl")) | ||
| 41 | .data(Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl")) | ||
| 42 | .query(Paths.get(ontoDir, "uobm/queries/test.sparql")) | ||
| 43 | .answer(answers) | ||
| 44 | .build(); | ||
| 45 | |||
| 46 | pagoda.run(); | ||
| 47 | CheckAnswers.assertSameAnswers(answers, givenAnswers); | ||
| 48 | } | ||
| 49 | |||
| 50 | @Test(groups = {"sygenia"}) | ||
| 51 | public void answersCorrectness_sygenia_1() throws IOException { | ||
| 52 | answersCorrectness_sygenia(1); | ||
| 53 | } | ||
| 54 | |||
| 55 | @Test(groups = {"heavy",}, dataProvider = "UOBMNumbers") | ||
| 56 | public void answersCorrectness_sygenia(int number) throws IOException { | ||
| 57 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 58 | // Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); | ||
| 59 | // new File(answers.toString()).deleteOnExit(); | ||
| 60 | // Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-uobm" + number + ".json"); | ||
| 61 | |||
| 62 | Pagoda pagoda = Pagoda.builder() | ||
| 63 | .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl")) | ||
| 64 | .data(Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl")) | ||
| 65 | .query(Paths.get(ontoDir, "uobm/queries/uobm_sygenia.sparql")) | ||
| 66 | .build(); | ||
| 67 | |||
| 68 | pagoda.run(); | ||
| 69 | } | ||
| 70 | |||
| 71 | @Test(groups = {"sygenia"}) | ||
| 72 | public void answersCorrectness_sygenia_allBlanks_1() throws IOException { | ||
| 73 | answersCorrectness_sygenia(1); | ||
| 74 | } | ||
| 75 | |||
| 76 | @Test(groups = {"heavy"}, dataProvider = "UOBMNumbers") | ||
| 77 | public void answersCorrectness_sygenia_allBlanks(int number) throws IOException { | ||
| 78 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 79 | |||
| 80 | Pagoda.builder() | ||
| 81 | .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl")) | ||
| 82 | .data(Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl")) | ||
| 83 | .query(Paths.get(ontoDir, "uobm/queries/uobm_sygenia_all-blanks.sparql")) | ||
| 84 | .build() | ||
| 85 | .run(); | ||
| 86 | } | ||
| 87 | |||
| 88 | @Test(groups = {"justExecute", "heavy", "nonOriginal", "existential"}) | ||
| 89 | public void justExecute_modifiedUOBM() throws IOException { | ||
| 90 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 91 | |||
| 92 | Pagoda.builder() | ||
| 93 | .ontology(Paths.get(ontoDir, "uobm_modified/univ-bench-dl-modified.owl")) | ||
| 94 | .data(Paths.get(ontoDir, "uobm_modified/data/uobm1.ttl")) | ||
| 95 | .query(Paths.get(ontoDir, "uobm_modified/queries/additional_queries.sparql")) | ||
| 96 | .build() | ||
| 97 | .run(); | ||
| 98 | } | ||
| 99 | |||
| 100 | @Test(groups = {"justExecute"}) | ||
| 101 | public void justExecute_additionalQueries() throws IOException { | ||
| 102 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 103 | |||
| 104 | Pagoda.builder() | ||
| 105 | .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl")) | ||
| 106 | .data(Paths.get(ontoDir, "uobm/data/uobm1.ttl")) | ||
| 107 | .query(Paths.get(ontoDir, "uobm/queries/additional_queries.sparql")) | ||
| 108 | .build() | ||
| 109 | .run(); | ||
| 110 | } | ||
| 111 | |||
| 112 | @Test(groups = {"justExecute", "UOBM50"}) | ||
| 113 | public void justExecuteUOBM_50() throws IOException { | ||
| 114 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 115 | Pagoda.builder() | ||
| 116 | .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl")) | ||
| 117 | .data(Paths.get(ontoDir, "uobm/data/uobm50.ttl")) | ||
| 118 | .query(Paths.get(ontoDir, "uobm/queries/test.sparql")) | ||
| 119 | .build() | ||
| 120 | .run(); | ||
| 121 | } | ||
| 122 | } | ||
