diff options
Diffstat (limited to 'test/uk/ac/ox/cs/pagoda/global_tests/CostEvaluation.java')
| -rw-r--r-- | test/uk/ac/ox/cs/pagoda/global_tests/CostEvaluation.java | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/CostEvaluation.java b/test/uk/ac/ox/cs/pagoda/global_tests/CostEvaluation.java new file mode 100644 index 0000000..01e8203 --- /dev/null +++ b/test/uk/ac/ox/cs/pagoda/global_tests/CostEvaluation.java | |||
| @@ -0,0 +1,115 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.global_tests; | ||
| 2 | |||
| 3 | import org.semanticweb.owlapi.model.OWLOntology; | ||
| 4 | import org.testng.annotations.Test; | ||
| 5 | import uk.ac.ox.cs.pagoda.owl.OWLHelper; | ||
| 6 | import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner; | ||
| 7 | import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner.Type; | ||
| 8 | import uk.ac.ox.cs.pagoda.tester.PagodaTester; | ||
| 9 | import uk.ac.ox.cs.pagoda.util.TestUtil; | ||
| 10 | import uk.ac.ox.cs.pagoda.util.Timer; | ||
| 11 | import uk.ac.ox.cs.pagoda.util.Utility; | ||
| 12 | |||
| 13 | public class CostEvaluation { | ||
| 14 | |||
| 15 | @Test | ||
| 16 | public void lubm100() { | ||
| 17 | int number = 1; | ||
| 18 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 19 | PagodaTester.main( | ||
| 20 | TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"), | ||
| 21 | TestUtil.combinePaths(ontoDir, "lubm/data/lubm" + number + ".ttl"), | ||
| 22 | TestUtil.combinePaths(ontoDir, "lubm/queries/test_all_pagoda.sparql") | ||
| 23 | ); | ||
| 24 | // AllTests.copy("output/log4j.log", "results-backup/jair/lubm" + number + ".out"); | ||
| 25 | } | ||
| 26 | |||
| 27 | public void lubm1000() { | ||
| 28 | int number = 1000; | ||
| 29 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 30 | String[] args = new String[] { | ||
| 31 | TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"), | ||
| 32 | TestUtil.combinePaths(ontoDir, "lubm/data/lubm" + number + ".ttl"), | ||
| 33 | TestUtil.combinePaths(ontoDir, "lubm/queries/test_all_pagoda.sparql") | ||
| 34 | }; | ||
| 35 | OWLOntology ontology = OWLHelper.loadOntology(args[0]); | ||
| 36 | QueryReasoner reasoner = QueryReasoner.getInstance(Type.ELHOU, ontology, true, true); | ||
| 37 | Timer t = new Timer(); | ||
| 38 | reasoner.loadOntology(ontology); | ||
| 39 | reasoner.importData(args[1]); | ||
| 40 | if (!reasoner.preprocess()) | ||
| 41 | return ; | ||
| 42 | Utility.logInfo("Preprocessing Done in " + t.duration() + " seconds."); | ||
| 43 | |||
| 44 | reasoner.evaluate(reasoner.getQueryManager().collectQueryRecords(args[2])); | ||
| 45 | // AllTests.copy("output/log4j.log", "results-backup/jair/lubm" + number + ".out"); | ||
| 46 | } | ||
| 47 | |||
| 48 | @Test | ||
| 49 | public void uobm5() { | ||
| 50 | int number = 1; | ||
| 51 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 52 | String[] args = new String[] { | ||
| 53 | TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"), | ||
| 54 | TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"), | ||
| 55 | TestUtil.combinePaths(ontoDir, "uobm/queries/standard_all_pagoda.sparql") | ||
| 56 | }; | ||
| 57 | PagodaTester.main(args); | ||
| 58 | // AllTests.copy("output/log4j.log", "results-backup/jair/uobm" + number + ".out"); | ||
| 59 | } | ||
| 60 | |||
| 61 | public void uobm100() { | ||
| 62 | int number = 200; | ||
| 63 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 64 | String[] args = new String[] { | ||
| 65 | TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"), | ||
| 66 | TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"), | ||
| 67 | TestUtil.combinePaths(ontoDir, "uobm/queries/standard_group3_all.sparql") | ||
| 68 | }; | ||
| 69 | PagodaTester.main(args); | ||
| 70 | // AllTests.copy("output/log4j.log", "results-backup/jair/uobm" + number + ".out"); | ||
| 71 | } | ||
| 72 | |||
| 73 | public void uobm500() { | ||
| 74 | int number = 500; | ||
| 75 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 76 | String[] args = new String[] { | ||
| 77 | TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"), | ||
| 78 | TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"), | ||
| 79 | TestUtil.combinePaths(ontoDir, "uobm/queries/standard_all_pagoda.sparql") | ||
| 80 | }; | ||
| 81 | |||
| 82 | OWLOntology ontology = OWLHelper.loadOntology(args[0]); | ||
| 83 | QueryReasoner reasoner = QueryReasoner.getInstance(Type.ELHOU, ontology, true, true); | ||
| 84 | Timer t = new Timer(); | ||
| 85 | reasoner.loadOntology(ontology); | ||
| 86 | reasoner.importData(args[1]); | ||
| 87 | if (!reasoner.preprocess()) | ||
| 88 | return ; | ||
| 89 | Utility.logInfo("Preprocessing Done in " + t.duration() + " seconds."); | ||
| 90 | |||
| 91 | reasoner.evaluate(reasoner.getQueryManager().collectQueryRecords(args[2])); | ||
| 92 | // AllTests.copy("output/log4j.log", "results-backup/jair/uobm" + number + ".out"); | ||
| 93 | } | ||
| 94 | |||
| 95 | |||
| 96 | public static void main(String... args) { | ||
| 97 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 98 | args = new String[] { | ||
| 99 | TestUtil.combinePaths(ontoDir, "dbpedia/integratedOntology-all-in-one-minus-datatype.owl"), | ||
| 100 | TestUtil.combinePaths(ontoDir, "dbpedia/data/dbpedia-minus-datatype-new.ttl"), | ||
| 101 | TestUtil.combinePaths(ontoDir, "dbpedia/queries/atomic_ground.sparql") | ||
| 102 | }; | ||
| 103 | |||
| 104 | OWLOntology ontology = OWLHelper.loadOntology(args[0]); | ||
| 105 | QueryReasoner reasoner = QueryReasoner.getInstance(Type.ELHOU, ontology, true, true); | ||
| 106 | Timer t = new Timer(); | ||
| 107 | reasoner.loadOntology(ontology); | ||
| 108 | reasoner.importData(args[1]); | ||
| 109 | if (!reasoner.preprocess()) | ||
| 110 | return ; | ||
| 111 | Utility.logInfo("Preprocessing Done in " + t.duration() + " seconds."); | ||
| 112 | |||
| 113 | reasoner.evaluate(reasoner.getQueryManager().collectQueryRecords(args[2])); | ||
| 114 | } | ||
| 115 | } | ||
