aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Igne <federico.igne@cs.ox.ac.uk>2022-06-09 12:59:41 +0100
committerFederico Igne <federico.igne@cs.ox.ac.uk>2022-06-09 12:59:41 +0100
commit76e2dbd7a0d3a01d8ae71a015fa995c9c5032e37 (patch)
tree90c41950f8262b434e05663c05b9b1ffd017b1f3
parent6d88c664f94d25d5e697255909f471337c44985e (diff)
downloadRSAComb-76e2dbd7a0d3a01d8ae71a015fa995c9c5032e37.tar.gz
RSAComb-76e2dbd7a0d3a01d8ae71a015fa995c9c5032e37.zip
fix: forward/backward suffix for atoms
-rw-r--r--src/main/scala/uk/ac/ox/cs/rsacomb/suffix/RSASuffix.scala13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/suffix/RSASuffix.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/suffix/RSASuffix.scala
index 282aa0b..f9eab34 100644
--- a/src/main/scala/uk/ac/ox/cs/rsacomb/suffix/RSASuffix.scala
+++ b/src/main/scala/uk/ac/ox/cs/rsacomb/suffix/RSASuffix.scala
@@ -40,12 +40,13 @@ class RSASuffix(val suffix: String => String) {
40 def ::(iri: IRI): IRI = IRI.create(this suffix iri.getIRI) 40 def ::(iri: IRI): IRI = IRI.create(this suffix iri.getIRI)
41 def ::(tta: TupleTableAtom): TupleTableAtom = { 41 def ::(tta: TupleTableAtom): TupleTableAtom = {
42 val ttn: TupleTableName = tta.getTupleTableName 42 val ttn: TupleTableName = tta.getTupleTableName
43 tta.getArguments match { 43 val args = tta.getArguments
44 case List(subj: Term, IRI.RDF_TYPE, obj: IRI) => 44 (args.get(1), args.get(2)) match {
45 TupleTableAtom.create(ttn, subj, IRI.RDF_TYPE, obj :: this) 45 case (IRI.RDF_TYPE, obj: IRI) =>
46 case List(subj: Term, pred: IRI, obj: Term) => 46 TupleTableAtom.create(ttn, args.get(0), IRI.RDF_TYPE, obj :: this)
47 TupleTableAtom.create(ttn, subj, pred :: this, obj) 47 case (pred: IRI, obj: Term) =>
48 case _ => tta 48 TupleTableAtom.create(ttn, args.get(0), pred :: this, obj)
49 case _ => tta
49 } 50 }
50 } 51 }
51} 52}