I am trying to add a simple rule to the builtin RDFSPlus (Optimized) ruleset to be able to have GraphDB generate inferred (implicit) statements from RDF* assertions.
Specifically, referring to GraphDB example here https://graphdb.ontotext.com/documentation/9.4/free/devhub/rdf-sparql-star.html, starting from these assertions:
:hasSpouse a owl:ObjectProperty ,
owl:SymmetricProperty .
:man :hasSpouse :woman .
<<:man :hasSpouse :woman>> :startDate "2020-02-11"^^xsd:date .
I would like to have the GraphDB reasoning engine to infer these two statements:
:woman :hasSpouse :man .
<<:woman :hasSpouse :man>> :startDate "2020-02-11"^^xsd:date .
No problem for GraphDB to generate the first one (obviously), but the RDF* one is proving a little tricky.
First I tried to add this rule to a copy of the builtin RDFSPlus (Optimized):
Id: owl_rdfstarOverSym
a b c
b <rdf:type> <owl:SymmetricProperty>
<<a b c>> p q
------------------------------------
<<c b a>> p q
In this case I was not able to create the repository; GraphDB console showed this exception:
Error in rule 'owl_rdfstarOverSym'. Invalid identifier: '>'
I then tried to add the rule with only one '<' and '>', like this:
Id: owl_rdfstarOverSym
a b c
b <rdf:type> <owl:SymmetricProperty>
<a b c> p q
------------------------------------
<c b a> p q
GraphDB seemed to be able to create the repository, however trying to use SPARQL results in this error message: 'Failed initializing inferencer', and the GraphDB console shows this exception:
Invalid entity: 'c b a'
All these tests were run with GraphDB free edition: Version: 9.3, revision: 41892658
Thanks in advance,
Franco
As Damyan Ognyanov stated in his comment (GraphDB custom ruleset for inference over RDF* statements), what I was trying to do is not possible with GraphDB rule language.