diff options
Diffstat (limited to 'src/main/scala/rsacomb/RDFoxUtil.scala')
| -rw-r--r-- | src/main/scala/rsacomb/RDFoxUtil.scala | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/main/scala/rsacomb/RDFoxUtil.scala b/src/main/scala/rsacomb/RDFoxUtil.scala index 9699fb4..d5a4dbb 100644 --- a/src/main/scala/rsacomb/RDFoxUtil.scala +++ b/src/main/scala/rsacomb/RDFoxUtil.scala | |||
| @@ -44,9 +44,10 @@ object RDFoxUtil { | |||
| 44 | def submitQuery( | 44 | def submitQuery( |
| 45 | data: DataStoreConnection, | 45 | data: DataStoreConnection, |
| 46 | prefixes: Prefixes, | 46 | prefixes: Prefixes, |
| 47 | query: String | 47 | query: String, |
| 48 | answers: Int | ||
| 48 | ): Unit = { | 49 | ): Unit = { |
| 49 | println(s"\n{ $query }") | 50 | println(s"\nQUERY { $query }") |
| 50 | val cursor = data.createCursor( | 51 | val cursor = data.createCursor( |
| 51 | prefixes, | 52 | prefixes, |
| 52 | query, | 53 | query, |
| @@ -54,12 +55,16 @@ object RDFoxUtil { | |||
| 54 | ); | 55 | ); |
| 55 | var mul = cursor.open() | 56 | var mul = cursor.open() |
| 56 | while (mul > 0) { | 57 | while (mul > 0) { |
| 57 | val res0 = cursor.getResource(0) | 58 | print("Answer: ") |
| 58 | val res1 = cursor.getResource(1) | 59 | for (i <- 0 until answers) { |
| 59 | println(s"Answer: $res0 $res1") | 60 | val res = cursor.getResource(i) |
| 61 | print(s"$res ") | ||
| 62 | } | ||
| 63 | println() | ||
| 60 | mul = cursor.advance() | 64 | mul = cursor.advance() |
| 61 | } | 65 | } |
| 62 | cursor.close(); | 66 | cursor.close(); |
| 67 | println(s"QUERY END") | ||
| 63 | } | 68 | } |
| 64 | 69 | ||
| 65 | def closeConnection( | 70 | def closeConnection( |
| @@ -70,4 +75,4 @@ object RDFoxUtil { | |||
| 70 | data.close(); | 75 | data.close(); |
| 71 | } | 76 | } |
| 72 | 77 | ||
| 73 | } // object RDFox | 78 | } // object RDFoxUtil |
