aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/uk/ac/ox/cs/acqua/Main.scala
diff options
context:
space:
mode:
authorFederico Igne <federico.igne@cs.ox.ac.uk>2022-05-11 12:35:56 +0100
committerFederico Igne <federico.igne@cs.ox.ac.uk>2022-05-11 12:35:56 +0100
commit32fe8f94255b913c570275043a3c056eaa4ec07b (patch)
tree2a370c3998db1eab758f214f16f2cebc3fd2ef34 /src/main/scala/uk/ac/ox/cs/acqua/Main.scala
parenteaa8ed73aec7ca0ba02eb3e1c954388b8dbfc2cd (diff)
downloadACQuA-32fe8f94255b913c570275043a3c056eaa4ec07b.tar.gz
ACQuA-32fe8f94255b913c570275043a3c056eaa4ec07b.zip
Implement stub for query answering procedure
Diffstat (limited to 'src/main/scala/uk/ac/ox/cs/acqua/Main.scala')
-rw-r--r--src/main/scala/uk/ac/ox/cs/acqua/Main.scala82
1 files changed, 63 insertions, 19 deletions
diff --git a/src/main/scala/uk/ac/ox/cs/acqua/Main.scala b/src/main/scala/uk/ac/ox/cs/acqua/Main.scala
index 749a492..e8cfeb7 100644
--- a/src/main/scala/uk/ac/ox/cs/acqua/Main.scala
+++ b/src/main/scala/uk/ac/ox/cs/acqua/Main.scala
@@ -1,16 +1,41 @@
1/*
2 * Copyright 2021,2022 KRR Oxford
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
1package uk.ac.ox.cs.acqua 17package uk.ac.ox.cs.acqua
2 18
19import uk.ac.ox.cs.rsacomb.converter.Normalizer
3import uk.ac.ox.cs.rsacomb.ontology.Ontology 20import uk.ac.ox.cs.rsacomb.ontology.Ontology
21import uk.ac.ox.cs.rsacomb.util.{RDFoxUtil,RSA}
4 22
5import uk.ac.ox.cs.pagoda.owl.OWLHelper 23import uk.ac.ox.cs.pagoda.owl.OWLHelper
6import uk.ac.ox.cs.pagoda.reasoner.{ELHOQueryReasoner,QueryReasoner,RLQueryReasoner} 24import uk.ac.ox.cs.pagoda.reasoner.{ELHOQueryReasoner,MyQueryReasoner,QueryReasoner,RLQueryReasoner}
7// import uk.ac.ox.cs.pagoda.Pagoda 25import uk.ac.ox.cs.pagoda.util.PagodaProperties;
8// import uk.ac.ox.cs.pagoda.util.PagodaProperties; 26import uk.ac.ox.cs.pagoda.util.Utility;
27
28import uk.ac.ox.cs.acqua.reasoner.RSAQueryReasoner
29import uk.ac.ox.cs.acqua.util.AcquaConfig
9 30
10object Acqua extends App { 31object Acqua extends App {
32 val config = AcquaConfig.parse(args.toList)
33 AcquaConfig describe config
11 34
12 val ontopath = os.Path("tests/lubm/univ-bench.owl", base = os.pwd) 35 val ontopath = os.Path("tests/lubm/univ-bench.owl", base = os.pwd)
13 val ontology = Ontology(ontopath, List.empty) 36 val ontology = Ontology(ontopath, List.empty).normalize(new Normalizer)
37
38 val properties = new PagodaProperties()
14 39
15 val performMultiStages = true 40 val performMultiStages = true
16 val considerEqualities = true 41 val considerEqualities = true
@@ -20,22 +45,41 @@ object Acqua extends App {
20 } else if (OWLHelper.isInELHO(ontology.origin)) { 45 } else if (OWLHelper.isInELHO(ontology.origin)) {
21 new ELHOQueryReasoner(); 46 new ELHOQueryReasoner();
22 } else if (ontology.isRSA) { 47 } else if (ontology.isRSA) {
23 // Use combined approach for RSA 48 new RSAQueryReasoner(ontology)
24 ???
25 } else { 49 } else {
26 new MyQueryReasoner(performMultiStages, considerEqualities); 50 // Return ACQuA reasoner
51 // new MyQueryReasoner(performMultiStages, considerEqualities);
52 ???
53 }
54
55 /* Preprocessing */
56 reasoner.setProperties(properties)
57 reasoner.loadOntology(ontology.origin)
58 reasoner.importData(properties.getDataPath())
59 if (reasoner.preprocess()) {
60 Utility.logInfo("The ontology is consistent!");
61 }
62 else {
63 Utility.logInfo("The ontology is inconsistent!");
64 reasoner.dispose();
27 } 65 }
28 // else
29 // switch(type) {
30 // case RLU:
31 // reasoner = new RLUQueryReasoner(performMultiStages, considerEqualities);
32 // break;
33 // case ELHOU:
34 // reasoner = new ELHOUQueryReasoner(performMultiStages, considerEqualities);
35 // break;
36 // default:
37 // reasoner = new MyQueryReasoner(performMultiStages, considerEqualities);
38 // }
39 // return reasoner;
40 66
67 if (config contains 'queries) {
68 val queries =
69 RDFoxUtil.loadQueriesFromFiles(
70 config('queries).get[List[os.Path]],
71 RSA.Prefixes
72 )
73 // for(String queryFile : properties.getQueryPath().split(";")) {
74 // Collection<QueryRecord> queryRecords = pagoda.getQueryManager().collectQueryRecords(queryFile);
75 // pagoda.evaluate(queryRecords);
76 }
41} 77}
78
79
80 // /* Perform query answering */
81 // val answers = rsa ask queries
82
83 // /* Perform logging */
84 // Logger write answers
85 // Logger.generateSimulationScripts(datapath, queries)