Hello all,
I'm looking for strategies to preserve reified statements when inferring new triples via reasoning. The data model I'm working with requires strict provenance tracking on all statements, which stardog's native reification functionality handles well. I'm hoping to find a path to associate inferred triples with the reified statements of the asserted triples from which they were inferred.
E.g., given the following toy ontology
:Person a owl:Class .
:Company a owl:Class .
:shareholderOf a owl:ObjectProperty ;
rdfs:domain :Person ;
rdfs:range :Componany ;
rdfs:label "Shareholder Of" .
:hasShareholder owl:inverseOf :shareholderOf ;
rdfs:label "Has Shareholder" .
:personA :shareholderOf :companyB .
and inserting the following provenance data
INSERT { ?statement prov:wasAttributedTo :userC }
WHERE { BIND(stardog:identifier(:personA, :shareholderOf, :companyB) as ?statement) }
I can retrieve both the original asserted :shareholderOf
and, using reasoning, the inferred :hasShareholder
triples, e.g. via select * where { ?s :shareholderOf|:hasShareholder ?o }
.
Also, I can retrieve the provenance data for the original asserted :shareholderOf
statement with
SELECT * WHERE {
:personA :shareholderOf ?o
BIND(stardog:identifier(:personA, :shareholderOf, ?o) as ?statement)
?statement prov:wasAttributedTo ?attribution
}
> ?o :companyB, ?attribution :userC
However, not surprisingly, asking the same question of the inferred :hasShareholder
statement does not retrieve anything
SELECT * WHERE {
:companyB :hasShareholder ?o
BIND(stardog:identifier(:companyB, :hasShareholder, ?o) as ?statement)
?statement :wasAttributedTo ?attribution
}
I'm wondering if there's a way to, generally, match inferred statements w/ the reified statements from which they were derived. Perhaps by building a proof tree to discover the original statements. Curious if anyone has any thoughts about the approach. Open to using any of the APIs.