diff options
Diffstat (limited to 'src/main/scala/rsacomb/RDFoxUtil.scala')
| -rw-r--r-- | src/main/scala/rsacomb/RDFoxUtil.scala | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/scala/rsacomb/RDFoxUtil.scala b/src/main/scala/rsacomb/RDFoxUtil.scala index d5a4dbb..b523d4e 100644 --- a/src/main/scala/rsacomb/RDFoxUtil.scala +++ b/src/main/scala/rsacomb/RDFoxUtil.scala | |||
| @@ -2,13 +2,16 @@ package rsacomb | |||
| 2 | 2 | ||
| 3 | /* Java imports */ | 3 | /* Java imports */ |
| 4 | import java.util.HashMap | 4 | import java.util.HashMap |
| 5 | import java.io.ByteArrayInputStream | ||
| 5 | import tech.oxfordsemantic.jrdfox.Prefixes | 6 | import tech.oxfordsemantic.jrdfox.Prefixes |
| 6 | import tech.oxfordsemantic.jrdfox.logic.IRI | 7 | import tech.oxfordsemantic.jrdfox.logic.{IRI, Query} |
| 7 | import tech.oxfordsemantic.jrdfox.client.{ | 8 | import tech.oxfordsemantic.jrdfox.client.{ |
| 8 | ConnectionFactory, | 9 | ConnectionFactory, |
| 9 | ServerConnection, | 10 | ServerConnection, |
| 10 | DataStoreConnection | 11 | DataStoreConnection |
| 11 | } | 12 | } |
| 13 | import tech.oxfordsemantic.jrdfox.formats.SPARQLParser | ||
| 14 | |||
| 12 | object RDFoxUtil { | 15 | object RDFoxUtil { |
| 13 | 16 | ||
| 14 | implicit def owlapi2rdfox(iri: org.semanticweb.owlapi.model.IRI): IRI = { | 17 | implicit def owlapi2rdfox(iri: org.semanticweb.owlapi.model.IRI): IRI = { |
| @@ -41,6 +44,14 @@ object RDFoxUtil { | |||
| 41 | (server, data) | 44 | (server, data) |
| 42 | } | 45 | } |
| 43 | 46 | ||
| 47 | def parseQuery(query: String): Query = { | ||
| 48 | val parser = new SPARQLParser( | ||
| 49 | RSA.Prefixes, | ||
| 50 | new ByteArrayInputStream(query.getBytes()) | ||
| 51 | ) | ||
| 52 | parser.parseSingleQuery() | ||
| 53 | } | ||
| 54 | |||
| 44 | def submitQuery( | 55 | def submitQuery( |
| 45 | data: DataStoreConnection, | 56 | data: DataStoreConnection, |
| 46 | prefixes: Prefixes, | 57 | prefixes: Prefixes, |
