Last modified: 2012-12-13 11:22:41 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T44060, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42060 - wbgetitems/wbgetentities: api requests fail on multiple site/title pairs
wbgetitems/wbgetentities: api requests fail on multiple site/title pairs
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Unprioritized major (vote)
: ---
Assigned To: Wikidata bugs
storypoints: 2
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-13 10:36 UTC by merl
Modified: 2012-12-13 11:22 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Comment 1 jeblad 2012-11-13 19:57:21 UTC
This request has 19 sites and 14 titles. That will reuse the shortest array to fill the remaining entries for the sites.

I'm not sure why the titles comes back empty.
Comment 2 jeblad 2012-11-26 16:06:12 UTC
I localized the actual code, and this code sequence was changed after branch 0.1 was made. I guess the old code still have a bug. The new code will cyclic reuse missing titles and sites so it is possible to write something like

http://www.wikidata.org/w/api.php?action=wbgetitems&props=info&sites=enwiki&titles=Norge|Noreg|Norway|Norwegen

This will try the pairs
enwiki - Norge
enwiki - Noreg
enwiki - Norway
enwiki - Norwegen

and then return the found entity

<?xml version="1.0"?>
<api success="1">
  <entities>
    <entity site="enwiki" title="Norge" missing="" />
    <entity site="enwiki" title="Noreg" missing="" />
    <entity site="enwiki" title="Norwegen" missing="" />
    <entity pageid="127194" ns="0" title="Q5786" lastrevid="169682" modified="2012-11-26T15:47:43Z" id="q5786" type="item" />
  </entities>
</api>

The original code doesn't seem to handle overflow entries very well, but the newer code does work. In the previous case it seems like misbehaving code tried to get undefined site ids and titles.

Especially note the following case
http://wikidata-test-repo.wikimedia.de/w/api.php?action=wbgetentities&props=info&sites=enwiki|nnwiki|nowiki&titles=Norway|Noreg|Norge

Which will report a single found entity of type item

<?xml version="1.0"?>
<api success="1">
  <entities>
    <entity pageid="127194" ns="0" title="Q5786" lastrevid="169684" modified="2012-11-26T15:55:10Z" id="q5786" type="item" />
  </entities>
</api>
Comment 3 jeblad 2012-11-26 16:25:15 UTC
As an additional note the previous will produce sitelinks in the latest version on wikidata-test-repo

http://wikidata-test-repo.wikimedia.de/w/api.php?action=wbgetentities&props=sitelinks/urls|info&sites=enwiki|nnwiki|nowiki&titles=Norway|Noreg|Norge

<?xml version="1.0"?>
<api success="1">
  <entities>
    <entity pageid="127194" ns="0" title="Q5786" lastrevid="169684" modified="2012-11-26T15:55:10Z" id="q5786" type="item">
      <sitelinks>
        <sitelink site="enwiki" title="Norway" url="http://en.wikipedia.org/wiki/Norway" />
        <sitelink site="nnwiki" title="Noreg" url="http://nn.wikipedia.org/wiki/Noreg" />
        <sitelink site="nowiki" title="Norge" url="http://no.wikipedia.org/wiki/Norge" />
      </sitelinks>
    </entity>
  </entities>
</api>
Comment 4 jeblad 2012-11-26 16:32:40 UTC
Change I34abd62e: Minor cleanup to wbgetentities
Comment 5 abraham.taherivand 2012-11-29 15:14:26 UTC
Verified in Wikidata demo time for sprint 24

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links