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