From 402e3ec13ca1a0a870dde530d1364a528079782d Mon Sep 17 00:00:00 2001 From: Federico Igne Date: Mon, 23 Nov 2020 09:44:01 +0000 Subject: Rename `boolean` as `bcq` --- src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala | 2 +- .../scala/uk/ac/ox/cs/rsacomb/sparql/ConjunctiveQuery.scala | 4 ++-- .../uk/ac/ox/cs/rsacomb/sparql/ConjunctiveQueryAnswers.scala | 11 +++++------ .../uk/ac/ox/cs/rsacomb/sparql/ConjunctiveQuerySpec.scala | 6 +++--- 4 files changed, 11 insertions(+), 12 deletions(-) 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 9ef8986..4693e04 100644 --- a/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala +++ b/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala @@ -310,7 +310,7 @@ class RSAOntology(val ontology: OWLOntology) extends RSAAxiom { RSA.Prefixes ) .map( - new ConjunctiveQueryAnswers(query.boolean, _) + new ConjunctiveQueryAnswers(query.bcq, _) ) .get RDFoxHelpers.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 b523938..4d397d8 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 @@ -75,7 +75,7 @@ class ConjunctiveQuery( * query selects '''all''' variables with `*`, `select` is empty as * well. */ - val boolean: Boolean = select.isEmpty && !query.getAllPossibleVariables + val bcq: Boolean = select.isEmpty && !query.getAllPossibleVariables /** Returns the full set of variables involved in the query. */ val variables: Set[Variable] = @@ -116,7 +116,7 @@ class ConjunctiveQuery( opts: JMap[String, String] = new JHashMap[String, String]() ): ConjunctiveQueryAnswers = new ConjunctiveQueryAnswers( - boolean, + bcq, RDFoxHelpers.submitSelectQuery(data, query, opts) ) diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/sparql/ConjunctiveQueryAnswers.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/sparql/ConjunctiveQueryAnswers.scala index 223e121..ded8d6b 100644 --- a/src/main/scala/uk/ac/ox/cs/rsacomb/sparql/ConjunctiveQueryAnswers.scala +++ b/src/main/scala/uk/ac/ox/cs/rsacomb/sparql/ConjunctiveQueryAnswers.scala @@ -2,23 +2,22 @@ package uk.ac.ox.cs.rsacomb.sparql import tech.oxfordsemantic.jrdfox.logic.expression.Resource -/** A collections of answers to a query +/** A collections of answers to a query. * * Will take the query type (CQ or BCQ) into consideration when * serialised. * - * @param boolean whether the answers are to a BCQ + * @param bcq whether the answers are the result of a BCQ. * @param answers collection of answers to a query. When dealing with - * BCQs, and empty collection represents a ''false'', - * ''true'' otherwise. + * BCQs, and empty collection represents a ''false'', ''true'' otherwise. */ class ConjunctiveQueryAnswers( - boolean: Boolean, + bcq: Boolean, val answers: Seq[Seq[Resource]] ) { override def toString(): String = - if (boolean) { + if (bcq) { if (answers.isEmpty) "FALSE" else "TRUE" } else { if (answers.isEmpty) diff --git a/src/test/scala/uk/ac/ox/cs/rsacomb/sparql/ConjunctiveQuerySpec.scala b/src/test/scala/uk/ac/ox/cs/rsacomb/sparql/ConjunctiveQuerySpec.scala index e683d36..07e7bfb 100644 --- a/src/test/scala/uk/ac/ox/cs/rsacomb/sparql/ConjunctiveQuerySpec.scala +++ b/src/test/scala/uk/ac/ox/cs/rsacomb/sparql/ConjunctiveQuerySpec.scala @@ -150,15 +150,15 @@ class ConjunctiveQuerySpec } "A query with proper SELECT defined" should "not be a BCQ" in { - ConjunctiveQuery(cq0).value should not be 'boolean + ConjunctiveQuery(cq0).value should not be 'bcq } "A query with a \"*\" SELECT" should "not be a BCQ" in { - ConjunctiveQuery(cq1).value should not be 'boolean + ConjunctiveQuery(cq1).value should not be 'bcq } "An ASK query" should "not be a BCQ" in { - ConjunctiveQuery(bcq0).value shouldBe 'boolean + ConjunctiveQuery(bcq0).value shouldBe 'bcq } "Queries" should "have distinct answer and bounded variables" in { -- cgit v1.2.3