aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala
index 1ff466b..5ae0227 100644
--- a/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala
+++ b/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala
@@ -407,13 +407,14 @@ class RSAOntology(
407 * behaviour is incompatible with other needed features like 407 * behaviour is incompatible with other needed features like
408 * negation-as-failure and aggregates. 408 * negation-as-failure and aggregates.
409 * 409 *
410 * @todo to complete the equality axiomatization we need to introduce 410 * @todo naïve substitution rules might not be very efficient. We
411 * substitution rules to explicate a complete "equality" semantics. 411 * should look into other ways of implementing this.
412 */ 412 */
413 private val equalityAxioms: List[Rule] = { 413 private val equalityAxioms: List[Rule] = {
414 val varX = Variable.create("X") 414 val varX = Variable.create("X")
415 val varY = Variable.create("Y") 415 val varY = Variable.create("Y")
416 val varZ = Variable.create("Z") 416 val varZ = Variable.create("Z")
417 val varW = Variable.create("W")
417 val graph = TupleTableName.create(RSAOntology.CanonGraph.getIRI) 418 val graph = TupleTableName.create(RSAOntology.CanonGraph.getIRI)
418 // Equality properties 419 // Equality properties
419 val properties = List( 420 val properties = List(
@@ -434,6 +435,32 @@ class RSAOntology(
434 TupleTableAtom.create(graph, varY, RSA.CONGRUENT, varZ) 435 TupleTableAtom.create(graph, varY, RSA.CONGRUENT, varZ)
435 ) 436 )
436 ) 437 )
438 /* Equality substitution rules */
439 val substitutions =
440 Rule.create(
441 TupleTableAtom.create(graph, varY, IRI.RDF_TYPE, varZ),
442 TupleTableAtom.create(graph, varX, RSA.CONGRUENT, varY),
443 TupleTableAtom.create(graph, varX, IRI.RDF_TYPE, varZ)
444 ) :: objroles.flatMap(r => {
445 val name = r match {
446 case x: OWLObjectProperty => x.getIRI.getIRIString
447 case x: OWLObjectInverseOf =>
448 x.getInverse.getNamedProperty.getIRI.getIRIString :: Inverse
449 }
450 List(
451 Rule.create(
452 TupleTableAtom.create(graph, varZ, name, varY),
453 TupleTableAtom.create(graph, varX, RSA.CONGRUENT, varZ),
454 TupleTableAtom.create(graph, varX, name, varY)
455 ),
456 Rule.create(
457 TupleTableAtom.create(graph, varY, name, varZ),
458 TupleTableAtom.create(graph, varX, RSA.CONGRUENT, varZ),
459 TupleTableAtom.create(graph, varY, name, varX)
460 )
461 )
462 })
463 properties ++ substitutions
437 } 464 }
438 465
439 /** Canonical model of the ontology */ 466 /** Canonical model of the ontology */