aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala')
-rw-r--r--src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala b/src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala
index 6eecdbf..ba151d0 100644
--- a/src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala
+++ b/src/main/scala/rsacomb/RDFoxPropertyExprConverter.scala
@@ -5,24 +5,27 @@ import org.semanticweb.owlapi.model.OWLPropertyExpressionVisitorEx
5 5
6import tech.oxfordsemantic.jrdfox.logic.{Atom, Term, IRI, Literal} 6import tech.oxfordsemantic.jrdfox.logic.{Atom, Term, IRI, Literal}
7 7
8import rsacomb.SkolemStrategy
9import org.semanticweb.owlapi.model.OWLObjectInverseOf 8import org.semanticweb.owlapi.model.OWLObjectInverseOf
10 9
11class RDFoxPropertyExprConverter( 10class RDFoxPropertyExprConverter(
12 term1: Term, 11 term1: Term,
13 term2: Term, 12 term2: Term,
14 skolem: SkolemStrategy 13 suffix: RSASuffix
15) extends OWLPropertyExpressionVisitorEx[List[Atom]] { 14) extends OWLPropertyExpressionVisitorEx[List[Atom]] {
16 15
17 // Automatically converts OWLAPI types into RDFox equivalent types. 16 // Automatically converts OWLAPI types into RDFox equivalent types.
18 import RDFoxUtil.owlapi2rdfox; 17 import RDFoxUtil.owlapi2rdfox;
19 18
20 override def visit(expr: OWLObjectProperty): List[Atom] = 19 override def visit(expr: OWLObjectProperty): List[Atom] = {
21 List(Atom.rdf(term1, expr.getIRI, term2)) 20 val pred = IRI.create(expr.getIRI.getIRIString ++ suffix.getSuffix)
21 List(Atom.rdf(term1, pred, term2))
22 }
22 23
23 override def visit(expr: OWLObjectInverseOf): List[Atom] = { 24 override def visit(expr: OWLObjectInverseOf): List[Atom] = {
24 val name = expr.getInverse.getNamedProperty.getIRI.getIRIString; 25 val pred = IRI.create(
25 List(Atom.rdf(term1, IRI.create(name ++ "_inv"), term2)) 26 expr.getInverse.getNamedProperty.getIRI.getIRIString ++ suffix.getSuffix ++ "_inv"
27 )
28 List(Atom.rdf(term1, pred, term2))
26 } 29 }
27 30
28 def doDefault(expr: OWLPropertyExpression): List[Atom] = List() 31 def doDefault(expr: OWLPropertyExpression): List[Atom] = List()