diff options
| author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-09-23 19:59:06 +0200 |
|---|---|---|
| committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-09-23 19:59:06 +0200 |
| commit | 099cad0129edb9822cc6ccb044b2109834715bb9 (patch) | |
| tree | 66a8b2fb048467e6c65ecb2f43531f4051a6dcd3 /src/main/scala/rsacomb/RSA.scala | |
| parent | 5e1a39b0a4863268764de949d0f25d87fec00cce (diff) | |
| download | RSAComb-099cad0129edb9822cc6ccb044b2109834715bb9.tar.gz RSAComb-099cad0129edb9822cc6ccb044b2109834715bb9.zip | |
Add method to parse a string into a Query
This is using `SPARQLParser`, an undocumented class provided by JRDFox
Diffstat (limited to 'src/main/scala/rsacomb/RSA.scala')
| -rw-r--r-- | src/main/scala/rsacomb/RSA.scala | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/main/scala/rsacomb/RSA.scala b/src/main/scala/rsacomb/RSA.scala index 9125f9f..edabc6a 100644 --- a/src/main/scala/rsacomb/RSA.scala +++ b/src/main/scala/rsacomb/RSA.scala | |||
| @@ -4,6 +4,7 @@ package rsacomb | |||
| 4 | import java.io.File | 4 | import java.io.File |
| 5 | import java.util.Map | 5 | import java.util.Map |
| 6 | 6 | ||
| 7 | import tech.oxfordsemantic.jrdfox.formats.SPARQLParser | ||
| 7 | import tech.oxfordsemantic.jrdfox.Prefixes | 8 | import tech.oxfordsemantic.jrdfox.Prefixes |
| 8 | import tech.oxfordsemantic.jrdfox.logic.IRI | 9 | import tech.oxfordsemantic.jrdfox.logic.IRI |
| 9 | import org.semanticweb.owlapi.apibinding.OWLManager | 10 | import org.semanticweb.owlapi.apibinding.OWLManager |
| @@ -38,18 +39,6 @@ object RSA extends RSAOntology { | |||
| 38 | Variable.create(f"I$counter%03d") | 39 | Variable.create(f"I$counter%03d") |
| 39 | } | 40 | } |
| 40 | 41 | ||
| 41 | val varX = Variable.create("X") | ||
| 42 | val varY = Variable.create("Y") | ||
| 43 | val varZ = Variable.create("Z") | ||
| 44 | val testAnswerVars = List[Variable](varX, varY, varZ).asJava; | ||
| 45 | val testFormula: Formula = | ||
| 46 | Conjunction.create( | ||
| 47 | Atom.rdf(varX, IRI.TOP_OBJECT_PROPERTY, varY), | ||
| 48 | Atom.rdf(varY, IRI.TOP_OBJECT_PROPERTY, varZ) | ||
| 49 | ) | ||
| 50 | val test_query = | ||
| 51 | Query.create(QueryType.SELECT, false, testAnswerVars, testFormula) | ||
| 52 | |||
| 53 | def internal(name: Any): IRI = | 42 | def internal(name: Any): IRI = |
| 54 | IRI.create( | 43 | IRI.create( |
| 55 | Prefixes.getPrefixIRIsByPrefixName.get("internal:").getIRI | 44 | Prefixes.getPrefixIRIsByPrefixName.get("internal:").getIRI |
