diff options
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/scala/uk/ac/ox/cs/rsacomb/util/RDFoxUtil.scala | 8 |
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 | } |
