diff options
author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-08-19 11:11:53 +0100 |
---|---|---|
committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-08-19 11:11:53 +0100 |
commit | 3a166085e656be5f957423e6e371b6647b313997 (patch) | |
tree | cc3486d5bde7dc692ee71948fd03e907b7badc7f /src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala | |
parent | 56a3cc7f1a2d1dc85a262f2648cf246197684caf (diff) | |
download | RSAComb-3a166085e656be5f957423e6e371b6647b313997.tar.gz RSAComb-3a166085e656be5f957423e6e371b6647b313997.zip |
Use `rdf(..)` instead of `create(..)` to create `Atom`s
Diffstat (limited to 'src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala')
-rw-r--r-- | src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala b/src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala index 78ac98c..340fa90 100644 --- a/src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala +++ b/src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala | |||
@@ -3,29 +3,28 @@ package rsacomb | |||
3 | import org.semanticweb.owlapi.model.{OWLPropertyExpression, OWLObjectProperty} | 3 | import org.semanticweb.owlapi.model.{OWLPropertyExpression, OWLObjectProperty} |
4 | import org.semanticweb.owlapi.model.OWLPropertyExpressionVisitorEx | 4 | import org.semanticweb.owlapi.model.OWLPropertyExpressionVisitorEx |
5 | 5 | ||
6 | import tech.oxfordsemantic.jrdfox.logic.{TupleTableName} | 6 | import tech.oxfordsemantic.jrdfox.logic.{Atom, Term, IRI, Variable, Literal} |
7 | import tech.oxfordsemantic.jrdfox.logic.{Atom, Term, Variable, Literal} | ||
8 | 7 | ||
9 | import rsacomb.SkolemStrategy | 8 | import rsacomb.SkolemStrategy |
10 | import org.semanticweb.owlapi.model.OWLObjectInverseOf | 9 | import org.semanticweb.owlapi.model.OWLObjectInverseOf |
11 | 10 | ||
12 | class RDFoxPropertyExprConverter(term1 : Term, term2 : Term, skolem : SkolemStrategy) | 11 | class RDFoxPropertyExprConverter( |
13 | extends OWLPropertyExpressionVisitorEx[List[Atom]] | 12 | term1: Term, |
14 | { | 13 | term2: Term, |
14 | skolem: SkolemStrategy | ||
15 | ) extends OWLPropertyExpressionVisitorEx[List[Atom]] { | ||
15 | 16 | ||
16 | override | 17 | // Automatically converts OWLAPI types into RDFox equivalent types. |
17 | def visit(expr : OWLObjectProperty) : List[Atom] = { | 18 | import RDFoxUtil.owlapi2rdfox; |
18 | val name = expr.getIRI.getIRIString | 19 | |
19 | List(Atom.create(TupleTableName.create(name), term1, term2)) | 20 | override def visit(expr: OWLObjectProperty): List[Atom] = |
20 | } | 21 | List(Atom.rdf(term1, expr.getIRI, term2)) |
21 | 22 | ||
22 | override | 23 | override def visit(expr: OWLObjectInverseOf): List[Atom] = { |
23 | def visit(expr : OWLObjectInverseOf) : List[Atom] = { | ||
24 | val name = expr.getInverse.getNamedProperty.getIRI.getIRIString; | 24 | val name = expr.getInverse.getNamedProperty.getIRI.getIRIString; |
25 | List(Atom.create(TupleTableName.create(name ++ "_inv"), term1, term2)) | 25 | List(Atom.rdf(term1, IRI.create(name ++ "_inv"), term2)) |
26 | } | 26 | } |
27 | 27 | ||
28 | def doDefault(expr : OWLPropertyExpression) : List[Atom] = List() | 28 | def doDefault(expr: OWLPropertyExpression): List[Atom] = List() |
29 | 29 | ||
30 | } // class RDFoxPropertyExprConverter | 30 | } // class RDFoxPropertyExprConverter |
31 | |||