Page MenuHomePhabricator

Wikidata Query Service MWAPI calls with bd:serviceParam wikibase:limit "once" execute 2 API calls instead of 1
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:

Example 1: Run this query

SELECT *
WHERE
{
  SERVICE wikibase:mwapi
  {
    bd:serviceParam wikibase:api "Generator".
    bd:serviceParam wikibase:endpoint "en.wikipedia.org".
    bd:serviceParam wikibase:limit "once".
    bd:serviceParam mwapi:generator "allpages".
    bd:serviceParam mwapi:gapfrom "Cat".
    bd:serviceParam mwapi:gaplimit "1".
    ?item wikibase:apiOutputItem mwapi:item.
    ?title wikibase:apiOutput mwapi:title.
    ?length wikibase:apiOutput "@length".
  }
}

Example 2: Run this query

SELECT *
WHERE
{
  SERVICE wikibase:mwapi
  {
    bd:serviceParam wikibase:api "Generator".
    bd:serviceParam wikibase:endpoint "en.wikipedia.org".
    bd:serviceParam wikibase:limit "once".
    bd:serviceParam mwapi:generator "allpages".
    bd:serviceParam mwapi:gapfrom "Cat".
    bd:serviceParam mwapi:gaplimit "2".
    ?item wikibase:apiOutputItem mwapi:item.
    ?title wikibase:apiOutput mwapi:title.
    ?length wikibase:apiOutput "@length".
  }
}

Actual Results:

Example 1: A table with 2 results

Example 2: A table with 4 results

Expected Results:

Example 1: A table with 1 result because the API call gives 1 result due to the use of gaplimit. The API call is: https://en.wikipedia.org/w/api.php?action=query&generator=allpages&gapfrom=Cat&gaplimit=1&prop=info|pageprops&ppprop=wikibase_item&format=xml

Example 2: A table with 2 results because the API call gives 2 results due to the use of gaplimit: The API call is: https://en.wikipedia.org/w/api.php?action=query&generator=allpages&gapfrom=Cat&gaplimit=2&prop=info|pageprops&ppprop=wikibase_item&format=xml

No continuation API calls should be run due to

bd:serviceParam wikibase:limit "once".

in both examples but in seems like one continuation call was made in both examples giving twice as many results as expected.

Event Timeline

Restricted Application added a project: Wikidata. · View Herald TranscriptJun 18 2020, 9:22 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 606402 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[wikidata/query/rdf@master] Fix continuation limits

https://gerrit.wikimedia.org/r/606402

Looks like I broke this in I4ec2617565 – remarkable that it took so long for someone to notice :D the above change should fix it.

Change 606402 merged by jenkins-bot:
[wikidata/query/rdf@master] Fix continuation limits

https://gerrit.wikimedia.org/r/606402

dcausse triaged this task as Medium priority.Jun 22 2020, 6:38 AM
dcausse moved this task from All WDQS-related tasks to Small Bugs on the Wikidata-Query-Service board.
dcausse moved this task from Incoming to To Be Deployed on the Discovery-Search (Current work) board.
Aklapper renamed this task from Wikidata Query Servie MWAPI calls with bd:serviceParam wikibase:limit "once" . executes 2 API calls instead of 1 to Wikidata Query Service MWAPI calls with bd:serviceParam wikibase:limit "once" execute 2 API calls instead of 1.Jun 22 2020, 9:01 AM
Gehel closed this task as Resolved.Jul 13 2020, 12:48 PM
Gehel added a subscriber: Gehel.

The fix has been deployed, please re-open if you still see the issue.