From 7a73dcd98f3a7824572d098889634662a47d6e7c Mon Sep 17 00:00:00 2001 From: Federico Igne Date: Sun, 3 Oct 2021 13:48:29 +0100 Subject: Introduce functional tests These tests will check correctness of the overall system across versions. We should add more tests for know ontologies. --- src/main/scala/uk/ac/ox/cs/rsacomb/util/RDFoxUtil.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/main/scala/uk/ac') 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 { path: os.Path, prefixes: Prefixes = new Prefixes() ): List[ConjunctiveQuery] = { - val pattern = raw"\^\[Query(\d+)\]".r + val header = raw"\^\[[Qq]uery(\d+)\]".r + val comment = "^#.*".r val queries = os.read .lines(path) .map(_.trim.filter(_ >= ' ')) @@ -251,12 +252,13 @@ object RDFoxUtil { .foldRight((List.empty[Option[ConjunctiveQuery]], List.empty[String])) { case (line, (acc, query)) => { line match { - case pattern(id) => { + case header(id) => { val cq = ConjunctiveQuery.parse(id.toInt, query.mkString(" "), prefixes) (cq :: acc, List.empty) } - case _ => (acc, line :: query) + case comment() => (acc, query) + case _ => (acc, line :: query) } } } -- cgit v1.2.3