From d9043e15a4bd764c4c3eccd682a18445a598d923 Mon Sep 17 00:00:00 2001 From: Federico Igne Date: Fri, 27 Nov 2020 12:52:35 +0000 Subject: Add ability to pass multiple ontology files on the commandline --- src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala') 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 { rsacomb - combined approach for CQ answering for RSA ontologies. USAGE - rsacomb + rsacomb ... where - the ontology is expected to be an OWL file and the (single) - query a SPARQL query file. + - query: a (single) SPARQL query file. + - ontology: one or more ontologies. """ @@ -32,15 +32,15 @@ object RSAComb extends App { * TODO: use something better later on */ - if (args.length < 2) { + if (args.length < 3) { println(help) sys.exit; } - val ontoPath = new File(args(0)) - val queryPath = new File(args(1)) + val queryPath = new File(args(0)) + val ontoPaths = args.drop(1).map(new File(_)) - if (!ontoPath.isFile || !queryPath.isFile) { + if (!queryPath.isFile || !ontoPaths.forall(_.isFile)) { println("The provided arguments are not regular files.\n\n") println(help) sys.exit; @@ -51,8 +51,9 @@ object RSAComb extends App { * case. */ - val ontology = RSAOntology(ontoPath) + val ontology = RSAOntology(ontoPaths: _*) if (ontology.isRSA) { + //println("ONTOLOGY IS RSA") /** Read SPARQL query from file */ val source = io.Source.fromFile(queryPath.getAbsoluteFile) -- cgit v1.2.3