aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala
diff options
context:
space:
mode:
authorFederico Igne <federico.igne@cs.ox.ac.uk>2020-11-05 20:00:34 +0000
committerFederico Igne <federico.igne@cs.ox.ac.uk>2020-11-05 20:00:34 +0000
commit360675d5b659ba8e9e5fe83dfa038d27f962b4de (patch)
tree38e21ad6270da7c85f1d0069ced18dd9aea12045 /src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala
parent6df3ffe815a5ea65da92e818c1eb48fca13bc5ce (diff)
downloadRSAComb-360675d5b659ba8e9e5fe83dfa038d27f962b4de.tar.gz
RSAComb-360675d5b659ba8e9e5fe83dfa038d27f962b4de.zip
Update code to RDFox v4.0
Diffstat (limited to 'src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala')
-rw-r--r--src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala b/src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala
index ba151d0..11d6d86 100644
--- a/src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala
+++ b/src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala
@@ -3,7 +3,8 @@ package rsacomb
3import org.semanticweb.owlapi.model.{OWLPropertyExpression, OWLObjectProperty} 3import org.semanticweb.owlapi.model.{OWLPropertyExpression, OWLObjectProperty}
4import org.semanticweb.owlapi.model.OWLPropertyExpressionVisitorEx 4import org.semanticweb.owlapi.model.OWLPropertyExpressionVisitorEx
5 5
6import tech.oxfordsemantic.jrdfox.logic.{Atom, Term, IRI, Literal} 6import tech.oxfordsemantic.jrdfox.logic.datalog.TupleTableAtom
7import tech.oxfordsemantic.jrdfox.logic.expression.{Term, IRI, Literal}
7 8
8import org.semanticweb.owlapi.model.OWLObjectInverseOf 9import org.semanticweb.owlapi.model.OWLObjectInverseOf
9 10
@@ -11,23 +12,23 @@ class RDFoxPropertyExprConverter(
11 term1: Term, 12 term1: Term,
12 term2: Term, 13 term2: Term,
13 suffix: RSASuffix 14 suffix: RSASuffix
14) extends OWLPropertyExpressionVisitorEx[List[Atom]] { 15) extends OWLPropertyExpressionVisitorEx[List[TupleTableAtom]] {
15 16
16 // Automatically converts OWLAPI types into RDFox equivalent types. 17 // Automatically converts OWLAPI types into RDFox equivalent types.
17 import RDFoxUtil.owlapi2rdfox; 18 import RDFoxUtil.owlapi2rdfox;
18 19
19 override def visit(expr: OWLObjectProperty): List[Atom] = { 20 override def visit(expr: OWLObjectProperty): List[TupleTableAtom] = {
20 val pred = IRI.create(expr.getIRI.getIRIString ++ suffix.getSuffix) 21 val pred = IRI.create(expr.getIRI.getIRIString ++ suffix.getSuffix)
21 List(Atom.rdf(term1, pred, term2)) 22 List(TupleTableAtom.rdf(term1, pred, term2))
22 } 23 }
23 24
24 override def visit(expr: OWLObjectInverseOf): List[Atom] = { 25 override def visit(expr: OWLObjectInverseOf): List[TupleTableAtom] = {
25 val pred = IRI.create( 26 val pred = IRI.create(
26 expr.getInverse.getNamedProperty.getIRI.getIRIString ++ suffix.getSuffix ++ "_inv" 27 expr.getInverse.getNamedProperty.getIRI.getIRIString ++ suffix.getSuffix ++ "_inv"
27 ) 28 )
28 List(Atom.rdf(term1, pred, term2)) 29 List(TupleTableAtom.rdf(term1, pred, term2))
29 } 30 }
30 31
31 def doDefault(expr: OWLPropertyExpression): List[Atom] = List() 32 def doDefault(expr: OWLPropertyExpression): List[TupleTableAtom] = List()
32 33
33} // class RDFoxPropertyExprConverter 34} // class RDFoxPropertyExprConverter