aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/uk/ac
diff options
context:
space:
mode:
authorFederico Igne <git@federicoigne.com>2021-10-03 13:48:29 +0100
committerFederico Igne <git@federicoigne.com>2021-10-03 13:48:29 +0100
commit7a73dcd98f3a7824572d098889634662a47d6e7c (patch)
tree3c9c013697ac10f8680ba8f85ce8dc7379ac41aa /src/main/scala/uk/ac
parent0cd63c26fdfafaf09734950add28f63d500ac330 (diff)
downloadRSAComb-7a73dcd98f3a7824572d098889634662a47d6e7c.tar.gz
RSAComb-7a73dcd98f3a7824572d098889634662a47d6e7c.zip
Introduce functional tests
These tests will check correctness of the overall system across versions. We should add more tests for know ontologies.
Diffstat (limited to 'src/main/scala/uk/ac')
-rw-r--r--src/main/scala/uk/ac/ox/cs/rsacomb/util/RDFoxUtil.scala8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/util/RDFoxUtil.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/util/RDFoxUtil.scala
index 46f1160..e3e7dd4 100644
--- a/src/main/scala/uk/ac/ox/cs/rsacomb/util/RDFoxUtil.scala
+++ b/src/main/scala/uk/ac/ox/cs/rsacomb/util/RDFoxUtil.scala
@@ -243,7 +243,8 @@ object RDFoxUtil {
243 path: os.Path, 243 path: os.Path,
244 prefixes: Prefixes = new Prefixes() 244 prefixes: Prefixes = new Prefixes()
245 ): List[ConjunctiveQuery] = { 245 ): List[ConjunctiveQuery] = {
246 val pattern = raw"\^\[Query(\d+)\]".r 246 val header = raw"\^\[[Qq]uery(\d+)\]".r
247 val comment = "^#.*".r
247 val queries = os.read 248 val queries = os.read
248 .lines(path) 249 .lines(path)
249 .map(_.trim.filter(_ >= ' ')) 250 .map(_.trim.filter(_ >= ' '))
@@ -251,12 +252,13 @@ object RDFoxUtil {
251 .foldRight((List.empty[Option[ConjunctiveQuery]], List.empty[String])) { 252 .foldRight((List.empty[Option[ConjunctiveQuery]], List.empty[String])) {
252 case (line, (acc, query)) => { 253 case (line, (acc, query)) => {
253 line match { 254 line match {
254 case pattern(id) => { 255 case header(id) => {
255 val cq = 256 val cq =
256 ConjunctiveQuery.parse(id.toInt, query.mkString(" "), prefixes) 257 ConjunctiveQuery.parse(id.toInt, query.mkString(" "), prefixes)
257 (cq :: acc, List.empty) 258 (cq :: acc, List.empty)
258 } 259 }
259 case _ => (acc, line :: query) 260 case comment() => (acc, query)
261 case _ => (acc, line :: query)
260 } 262 }
261 } 263 }
262 } 264 }