Page MenuHomePhabricator

wbgetitems/wbgetentities: api requests fail on multiple site/title pairs
Closed, ResolvedPublic



Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:01 AM
bzimport set Reference to bz42060.
bzimport added a subscriber: Unknown Object (MLST).
Merl created this task.Nov 13 2012, 10:36 AM

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.

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|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">

  <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" />


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|nnwiki|nowiki&titles=Norway|Noreg|Norge

Which will report a single found entity of type item

<?xml version="1.0"?>
<api success="1">

  <entity pageid="127194" ns="0" title="Q5786" lastrevid="169684" modified="2012-11-26T15:55:10Z" id="q5786" type="item" />


As an additional note the previous will produce sitelinks in the latest version on wikidata-test-repo|info&sites=enwiki|nnwiki|nowiki&titles=Norway|Noreg|Norge

<?xml version="1.0"?>
<api success="1">

  <entity pageid="127194" ns="0" title="Q5786" lastrevid="169684" modified="2012-11-26T15:55:10Z" id="q5786" type="item">
      <sitelink site="enwiki" title="Norway" url="" />
      <sitelink site="nnwiki" title="Noreg" url="" />
      <sitelink site="nowiki" title="Norge" url="" />


Change I34abd62e: Minor cleanup to wbgetentities

Verified in Wikidata demo time for sprint 24

Restricted Application added a project: Wikidata. · View Herald TranscriptJan 28 2016, 6:11 PM
Restricted Application added a subscriber: StudiesWorld. · View Herald Transcript