aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala
diff options
context:
space:
mode:
authorFederico Igne <federico.igne@cs.ox.ac.uk>2020-11-27 12:52:35 +0000
committerFederico Igne <federico.igne@cs.ox.ac.uk>2020-11-27 12:52:35 +0000
commitd9043e15a4bd764c4c3eccd682a18445a598d923 (patch)
tree352242f093e3f0e3035303bc43c0ce84dd15bf6f /src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala
parent6f4dda8c71e600ef55b8f6f90977d128481e3520 (diff)
downloadRSAComb-d9043e15a4bd764c4c3eccd682a18445a598d923.tar.gz
RSAComb-d9043e15a4bd764c4c3eccd682a18445a598d923.zip
Add ability to pass multiple ontology files on the commandline
Diffstat (limited to 'src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala')
-rw-r--r--src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala
index 016bb86..40fee79 100644
--- a/src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala
+++ b/src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala
@@ -19,11 +19,11 @@ object RSAComb extends App {
19 rsacomb - combined approach for CQ answering for RSA ontologies. 19 rsacomb - combined approach for CQ answering for RSA ontologies.
20 20
21 USAGE 21 USAGE
22 rsacomb <path/to/ontology.owl> <path/to/query.sparql> 22 rsacomb <query> <ontology> ...
23 23
24 where 24 where
25 the ontology is expected to be an OWL file and the (single) 25 - query: a (single) SPARQL query file.
26 query a SPARQL query file. 26 - ontology: one or more ontologies.
27 27
28 """ 28 """
29 29
@@ -32,15 +32,15 @@ object RSAComb extends App {
32 * TODO: use something better later on 32 * TODO: use something better later on
33 */ 33 */
34 34
35 if (args.length < 2) { 35 if (args.length < 3) {
36 println(help) 36 println(help)
37 sys.exit; 37 sys.exit;
38 } 38 }
39 39
40 val ontoPath = new File(args(0)) 40 val queryPath = new File(args(0))
41 val queryPath = new File(args(1)) 41 val ontoPaths = args.drop(1).map(new File(_))
42 42
43 if (!ontoPath.isFile || !queryPath.isFile) { 43 if (!queryPath.isFile || !ontoPaths.forall(_.isFile)) {
44 println("The provided arguments are not regular files.\n\n") 44 println("The provided arguments are not regular files.\n\n")
45 println(help) 45 println(help)
46 sys.exit; 46 sys.exit;
@@ -51,8 +51,9 @@ object RSAComb extends App {
51 * case. 51 * case.
52 */ 52 */
53 53
54 val ontology = RSAOntology(ontoPath) 54 val ontology = RSAOntology(ontoPaths: _*)
55 if (ontology.isRSA) { 55 if (ontology.isRSA) {
56 //println("ONTOLOGY IS RSA")
56 57
57 /** Read SPARQL query from file */ 58 /** Read SPARQL query from file */
58 val source = io.Source.fromFile(queryPath.getAbsoluteFile) 59 val source = io.Source.fromFile(queryPath.getAbsoluteFile)