Page MenuHomePhabricator

Wikibase RDF output does not link to the same blank node truthy statement values and the value from the reified statement
Closed, DeclinedPublic

Description

In https://www.wikidata.org/wiki/Special:EntityData/Q17619314.ttl

We see that the truthy triple uses genid2:

wd:Q17619314 rdfs:label "Kléber Andrac"@fr ;
	wdt:P268 _:genid2 ;

But the reified one uses genid4:

s:Q17619314-5cd290f5-4659-e699-74b9-52714a955c62 a wikibase:Statement,
		wikibase:BestRank ;
	wikibase:rank wikibase:NormalRank ;
	ps:P268 _:genid4 ;
	pq:P813 "2016-03-14T00:00:00Z"^^xsd:dateTime ;
	pqv:P813 v:bcddb148b45928cdcf857b69eeb88df9 .

If I understand the source model correctly this should be the same 'unknown value' and the query:

SELECT ?unknownValue1 ?unknownValue2 WHERE {
  wd:Q17619314 p:P268 ?reifiedStmt .
  ?reifiedStmt ps:P268 ?unknownValue1 .
  wd:Q17619314 wdt:P268 ?unknownValue2
}

should return the same bnode for ?unknownValue1 and ?unknownValue2.

Event Timeline

I don’t think this is a bug… at least the example in the RDF dump format documentation uses different IDs as well:

wd:Q3 a wikibase:Item, p:P2 _:genid1 .
wds:Q3-45abf5ca-4ebf-eb52-ca26-811152eb067c a wikibase:Statement ;
    ps:P2 _:genid2 ;
    wikibase:rank wikibase:NormalRank .

unrelated but the doc seems incorrect, p:P2 should be used to link the reified statement ID not its value, wdt:P2 should be used for direct value links.
As for this particular issue I feel that it is slightly incorrect to use a different bnode since when this value will be discovered it cannot be different since it is the same thing.