diff options
| author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-11-05 20:00:34 +0000 |
|---|---|---|
| committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-11-05 20:00:34 +0000 |
| commit | 360675d5b659ba8e9e5fe83dfa038d27f962b4de (patch) | |
| tree | 38e21ad6270da7c85f1d0069ced18dd9aea12045 /src/main/scala/rsacomb/RDFoxClassExprConverter.scala | |
| parent | 6df3ffe815a5ea65da92e818c1eb48fca13bc5ce (diff) | |
| download | RSAComb-360675d5b659ba8e9e5fe83dfa038d27f962b4de.tar.gz RSAComb-360675d5b659ba8e9e5fe83dfa038d27f962b4de.zip | |
Update code to RDFox v4.0
Diffstat (limited to 'src/main/scala/rsacomb/RDFoxClassExprConverter.scala')
| -rw-r--r-- | src/main/scala/rsacomb/RDFoxClassExprConverter.scala | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/main/scala/rsacomb/RDFoxClassExprConverter.scala b/src/main/scala/rsacomb/RDFoxClassExprConverter.scala index f07e3c6..de0f623 100644 --- a/src/main/scala/rsacomb/RDFoxClassExprConverter.scala +++ b/src/main/scala/rsacomb/RDFoxClassExprConverter.scala | |||
| @@ -12,17 +12,16 @@ import org.semanticweb.owlapi.model.{ | |||
| 12 | OWLObjectMaxCardinality | 12 | OWLObjectMaxCardinality |
| 13 | } | 13 | } |
| 14 | import org.semanticweb.owlapi.model.OWLClassExpressionVisitorEx | 14 | import org.semanticweb.owlapi.model.OWLClassExpressionVisitorEx |
| 15 | import tech.oxfordsemantic.jrdfox.logic.{ | 15 | import tech.oxfordsemantic.jrdfox.logic.Datatype |
| 16 | import tech.oxfordsemantic.jrdfox.logic.datalog.{ | ||
| 16 | BindAtom, | 17 | BindAtom, |
| 17 | BuiltinFunctionCall, | 18 | TupleTableName, |
| 18 | TupleTableName | 19 | TupleTableAtom |
| 19 | } | 20 | } |
| 20 | import tech.oxfordsemantic.jrdfox.logic.{ | 21 | import tech.oxfordsemantic.jrdfox.logic.expression.{ |
| 21 | Atom, | ||
| 22 | Term, | 22 | Term, |
| 23 | Variable, | 23 | Variable, |
| 24 | Literal, | 24 | FunctionCall, |
| 25 | Datatype, | ||
| 26 | IRI | 25 | IRI |
| 27 | } | 26 | } |
| 28 | 27 | ||
| @@ -64,7 +63,7 @@ class RDFoxClassExprConverter( | |||
| 64 | // OWLClass | 63 | // OWLClass |
| 65 | override def visit(expr: OWLClass): RDFoxRuleShards = { | 64 | override def visit(expr: OWLClass): RDFoxRuleShards = { |
| 66 | val iri: IRI = if (expr.isTopEntity()) IRI.THING else expr.getIRI() | 65 | val iri: IRI = if (expr.isTopEntity()) IRI.THING else expr.getIRI() |
| 67 | val atom = List(Atom.rdf(term, IRI.RDF_TYPE, iri)) | 66 | val atom = List(TupleTableAtom.rdf(term, IRI.RDF_TYPE, iri)) |
| 68 | RDFoxRuleShards(atom, List()) | 67 | RDFoxRuleShards(atom, List()) |
| 69 | } | 68 | } |
| 70 | 69 | ||
| @@ -90,7 +89,7 @@ class RDFoxClassExprConverter( | |||
| 90 | .asOWLNamedIndividual | 89 | .asOWLNamedIndividual |
| 91 | .getIRI | 90 | .getIRI |
| 92 | val atom = List( | 91 | val atom = List( |
| 93 | Atom.sameAs(term, ind) | 92 | TupleTableAtom.rdf(term, IRI.SAME_AS, ind) |
| 94 | ) | 93 | ) |
| 95 | RDFoxRuleShards(atom, List()) | 94 | RDFoxRuleShards(atom, List()) |
| 96 | } | 95 | } |
| @@ -110,8 +109,8 @@ class RDFoxClassExprConverter( | |||
| 110 | if (unsafe.contains(prop)) | 109 | if (unsafe.contains(prop)) |
| 111 | ( | 110 | ( |
| 112 | List( | 111 | List( |
| 113 | Atom.rdf(term, RSA.internal("PE"), c), | 112 | TupleTableAtom.rdf(term, RSA.internal("PE"), c), |
| 114 | Atom.rdf(c, IRI.RDF_TYPE, RSA.internal("U")) | 113 | TupleTableAtom.rdf(c, IRI.RDF_TYPE, RSA.internal("U")) |
| 115 | ), | 114 | ), |
| 116 | List(), | 115 | List(), |
| 117 | c | 116 | c |
| @@ -124,7 +123,7 @@ class RDFoxClassExprConverter( | |||
| 124 | // a simple builtin function with a "special" name. | 123 | // a simple builtin function with a "special" name. |
| 125 | ( | 124 | ( |
| 126 | List(), | 125 | List(), |
| 127 | List(BindAtom.create(BuiltinFunctionCall.create("SKOLEM", term), y)), | 126 | List(BindAtom.create(FunctionCall.create("SKOLEM", term), y)), |
| 128 | y | 127 | y |
| 129 | ) | 128 | ) |
| 130 | } | 129 | } |
| @@ -154,7 +153,7 @@ class RDFoxClassExprConverter( | |||
| 154 | .map(expr.getProperty.accept(_)) | 153 | .map(expr.getProperty.accept(_)) |
| 155 | .flatten | 154 | .flatten |
| 156 | RDFoxRuleShards( | 155 | RDFoxRuleShards( |
| 157 | List(Atom.sameAs(vars(0), vars(1))), | 156 | List(TupleTableAtom.rdf(vars(0), IRI.SAME_AS, vars(1))), |
| 158 | classResult.res ++ propertyResult | 157 | classResult.res ++ propertyResult |
| 159 | ) | 158 | ) |
| 160 | } | 159 | } |
