diff options
author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-07-16 17:47:32 +0100 |
---|---|---|
committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-07-16 17:47:32 +0100 |
commit | 633529ca7a911646048886b7e2e0d1d98c94fdf3 (patch) | |
tree | 3137cdb01f023f5d345e32a07f1b60c165a519b5 /src/main/scala/rsacomb/RDFoxClassExprConverter.scala | |
parent | 95fa2a0090110a90d9a0f4948a4ced252d8ec111 (diff) | |
download | RSAComb-633529ca7a911646048886b7e2e0d1d98c94fdf3.tar.gz RSAComb-633529ca7a911646048886b7e2e0d1d98c94fdf3.zip |
Update to JRDFox v3.1.0
Diffstat (limited to 'src/main/scala/rsacomb/RDFoxClassExprConverter.scala')
-rw-r--r-- | src/main/scala/rsacomb/RDFoxClassExprConverter.scala | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/scala/rsacomb/RDFoxClassExprConverter.scala b/src/main/scala/rsacomb/RDFoxClassExprConverter.scala index 3e60461..bf026c3 100644 --- a/src/main/scala/rsacomb/RDFoxClassExprConverter.scala +++ b/src/main/scala/rsacomb/RDFoxClassExprConverter.scala | |||
@@ -5,8 +5,8 @@ import java.util.stream.{Stream,Collectors} | |||
5 | 5 | ||
6 | import org.semanticweb.owlapi.model.{OWLClassExpression, OWLClass, OWLObjectSomeValuesFrom, OWLObjectIntersectionOf, OWLObjectOneOf, OWLObjectMaxCardinality} | 6 | import org.semanticweb.owlapi.model.{OWLClassExpression, OWLClass, OWLObjectSomeValuesFrom, OWLObjectIntersectionOf, OWLObjectOneOf, OWLObjectMaxCardinality} |
7 | import org.semanticweb.owlapi.model.OWLClassExpressionVisitorEx | 7 | import org.semanticweb.owlapi.model.OWLClassExpressionVisitorEx |
8 | import tech.oxfordsemantic.jrdfox.logic.{AtomicFormula, Bind,BuiltinFunctionCall} | 8 | import tech.oxfordsemantic.jrdfox.logic.{BindAtom, BuiltinFunctionCall, TupleTableName} |
9 | import tech.oxfordsemantic.jrdfox.logic.{Atom, Predicate, Term, Variable, Literal, Individual} | 9 | import tech.oxfordsemantic.jrdfox.logic.{Atom, Term, Variable, Literal, Datatype} |
10 | 10 | ||
11 | import rsacomb.SkolemStrategy | 11 | import rsacomb.SkolemStrategy |
12 | import rsacomb.RDFoxRuleShards | 12 | import rsacomb.RDFoxRuleShards |
@@ -39,7 +39,7 @@ class RDFoxClassExprConverter(term : Term, skolem : SkolemStrategy) | |||
39 | override | 39 | override |
40 | def visit(expr : OWLClass) : RDFoxRuleShards = { | 40 | def visit(expr : OWLClass) : RDFoxRuleShards = { |
41 | val name = expr.getIRI.getIRIString | 41 | val name = expr.getIRI.getIRIString |
42 | val atom = List(Atom.create(Predicate.create(name), term)) | 42 | val atom = List(Atom.create(TupleTableName.create(name), term)) |
43 | RDFoxRuleShards(atom,List()) | 43 | RDFoxRuleShards(atom,List()) |
44 | } | 44 | } |
45 | 45 | ||
@@ -64,7 +64,7 @@ class RDFoxClassExprConverter(term : Term, skolem : SkolemStrategy) | |||
64 | .head // restricts to proper "nominals" | 64 | .head // restricts to proper "nominals" |
65 | .asOWLNamedIndividual.getIRI.getIRIString | 65 | .asOWLNamedIndividual.getIRI.getIRIString |
66 | val atom = List(Atom.create( | 66 | val atom = List(Atom.create( |
67 | Predicate.create("owl:sameAs"), term, Individual.create(ind) | 67 | TupleTableName.create("owl:sameAs"), term, Literal.create(ind, Datatype.IRI_REFERENCE) |
68 | )) | 68 | )) |
69 | RDFoxRuleShards(atom,List()) | 69 | RDFoxRuleShards(atom,List()) |
70 | } | 70 | } |
@@ -77,12 +77,12 @@ class RDFoxClassExprConverter(term : Term, skolem : SkolemStrategy) | |||
77 | val y = Variable.create("y") | 77 | val y = Variable.create("y") |
78 | val (fun,term1) = skolem match { | 78 | val (fun,term1) = skolem match { |
79 | case SkolemStrategy.None => (List(),y) | 79 | case SkolemStrategy.None => (List(),y) |
80 | case SkolemStrategy.Constant(c) => (List(), Individual.create(c)) | 80 | case SkolemStrategy.Constant(c) => (List(), Literal.create(c, Datatype.IRI_REFERENCE)) |
81 | case SkolemStrategy.Standard(f) => | 81 | case SkolemStrategy.Standard(f) => |
82 | // At the time of writing the RDFox library does not have a | 82 | // At the time of writing the RDFox library does not have a |
83 | // particular class for the "SKOLEM" operator and it is instead | 83 | // particular class for the "SKOLEM" operator and it is instead |
84 | // a simple builtin function with a special name. | 84 | // a simple builtin function with a special name. |
85 | (List(Bind.create(BuiltinFunctionCall.create("SKOLEM",term),y)),y) | 85 | (List(BindAtom.create(BuiltinFunctionCall.create("SKOLEM",term),y)),y) |
86 | } | 86 | } |
87 | val classVisitor = new RDFoxClassExprConverter(term1,skolem) | 87 | val classVisitor = new RDFoxClassExprConverter(term1,skolem) |
88 | val classResult = expr.getFiller.accept(classVisitor) | 88 | val classResult = expr.getFiller.accept(classVisitor) |
@@ -108,7 +108,7 @@ class RDFoxClassExprConverter(term : Term, skolem : SkolemStrategy) | |||
108 | .map(expr.getProperty.accept(_)) | 108 | .map(expr.getProperty.accept(_)) |
109 | .flatten | 109 | .flatten |
110 | RDFoxRuleShards( | 110 | RDFoxRuleShards( |
111 | List(Atom.create(Predicate.create("owl:sameAs"),vars(0),vars(1))), | 111 | List(Atom.create(TupleTableName.create("owl:sameAs"),vars(0),vars(1))), |
112 | classResult.res ++ propertyResult | 112 | classResult.res ++ propertyResult |
113 | ) | 113 | ) |
114 | } | 114 | } |