As a Wikidata editor, I want to be able to query for entity usage in SPARQL, through MWAPI. (Brought up here.)
As a developer, I want API modules that advertise themselves as being possible generators to be usable as generators, instead of producing errors in production.
Problem:
Wikibase Client’s wblistentityusage Action API module produces a RuntimeException when it’s used as a generator.
RuntimeException from line 306 of /srv/mediawiki/php-1.35.0-wmf.34/includes/api/ApiResult.php: Conflicting keys (31880) when attempting to merge element pages #0 /srv/mediawiki/php-1.35.0-wmf.34/includes/api/ApiResult.php(412): ApiResult::setValue(array, string, array, integer) #1 /srv/mediawiki/php-1.35.0-wmf.34/includes/api/ApiQuery.php(426): ApiResult->addValue(string, string, array) #2 /srv/mediawiki/php-1.35.0-wmf.34/includes/api/ApiQuery.php(251): ApiQuery->outputGeneralPageInfo() #3 /srv/mediawiki/php-1.35.0-wmf.34/includes/api/ApiMain.php(1583): ApiQuery->execute() #4 /srv/mediawiki/php-1.35.0-wmf.34/includes/api/ApiMain.php(523): ApiMain->executeAction() #5 /srv/mediawiki/php-1.35.0-wmf.34/includes/api/ApiMain.php(494): ApiMain->executeActionWithErrorHandling() #6 /srv/mediawiki/php-1.35.0-wmf.34/api.php(84): ApiMain->execute() #7 /srv/mediawiki/w/api.php(3): require(string) #8 {main}
The number of conflicting keys (apparently page IDs) reported varies with the gwbeulimit:
https://en.wikipedia.org/w/api.php?action=query&format=json&generator=wblistentityusage&gwbeuentities=Q1&gwbeulimit=5
Conflicting keys (31880, 23674715) when attempting to merge element pages
Screenshots/mockups:
BDD
GIVEN
AND
WHEN
AND
THEN
AND
Acceptance criteria:
- The API module can be used as a generator.
Open questions: