diff options
| author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-12-07 13:50:50 +0000 |
|---|---|---|
| committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-12-07 13:50:50 +0000 |
| commit | bbbb61ee13fa258cbed0b502426534afad49b651 (patch) | |
| tree | ae2cbeb271bfedad4948499fc45f4c81cd567ff3 /src/main | |
| parent | 920a42b4b55666c582e1d1420336996f4af324fc (diff) | |
| download | RSAComb-bbbb61ee13fa258cbed0b502426534afad49b651.tar.gz RSAComb-bbbb61ee13fa258cbed0b502426534afad49b651.zip | |
Update answers pretty printer
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/scala/uk/ac/ox/cs/rsacomb/sparql/ConjunctiveQueryAnswers.scala | 9 |
1 files changed, 7 insertions, 2 deletions
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 0f830eb..327ae8e 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 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | package uk.ac.ox.cs.rsacomb.sparql | 1 | package uk.ac.ox.cs.rsacomb.sparql |
| 2 | 2 | ||
| 3 | import tech.oxfordsemantic.jrdfox.logic.expression.{Resource, Variable} | 3 | import tech.oxfordsemantic.jrdfox.logic.expression.{IRI, Resource, Variable} |
| 4 | 4 | ||
| 5 | /** A collections of answers to a query. | 5 | /** A collections of answers to a query. |
| 6 | * | 6 | * |
| @@ -25,7 +25,12 @@ class ConjunctiveQueryAnswers( | |||
| 25 | "NO ANSWER." | 25 | "NO ANSWER." |
| 26 | else { | 26 | else { |
| 27 | val header = variables map (_.getName) mkString "\t" | 27 | val header = variables map (_.getName) mkString "\t" |
| 28 | val body = answers.map(_.mkString("\t")).mkString("\n") | 28 | val body = answers |
| 29 | .map(_.map { | ||
| 30 | case x: IRI => x.getIRI | ||
| 31 | case x => x.toString | ||
| 32 | }.mkString("\t")) | ||
| 33 | .mkString("\n") | ||
| 29 | s"$header\n$body" | 34 | s"$header\n$body" |
| 30 | } | 35 | } |
| 31 | } | 36 | } |
