diff options
| author | RncLsn <rnc.lsn@gmail.com> | 2015-05-19 13:35:52 +0100 |
|---|---|---|
| committer | RncLsn <rnc.lsn@gmail.com> | 2015-05-19 13:35:52 +0100 |
| commit | 5d54af2638a53721b414a41356a93686a9616272 (patch) | |
| tree | e28c64b1887e7e964661d12d96df5b09abd4d9ee /test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java | |
| parent | c7dbc7c61c7094ea4ec49bd630023f23b92fd9d1 (diff) | |
| download | ACQuA-5d54af2638a53721b414a41356a93686a9616272.tar.gz ACQuA-5d54af2638a53721b414a41356a93686a9616272.zip | |
Backup before changes in MyQueryReasoner.
Diffstat (limited to 'test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java')
| -rw-r--r-- | test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java index bb58681..8cbe022 100644 --- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java +++ b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java | |||
| @@ -4,42 +4,57 @@ 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.util.TestUtil; | 5 | import uk.ac.ox.cs.pagoda.util.TestUtil; |
| 6 | 6 | ||
| 7 | import java.io.File; | ||
| 7 | import java.io.IOException; | 8 | import java.io.IOException; |
| 9 | import java.nio.file.Path; | ||
| 8 | import java.nio.file.Paths; | 10 | import java.nio.file.Paths; |
| 9 | 11 | ||
| 10 | public class TestPagodaLUBM { | 12 | public class TestPagodaLUBM { |
| 11 | 13 | ||
| 12 | public void test(int number) throws IOException { | 14 | /** |
| 15 | * Just execute on LUBM 100 | ||
| 16 | */ | ||
| 17 | public static void main(String... args) { | ||
| 18 | new TestPagodaLUBM().justExecute_100(); | ||
| 19 | } | ||
| 20 | |||
| 21 | public void answersCorrecntess(int number) throws IOException { | ||
| 13 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | 22 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); |
| 23 | Path computedAnswers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); | ||
| 24 | new File(computedAnswers.toString()).deleteOnExit(); | ||
| 25 | |||
| 14 | Pagoda pagoda = Pagoda.builder() | 26 | Pagoda pagoda = Pagoda.builder() |
| 15 | .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl")) | 27 | .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl")) |
| 16 | .data(Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl")) | 28 | .data(Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl")) |
| 17 | .query(Paths.get(ontoDir, "lubm/queries/test.sparql")) | 29 | .query(Paths.get(ontoDir, "lubm/queries/test.sparql")) |
| 30 | .answer(computedAnswers) | ||
| 18 | .classify(true) | 31 | .classify(true) |
| 19 | .hermit(true) | 32 | .hermit(true) |
| 20 | .build(); | 33 | .build(); |
| 21 | CheckAnswersOverDataset.check(pagoda, Paths.get(ontoDir, "lubm/lubm" + number + ".json")); | 34 | pagoda.run(); |
| 35 | |||
| 36 | Path givenAnswers = Paths.get(ontoDir, "lubm/lubm" + number + ".json"); | ||
| 37 | CheckAnswers.assertSameAnswers(computedAnswers, givenAnswers); | ||
| 22 | } | 38 | } |
| 23 | 39 | ||
| 24 | @Test | 40 | @Test(groups = {"light"}) |
| 25 | public void test_1() throws IOException { | 41 | public void answersCorrectness_1() throws IOException { |
| 26 | test(1); | 42 | answersCorrecntess(1); |
| 27 | } | 43 | } |
| 28 | 44 | ||
| 45 | /** | ||
| 46 | * Just execute on LUBM 100 | ||
| 47 | * */ | ||
| 29 | public void justExecute_100() { | 48 | public void justExecute_100() { |
| 30 | int number = 100; | 49 | int number = 100; |
| 31 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | 50 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); |
| 32 | Pagoda pagoda = Pagoda.builder() | 51 | Pagoda pagoda = Pagoda.builder() |
| 33 | .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl")) | 52 | .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl")) |
| 34 | .data(Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl")) | 53 | .data(Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl")) |
| 35 | .query(Paths.get(ontoDir, "lubm/queries/test.sparql")) | 54 | .query(Paths.get(ontoDir, "lubm/queries/answersCorrectness.sparql")) |
| 36 | .classify(true) | 55 | .classify(true) |
| 37 | .hermit(true) | 56 | .hermit(true) |
| 38 | .build(); | 57 | .build(); |
| 39 | pagoda.run(); | 58 | pagoda.run(); |
| 40 | } | 59 | } |
| 41 | |||
| 42 | public static void main(String... args) { | ||
| 43 | new TestPagodaLUBM().justExecute_100(); | ||
| 44 | } | ||
| 45 | } | 60 | } |
