Page MenuHomePhabricator

action=wbgetentities should contain information about redirect resolving
Closed, ResolvedPublic

Description

When query the action=wbgetentities api action with a id which is a redirect the api result does not contains information about the redirect resolving. This makes it impossible to remap ids on the client for further processing.

The normal action=query&titles= for example contains a redirect section with the information about from and to.

I am using format=xml which does not contain this information.
For format=json there is this information because the index for the array contains the old id and the id= property contains the new one.

Please add a resolving section. Thanks.

Details

Related Gerrit Patches:
mediawiki/extensions/Wikibase : masterAdd redirect info to wbgetentities result

Event Timeline

Umherirrender raised the priority of this task from to Needs Triage.
Umherirrender updated the task description. (Show Details)
Umherirrender added a subscriber: Umherirrender.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 7 2015, 5:21 PM
hoo set Security to None.
Lydia_Pintscher triaged this task as Medium priority.Feb 8 2015, 11:13 AM
Lydia_Pintscher added subscribers: daniel, aude, hoo and 2 others.

So for example ?action=wbgetentities&ids=Q4

{
    "entities": {
        "Q4": {
            "pageid": 1,
            "ns": 0,
            "title": "Q1",
            "lastrevid": 999,
            "modified": "2015-01-17T00:44:03Z",
            "id": "Q1",
            "type": "item",
            "redirected": "Q4",
            "labels": {
                "en": {
                    "language": "en",
                    "value": "some label"
                }
            }
        }
    }
}

Any objections to this format?

I would like something like this:

"redirects": [
    {
        "from": "Q2745924",
        "to": "Q1641487"
    }
],

http://www.wikidata.org/w/api.php?action=query&titles=q2745924&redirects=

These redirects seems to use the redirect table, that allows the use of ApiPageSet with its function getRedirectTitlesAsResult and possible getNormalizedTitlesAsResult to include also normalization (like q4 -> Q4)

Change 204758 had a related patch set uploaded (by Addshore):
Add redirect info to wbgetentities result

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

Addshore claimed this task.Apr 17 2015, 1:26 PM
hoo moved this task from Review to Done on the Wikidata-Sprint-2015-04-07 board.Apr 18 2015, 11:59 AM

Change 204758 merged by jenkins-bot:
Add redirect info to wbgetentities result

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

hoo closed this task as Resolved.Apr 18 2015, 12:00 PM
hoo removed a project: Patch-For-Review.