Description
For provenance purposes, it is important to know which Store
each Statement
refers to. This is especially interesting for cases of federated queries (filters
) where the retrieved statements are retrieved from different data sources. However, the recovery of this information must be conditioned to a flag, allowing the user to choose when they want to see this data or not.
Currently it is possible to have similar behavior using extra references like this:
import kif_lib.vocabulary as wd
from kif_lib import *
kb1 = Store('sparql', 'https://query.wikidata.org/sparql')
kb1.extra_references = [ReferenceRecord(wd.stated_in('kb1'))]
kb2 = Store('sparql', kb1.iri)
kb2.extra_references = [ReferenceRecord(wd.stated_in('kb2'))]
mx = Store('mixer', [kb1, kb2])
for stmt, annots in mx.filter_annotated(wd.Brazil, limit=1):
print(stmt)
print()
print(annots)
However, it should be a standardized information user-independent. User should control only when they want to access or not this data. Besides, currently there is no way to distinguish this annotation from others coming from the data source plugged in a Store. That is, suppose that exist in Wikidata a reference saying that the entity wd.Brazil
is stated in (wd.stated_in
) DBPedia, programmatically it would be difficult to differentiate this information from the one created by the user.
This issue is for discussing and developing this standardized way to retrieve the store provenance about statements.