I am trying to define the following inference rule for Apache Jena. I am using a GeneralRuleReasoner in hybrid mode
[ aName:
(?aRelation meta:refersTo meta:SomeOntologyClass)
(?test rdfs:type dummy)
-> (?anotherRelation rdfs:type meta:SomeType)
(?anotherRelation meta:mainLabel "a"@fr)
(?anotherRelation meta:mainLabel "b"@en)
(?anotherRelation meta:mainLabel "c"@de)
(?anotherRelation rdfs:label "a"@fr)
(?anotherRelation rdfs:label "b"@en)
(?anotherRelation rdfs:label "c"@de)
(?test meta:has ?anotherRelation)
]
I also tried the same with single quotes. This fails with this error:
[error] - 2020-01-23 17:10:14,655 [play-dev-mode-akka.actor.default-dispatcher-58] ERROR controllers.IndexController - Triple with 4 nodes!
I also tried to define it like
[ aName:
(?aRelation meta:refersTo meta:SomeOntologyClass)
(?test rdfs:type dummy)
-> (?anotherRelation rdfs:type meta:SomeType)
(?anotherRelation meta:mainLabel "a" lang:fr)
(?anotherRelation meta:mainLabel "b" lang:en)
(?anotherRelation meta:mainLabel "c" lang:de)
(?anotherRelation rdfs:label "a" lang:fr)
(?anotherRelation rdfs:label "b" lang:en)
(?anotherRelation rdfs:label "c" lang:de)
(?test meta:has ?anotherRelation)
]
This does not really work since apparently lang
only works for query DSL.
I also tried doing the following: I defined another class in the ontology that carries the labels and main labels that I cannot define in the inference rule and add a onto:
property to
the derived class.
[ aName:
(?aRelation meta:refersTo meta:SomeOntologyClass)
(?test rdfs:type dummy)
-> (?anotherRelation rdfs:type meta:SomeType)
(?anotherRelation meta:refersTo onto:UtilityClassCarryngLabels)
(?test meta:has ?anotherRelation)
]
This works in the sense that the inference rule IS created BUT when tried to query (SPARQL) for the triples, neither the labels not the main labels for the derived class came up. Nevertheless, I can see that anotherR
has been correlated with test
.
So my question is: What is the right way to define labels(including language specification) in an inference rule?