There are a lot of items that have wikibase:statements set to 0 but actually do have statements (mostly one statement). It may be caused by page props not being up-to-date when update happens.
SELECT distinct ?item ?p WHERE { ?item wikibase:statements 0 . ?item ?p [] . FILTER(?p != rdfs:label && ?p != schema:description && ?p != schema:version && ?p != schema:dateModified && ?p != skos:altLabel && ?p != wikibase:statements && ?p != wikibase:sitelinks) }
It is due to secondary data stored by Wikibase in page_props that is used to generate RDF data of Wikibase items is incorrect at the point of time the RDF is generated.
page_props is updated asynchronously. It might only get updated with the statement count after the RDF updater has dumped the edited item
There are also cases when page_props are not updated at all - those issues are not part of this task
Acceptance criteria
- statement count in the RDF output is based on the count at the point of generating the output, and not read from the secondary database table
See also: T149239: Ensure consistency of secondary data for external consumers
Notes:
- The “statement count” is not as simple as counting the entity’s own statements – for lexemes, it includes the statements of all senses and forms. Make sure to use the same code that also generates the page prop, so that whatever mechanism WikibaseLexeme uses to count those statements is also used when generating the count for RDF.