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 /src/test/java/uk/ac/ox/cs/hermit | |
| 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 'src/test/java/uk/ac/ox/cs/hermit')
| -rw-r--r-- | src/test/java/uk/ac/ox/cs/hermit/HermitQueryReasoner.java | 200 | ||||
| -rw-r--r-- | src/test/java/uk/ac/ox/cs/hermit/HermitTester.java | 55 | ||||
| -rw-r--r-- | src/test/java/uk/ac/ox/cs/hermit/JAIR_HermiT.java | 129 |
3 files changed, 384 insertions, 0 deletions
diff --git a/src/test/java/uk/ac/ox/cs/hermit/HermitQueryReasoner.java b/src/test/java/uk/ac/ox/cs/hermit/HermitQueryReasoner.java new file mode 100644 index 0000000..957790f --- /dev/null +++ b/src/test/java/uk/ac/ox/cs/hermit/HermitQueryReasoner.java | |||
| @@ -0,0 +1,200 @@ | |||
| 1 | package uk.ac.ox.cs.hermit; | ||
| 2 | |||
| 3 | import org.semanticweb.HermiT.Reasoner; | ||
| 4 | import org.semanticweb.HermiT.model.Atom; | ||
| 5 | import org.semanticweb.HermiT.model.AtomicRole; | ||
| 6 | import org.semanticweb.owlapi.model.*; | ||
| 7 | import org.semanticweb.owlapi.model.parameters.Imports; | ||
| 8 | import org.semanticweb.owlapi.reasoner.Node; | ||
| 9 | import uk.ac.ox.cs.pagoda.owl.OWLHelper; | ||
| 10 | import uk.ac.ox.cs.pagoda.owl.QueryRoller; | ||
| 11 | import uk.ac.ox.cs.pagoda.query.QueryManager; | ||
| 12 | import uk.ac.ox.cs.pagoda.query.QueryRecord; | ||
| 13 | import uk.ac.ox.cs.pagoda.util.Timer; | ||
| 14 | |||
| 15 | import java.io.*; | ||
| 16 | import java.util.HashSet; | ||
| 17 | import java.util.Set; | ||
| 18 | import java.util.concurrent.*; | ||
| 19 | |||
| 20 | public class HermitQueryReasoner { | ||
| 21 | |||
| 22 | public static void main(String... args) throws FileNotFoundException, OWLOntologyCreationException, OWLOntologyStorageException { | ||
| 23 | if (args.length == 0) { | ||
| 24 | // args = new String[] {"/media/krr-nas-share/Yujiao/ontologies/lubm/lubm1_merged.owl", null, PagodaTester.lubm_query}; | ||
| 25 | // args = new String[] {"/users/yzhou/ontologies/uobm/uobm1_merged.owl", null, "/users/yzhou/ontologies/uobm/queries/standard.sparql"}; | ||
| 26 | // args = new String[] {"/users/yzhou/ontologies/fly/fly_anatomy_XP_with_GJ_FC_individuals.owl", null, "/users/yzhou/ontologies/fly/queries/fly.sparql"}; | ||
| 27 | // args = new String[] {"/media/krr-nas-share/Yujiao/ontologies/npd/npd-all-minus-datatype.owl", "/media/krr-nas-share/Yujiao/ontologies/npd/data/npd-data-dump-minus-datatype-new.ttl", "/users/yzhou/ontologies/npd/queries/atomic.sparql"}; | ||
| 28 | // args = new String[] {"/media/krr-nas-share/Yujiao/ontologies/npd/npd-all.owl", "/media/krr-nas-share/Yujiao/ontologies/npd/data/npd-data-dump-processed.ttl", "/users/yzhou/ontologies/npd/queries/atomic.sparql"}; | ||
| 29 | // args = new String[] {PagodaTester.dbpedia_tbox, PagodaTester.dbpedia_abox, PagodaTester.dbpedia_query}; | ||
| 30 | // args = new String[] {"/users/yzhou/ontologies/answersCorrectness/unsatisfiable.owl", null, "/users/yzhou/ontologies/answersCorrectness/unsatisfiable_queries.sparql"}; | ||
| 31 | |||
| 32 | // args = new String[] {"/media/krr-nas-share/Yujiao/ontologies/bio2rdf/chembl/cco-processed-noDPR-noDPD.ttl", "/media/krr-nas-share/Yujiao/ontologies/bio2rdf/chembl/graph sampling/sample_100.nt", "/media/krr-nas-share/Yujiao/ontologies/bio2rdf/chembl/queries/atomic_one_filtered.sparql", "../answersCorrectness-share/results/chembl/hermit_1p"}; | ||
| 33 | args = | ||
| 34 | new String[]{"/users/yzhou/temp/uniprot_debug/core-processed-noDis.owl", "/users/yzhou/temp/uniprot_debug/sample_1_removed.nt", "/media/krr-nas-share/Yujiao/ontologies/bio2rdf/uniprot/queries/atomic_one.sparql", "../answersCorrectness-share/results/uniprot/hermit_1p"}; | ||
| 35 | } | ||
| 36 | // args = new String[] {"imported.owl", "", "/media/krr-nas-share/Yujiao/ontologies/bio2rdf/uniprot/queries/atomic_one.sparql", "../answersCorrectness-share/results/uniprot/hermit_1p"}; } | ||
| 37 | |||
| 38 | |||
| 39 | PrintStream ps = args.length < 4 ? null : new PrintStream(new File(args[3])); | ||
| 40 | for (int i = 0; i < args.length; ++i) { | ||
| 41 | if (args[i] == null || args[i].equalsIgnoreCase("null")) args[i] = ""; | ||
| 42 | System.out.println("Argument " + i + ": " + args[i]); | ||
| 43 | } | ||
| 44 | |||
| 45 | // PrintStream ps = null; // new PrintStream(new File("../answersCorrectness-share/results/reactome/ ")); | ||
| 46 | if (ps != null) System.setOut(ps); | ||
| 47 | |||
| 48 | Timer t = new Timer(); | ||
| 49 | OWLOntology onto = OWLHelper.loadOntology(args[0]); | ||
| 50 | OWLOntologyManager man = onto.getOWLOntologyManager(); | ||
| 51 | |||
| 52 | OWLDatatype date = man.getOWLDataFactory().getOWLDatatype(IRI.create("http://www.w3.org/2001/XMLSchema#date")); | ||
| 53 | |||
| 54 | if (onto.containsEntityInSignature(date)) { | ||
| 55 | for (OWLOntology o: onto.getImportsClosure()) | ||
| 56 | for (OWLAxiom axiom: o.getAxioms()) | ||
| 57 | if (axiom.getDatatypesInSignature().contains(date)) { | ||
| 58 | System.out.println("The axiom: " + axiom + " is being ingored. "); | ||
| 59 | man.removeAxiom(onto, axiom); | ||
| 60 | } | ||
| 61 | man.saveOntology(onto, new FileOutputStream(args[0] = "tbox_hermit.owl")); | ||
| 62 | man.removeOntology(onto); | ||
| 63 | onto = OWLHelper.loadOntology(man, args[0]); | ||
| 64 | System.out.println("TBox processed in " + t.duration()); | ||
| 65 | } | ||
| 66 | |||
| 67 | try { | ||
| 68 | onto = OWLHelper.getImportedOntology(onto, args[1]); | ||
| 69 | } catch (IOException e) { | ||
| 70 | e.printStackTrace(); | ||
| 71 | } | ||
| 72 | System.out.println("Ontology loaded in " + t.duration()); | ||
| 73 | System.out.println("ABox axioms:" + onto.getABoxAxioms(Imports.INCLUDED).size()); | ||
| 74 | // for (OWLOntology o: onto.getImportsClosure()) | ||
| 75 | // for (OWLAxiom axiom: o.getAxioms()) | ||
| 76 | // System.out.println(axiom); | ||
| 77 | |||
| 78 | Reasoner hermit = new Reasoner(onto); | ||
| 79 | if (!hermit.isConsistent()) { | ||
| 80 | System.out.println("The ontology is inconsistent."); | ||
| 81 | return ; | ||
| 82 | } | ||
| 83 | System.out.println("Preprocessing DONE in " + t.duration()); | ||
| 84 | |||
| 85 | // System.out.println(hermit.isConsistent()); | ||
| 86 | |||
| 87 | QueryManager queryManager = new QueryManager(); | ||
| 88 | QueryRoller roller = new QueryRoller(onto.getOWLOntologyManager().getOWLDataFactory()); | ||
| 89 | int failedCounter = 0; | ||
| 90 | Timer total = new Timer(); | ||
| 91 | for (QueryRecord record: queryManager.collectQueryRecords(args[2])) { | ||
| 92 | if (Integer.parseInt(record.getQueryID()) < 10) continue; | ||
| 93 | if (total.duration() > 18000) { | ||
| 94 | System.out.println("Time out 5h."); | ||
| 95 | return ; | ||
| 96 | } | ||
| 97 | System.out.println("--------------------- Query " + record.getQueryID() + " -----------------------"); | ||
| 98 | System.out.println(record.getQueryText()); | ||
| 99 | ExecutorService exec = Executors.newSingleThreadExecutor(); | ||
| 100 | try { | ||
| 101 | Future<Boolean> succ = exec.submit(new QueryThread(record, onto, hermit, roller)); | ||
| 102 | try { | ||
| 103 | try { | ||
| 104 | if (record.getQueryID().equals("1")) | ||
| 105 | System.out.println(succ.get(60, TimeUnit.MINUTES)); | ||
| 106 | else | ||
| 107 | System.out.println(succ.get(20, TimeUnit.MINUTES)); | ||
| 108 | } catch (InterruptedException e) { | ||
| 109 | // e.printStackTrace(); | ||
| 110 | } catch (ExecutionException e) { | ||
| 111 | // e.printStackTrace(); | ||
| 112 | } catch (TimeoutException e) { | ||
| 113 | // e.printStackTrace(); | ||
| 114 | } | ||
| 115 | } finally { | ||
| 116 | if (succ.cancel(true)) { | ||
| 117 | System.out.println("Trying to cancel the current query thread " + (++failedCounter)); | ||
| 118 | } | ||
| 119 | } | ||
| 120 | } finally { | ||
| 121 | exec.shutdownNow(); | ||
| 122 | } | ||
| 123 | } | ||
| 124 | |||
| 125 | if (ps != null) ps.close(); | ||
| 126 | System.exit(0); | ||
| 127 | } | ||
| 128 | |||
| 129 | } | ||
| 130 | |||
| 131 | class QueryThread implements Callable<Boolean> { | ||
| 132 | |||
| 133 | QueryRecord record; | ||
| 134 | OWLOntology onto; | ||
| 135 | Reasoner hermit; | ||
| 136 | QueryRoller roller; | ||
| 137 | |||
| 138 | public QueryThread(QueryRecord record2, OWLOntology onto2, Reasoner hermit2, QueryRoller roller2) { | ||
| 139 | record = record2; onto = onto2; hermit = hermit2; roller = roller2; | ||
| 140 | } | ||
| 141 | |||
| 142 | @Override | ||
| 143 | public Boolean call() throws Exception { | ||
| 144 | Set<String> answers = new HashSet<String>(); | ||
| 145 | Timer t = new Timer(); | ||
| 146 | if (record.getDistinguishedVariables().length > 1) { | ||
| 147 | if (record.getDistinguishedVariables().length == 2 && record.getClause().getBodyLength() == 1) { | ||
| 148 | dealWithAtomicBinaryQuery(record.getClause().getBodyAtom(0), answers); | ||
| 149 | System.out.println("Query " + record.getQueryID() + " The number of answers: " + answers.size()); | ||
| 150 | System.out.println("Query " + record.getQueryID() + " Total time: " + t.duration()); | ||
| 151 | } | ||
| 152 | else { | ||
| 153 | System.out.println("Query " + record.getQueryID() + " The number of answers: Query cannot be processsed."); | ||
| 154 | System.out.println("Query " + record.getQueryID() + " Total time: Query cannot be processsed."); | ||
| 155 | } | ||
| 156 | return false; | ||
| 157 | } | ||
| 158 | |||
| 159 | OWLClassExpression exp = null; | ||
| 160 | |||
| 161 | try { | ||
| 162 | exp = roller.rollUp(record.getClause(), record.getAnswerVariables()[0]); | ||
| 163 | } catch (Exception e) { | ||
| 164 | System.out.println("Query " + record.getQueryID() + " The number of answers: Query cannot be processsed."); | ||
| 165 | System.out.println("Query " + record.getQueryID() + " Total time: Query cannot be processsed."); | ||
| 166 | return false; | ||
| 167 | } | ||
| 168 | System.out.println(exp); | ||
| 169 | for (Node<OWLNamedIndividual> node: hermit.getInstances(exp, false)) { | ||
| 170 | for (OWLIndividual ind: node.getEntities()) { | ||
| 171 | answers.add(ind.toStringID()); | ||
| 172 | } | ||
| 173 | } | ||
| 174 | System.out.println("Query " + record.getQueryID() + " The number of answers: " + answers.size()); | ||
| 175 | System.out.println("Query " + record.getQueryID() + " Total time: " + t.duration()); | ||
| 176 | return true; | ||
| 177 | } | ||
| 178 | |||
| 179 | private void dealWithAtomicBinaryQuery(Atom bodyAtom, Set<String> answers) { | ||
| 180 | StringBuilder sb = new StringBuilder(); | ||
| 181 | OWLDataFactory f = onto.getOWLOntologyManager().getOWLDataFactory(); | ||
| 182 | OWLObjectProperty p = f.getOWLObjectProperty(IRI.create(((AtomicRole) bodyAtom.getDLPredicate()).getIRI())); | ||
| 183 | for (Node<OWLNamedIndividual> sub: hermit.getInstances(f.getOWLObjectMinCardinality(1, p), false)) { | ||
| 184 | for (Node<OWLNamedIndividual> obj: hermit.getObjectPropertyValues(sub.getRepresentativeElement(), p)) { | ||
| 185 | for (OWLNamedIndividual subInd: sub.getEntities()) { | ||
| 186 | sb.setLength(0); | ||
| 187 | sb.append(subInd.toString()).append(" "); | ||
| 188 | int len = sb.length(); | ||
| 189 | for (OWLNamedIndividual objInd: obj.getEntities()) { | ||
| 190 | sb.setLength(len); | ||
| 191 | sb.append(objInd.toString()); | ||
| 192 | answers.add(sb.toString()); | ||
| 193 | } | ||
| 194 | } | ||
| 195 | } | ||
| 196 | } | ||
| 197 | } | ||
| 198 | |||
| 199 | } | ||
| 200 | |||
diff --git a/src/test/java/uk/ac/ox/cs/hermit/HermitTester.java b/src/test/java/uk/ac/ox/cs/hermit/HermitTester.java new file mode 100644 index 0000000..dc70284 --- /dev/null +++ b/src/test/java/uk/ac/ox/cs/hermit/HermitTester.java | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | package uk.ac.ox.cs.hermit; | ||
| 2 | |||
| 3 | import org.semanticweb.HermiT.Configuration; | ||
| 4 | import org.semanticweb.HermiT.Reasoner; | ||
| 5 | import org.semanticweb.HermiT.model.Atom; | ||
| 6 | import org.semanticweb.HermiT.model.DLClause; | ||
| 7 | import org.semanticweb.HermiT.model.DLOntology; | ||
| 8 | import org.semanticweb.HermiT.structural.OWLClausification; | ||
| 9 | import org.semanticweb.owlapi.model.IRI; | ||
| 10 | import org.semanticweb.owlapi.model.OWLAxiom; | ||
| 11 | import org.semanticweb.owlapi.model.OWLClass; | ||
| 12 | import org.semanticweb.owlapi.model.OWLDataFactory; | ||
| 13 | import org.semanticweb.owlapi.model.OWLNamedIndividual; | ||
| 14 | import org.semanticweb.owlapi.model.OWLOntology; | ||
| 15 | import org.semanticweb.owlapi.reasoner.Node; | ||
| 16 | |||
| 17 | import uk.ac.ox.cs.pagoda.owl.OWLHelper; | ||
| 18 | |||
| 19 | public class HermitTester { | ||
| 20 | |||
| 21 | public static void main(String[] args) { | ||
| 22 | OWLOntology onto = OWLHelper.loadOntology("imported.owl"); | ||
| 23 | Reasoner hermit = new Reasoner(onto); | ||
| 24 | OWLDataFactory f = onto.getOWLOntologyManager().getOWLDataFactory(); | ||
| 25 | OWLClass concept = f.getOWLClass(IRI.create("http://semantics.crl.ibm.com/univ-bench-dl.owl#Query12")); | ||
| 26 | |||
| 27 | for (OWLOntology o: onto.getImportsClosure()) { | ||
| 28 | System.out.println(o.containsEntityInSignature(concept)); | ||
| 29 | for (OWLAxiom axiom: o.getAxioms()) | ||
| 30 | if (axiom.getClassesInSignature().contains(concept)) | ||
| 31 | System.out.println(axiom); | ||
| 32 | } | ||
| 33 | |||
| 34 | for (Node<OWLNamedIndividual> node : hermit.getInstances(concept, false)) | ||
| 35 | for (OWLNamedIndividual i: node.getEntities()) { | ||
| 36 | System.out.println(i.toStringID()); | ||
| 37 | } | ||
| 38 | |||
| 39 | // clausifierTest(); | ||
| 40 | } | ||
| 41 | |||
| 42 | @SuppressWarnings("unused") | ||
| 43 | private static void clausifierTest() { | ||
| 44 | OWLOntology onto = OWLHelper.loadOntology("/users/yzhou/ontologies/travel.owl"); | ||
| 45 | OWLClausification clausifier = new OWLClausification(new Configuration()); | ||
| 46 | DLOntology dlOntology = (DLOntology)clausifier.preprocessAndClausify(onto, null)[1]; | ||
| 47 | |||
| 48 | for (DLClause clause: dlOntology.getDLClauses()) | ||
| 49 | System.out.println(clause); | ||
| 50 | for (Atom atom : dlOntology.getPositiveFacts()) | ||
| 51 | System.out.println(atom); | ||
| 52 | |||
| 53 | } | ||
| 54 | |||
| 55 | } | ||
diff --git a/src/test/java/uk/ac/ox/cs/hermit/JAIR_HermiT.java b/src/test/java/uk/ac/ox/cs/hermit/JAIR_HermiT.java new file mode 100644 index 0000000..72e7af8 --- /dev/null +++ b/src/test/java/uk/ac/ox/cs/hermit/JAIR_HermiT.java | |||
| @@ -0,0 +1,129 @@ | |||
| 1 | package uk.ac.ox.cs.hermit; | ||
| 2 | |||
| 3 | import org.junit.Test; | ||
| 4 | import uk.ac.ox.cs.pagoda.util.TestUtil; | ||
| 5 | |||
| 6 | public class JAIR_HermiT { | ||
| 7 | |||
| 8 | @Test | ||
| 9 | public void lubm1() throws Exception { | ||
| 10 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 11 | String[] args = new String[] { | ||
| 12 | TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"), | ||
| 13 | TestUtil.combinePaths(ontoDir, "lubm/data/lubm1_owl"), | ||
| 14 | TestUtil.combinePaths(ontoDir, "lubm/queries/answersCorrectness.sparql") | ||
| 15 | // , "/home/yzhou/java-workspace/answersCorrectness-share/results_new/lubm1/hermit" | ||
| 16 | }; | ||
| 17 | HermitQueryReasoner.main(args); | ||
| 18 | } | ||
| 19 | |||
| 20 | @Test | ||
| 21 | public void lubm1_rolledUp() throws Exception { | ||
| 22 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 23 | String[] args = new String[] { | ||
| 24 | "/home/yzhou/backup/20141212/univ-bench-queries.owl", | ||
| 25 | TestUtil.combinePaths(ontoDir, "lubm/data/lubm1_owl"), | ||
| 26 | TestUtil.combinePaths(ontoDir, "lubm/queries/atomic_lubm.sparql") | ||
| 27 | // , "/home/yzhou/java-workspace/answersCorrectness-share/results_new/lubm1/hermit_rolledUp" | ||
| 28 | }; | ||
| 29 | HermitQueryReasoner.main(args); | ||
| 30 | } | ||
| 31 | |||
| 32 | @Test | ||
| 33 | public void uobm1() throws Exception { | ||
| 34 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 35 | String[] args = new String[] { | ||
| 36 | TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"), | ||
| 37 | TestUtil.combinePaths(ontoDir, "uobm/data/uobm1_owl_withDeclaration"), | ||
| 38 | TestUtil.combinePaths(ontoDir, "uobm/queries/standard.sparql") | ||
| 39 | // , "hermit_uobm1.out" | ||
| 40 | // , "/home/yzhou/java-workspace/answersCorrectness-share/results_new/uobm1/hermit" | ||
| 41 | }; | ||
| 42 | HermitQueryReasoner.main(args); | ||
| 43 | } | ||
| 44 | |||
| 45 | @Test | ||
| 46 | public void uobm1_rolledUp() throws Exception { | ||
| 47 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 48 | String[] args = new String[] { | ||
| 49 | "/home/yzhou/backup/20141212/univ-bench-dl-queries.owl", | ||
| 50 | TestUtil.combinePaths(ontoDir, "uobm/data/uobm1_owl_withDeclaration"), | ||
| 51 | TestUtil.combinePaths(ontoDir, "uobm/queries/atomic_uobm.sparql") | ||
| 52 | , "hermit_uobm1_rolledUp.out" | ||
| 53 | // , "/home/yzhou/java-workspace/answersCorrectness-share/results_new/uobm1/hermit_rolledUp" | ||
| 54 | }; | ||
| 55 | HermitQueryReasoner.main(args); | ||
| 56 | } | ||
| 57 | |||
| 58 | @Test | ||
| 59 | public void fly_rolledUp() throws Exception { | ||
| 60 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 61 | HermitQueryReasoner.main( | ||
| 62 | TestUtil.combinePaths(ontoDir, "fly/fly-all-in-one_rolledUp.owl"), | ||
| 63 | // TestUtil.combinePaths(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl", | ||
| 64 | null, | ||
| 65 | TestUtil.combinePaths(ontoDir, "fly/queries/fly_atomic.sparql") | ||
| 66 | , "hermit_fly.out" | ||
| 67 | ); | ||
| 68 | } | ||
| 69 | |||
| 70 | @Test | ||
| 71 | public void npd() throws Exception { | ||
| 72 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 73 | HermitQueryReasoner.main( | ||
| 74 | TestUtil.combinePaths(ontoDir, "npd/npd-all-minus-datatype.owl"), | ||
| 75 | TestUtil.combinePaths(ontoDir, "npd/data/npd-data-dump-minus-datatype-new.ttl"), | ||
| 76 | TestUtil.combinePaths(ontoDir, "npd/queries/atomic_ground.sparql") | ||
| 77 | , "hermit_npd.out" | ||
| 78 | // , "/home/yzhou/java-workspace/answersCorrectness-share/results_new/npd/hermit" | ||
| 79 | ); | ||
| 80 | } | ||
| 81 | |||
| 82 | @Test | ||
| 83 | public void dbpedia() throws Exception { | ||
| 84 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 85 | HermitQueryReasoner.main( | ||
| 86 | TestUtil.combinePaths(ontoDir, "dbpedia/integratedOntology-all-in-one-minus-datatype.owl"), | ||
| 87 | TestUtil.combinePaths(ontoDir, "dbpedia/data/dbpedia-minus-datatype-new.ttl"), | ||
| 88 | TestUtil.combinePaths(ontoDir, "dbpedia/queries/atomic_ground.sparql") | ||
| 89 | , "/home/yzhou/java-workspace/answersCorrectness-share/results_new/dbpedia/hermit" | ||
| 90 | ); | ||
| 91 | } | ||
| 92 | |||
| 93 | @Test | ||
| 94 | public void reactome() throws Exception { | ||
| 95 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 96 | HermitQueryReasoner.main( | ||
| 97 | TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/biopax-level3-processed.owl"), | ||
| 98 | TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/graph sampling/reactome_sample_10.ttl"), | ||
| 99 | TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/queries/atomic_ground.sparql") | ||
| 100 | , "/home/yzhou/java-workspace/answersCorrectness-share/results_new/reactome/hermit_10p" | ||
| 101 | ); | ||
| 102 | } | ||
| 103 | |||
| 104 | @Test | ||
| 105 | public void chembl() throws Exception { | ||
| 106 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 107 | HermitQueryReasoner.main( | ||
| 108 | TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/cco-noDPR.ttl"), | ||
| 109 | // null, | ||
| 110 | TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/graph sampling/sample_1.nt"), | ||
| 111 | TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/queries/atomic_ground.sparql") | ||
| 112 | , "hermit_chembl.out" | ||
| 113 | // , "/home/yzhou/java-workspace/answersCorrectness-share/results_new/chembl/hermit_1p" | ||
| 114 | ); | ||
| 115 | } | ||
| 116 | |||
| 117 | @Test | ||
| 118 | public void uniprot() throws Exception { | ||
| 119 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | ||
| 120 | HermitQueryReasoner.main( | ||
| 121 | TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/core-sat.owl"), | ||
| 122 | TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/graph sampling/sample_1.nt"), | ||
| 123 | TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/queries/atomic_ground.sparql") | ||
| 124 | , "hermit_uniprot.out" | ||
| 125 | // , "/home/yzhou/java-workspace/answersCorrectness-share/results_new/uniprot/hermit_1p" | ||
| 126 | ); | ||
| 127 | } | ||
| 128 | |||
| 129 | } | ||
