diff options
author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-12-07 16:30:26 +0000 |
---|---|---|
committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-12-07 16:30:26 +0000 |
commit | 53dbca1f3de8183eefdb0c6b2d0e384f1371e52e (patch) | |
tree | 650bdf83d3eca1ba8b8c4eb739f949bd69d21619 /src/main | |
parent | bbbb61ee13fa258cbed0b502426534afad49b651 (diff) | |
download | RSAComb-53dbca1f3de8183eefdb0c6b2d0e384f1371e52e.tar.gz RSAComb-53dbca1f3de8183eefdb0c6b2d0e384f1371e52e.zip |
Change ConjunctiveQuery constructors interface
One of the object constructor was returning an Option. It was weird to
have a constructor that would not always return an object.
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala | 2 | ||||
-rw-r--r-- | src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala | 2 | ||||
-rw-r--r-- | src/main/scala/uk/ac/ox/cs/rsacomb/sparql/ConjunctiveQuery.scala | 2 |
3 files changed, 3 insertions, 3 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 d41ca8c..c7ace0f 100644 --- a/src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala +++ b/src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala | |||
@@ -61,7 +61,7 @@ object RSAComb extends App { | |||
61 | source.close() | 61 | source.close() |
62 | 62 | ||
63 | /* Compute answers to query */ | 63 | /* Compute answers to query */ |
64 | val answers = ConjunctiveQuery(query).map(ontology ask _) | 64 | val answers = ConjunctiveQuery.parse(query).map(ontology ask _) |
65 | answers map (_.toString) foreach println | 65 | answers map (_.toString) foreach println |
66 | } | 66 | } |
67 | } | 67 | } |
diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala index 52d4905..7b4b142 100644 --- a/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala +++ b/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala | |||
@@ -336,7 +336,7 @@ class RSAOntology(val ontology: OWLOntology) { | |||
336 | RSA.Prefixes | 336 | RSA.Prefixes |
337 | ) | 337 | ) |
338 | .map( | 338 | .map( |
339 | new ConjunctiveQueryAnswers(query.bcq, _) | 339 | new ConjunctiveQueryAnswers(query.bcq, query.variables, _) |
340 | ) | 340 | ) |
341 | .get | 341 | .get |
342 | RDFoxUtil.closeConnection(server, data) | 342 | RDFoxUtil.closeConnection(server, data) |
diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/sparql/ConjunctiveQuery.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/sparql/ConjunctiveQuery.scala index 451d1f4..1fb75d7 100644 --- a/src/main/scala/uk/ac/ox/cs/rsacomb/sparql/ConjunctiveQuery.scala +++ b/src/main/scala/uk/ac/ox/cs/rsacomb/sparql/ConjunctiveQuery.scala | |||
@@ -31,7 +31,7 @@ object ConjunctiveQuery { | |||
31 | * @return an [[scala.Option]] containing a ConjunctiveQuery if the | 31 | * @return an [[scala.Option]] containing a ConjunctiveQuery if the |
32 | * input query represents one, None is returned otherwise. | 32 | * input query represents one, None is returned otherwise. |
33 | */ | 33 | */ |
34 | def apply( | 34 | def parse( |
35 | query: String, | 35 | query: String, |
36 | prefixes: Prefixes = new Prefixes() | 36 | prefixes: Prefixes = new Prefixes() |
37 | ): Option[ConjunctiveQuery] = | 37 | ): Option[ConjunctiveQuery] = |