How to get interlanguage ilink from MediaWiki API

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get interlanguage ilink from MediaWiki API

Jiang BIAN
Hi MediaWiki developers,

I noticed that on en.wikipedia.org, interlanguage wikilinks are gone, possibly due to this change: http://blog.wikimedia.de/2013/02/13/wikidata-live-on-the-english-wikipedia/.

Our project is still working with old interlanguage link (parsing "[[en:Proxy server]]"). Is there other way to get the interlanguage link besides talking with www.wikidata.org
The example in API doc seems return a wrong result: https://en.wikipedia.org/w/api.php?action=query&titles=Albert%20Einstein&prop=langlinks (Albert Einstein contains so many interlanguage link).


Thanks


--
Jiang BIAN

This email may be confidential or privileged.  If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it went to the wrong person.  Thanks.

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: How to get interlanguage ilink from MediaWiki API

Marius Hoch
Hello Jiang,

the API returns valid results it just has a default limit of 10 results
(you can see that by the fact a query-continue block is shown which
indicates how you can fetch further results). To get more than 10
results with action=query&prop=langlinks just append &lllimit=123 to
your query.
Eg. <a href="https://en.wikipedia.org/w/api.php?action=query&titles=Albert%">https://en.wikipedia.org/w/api.php?action=query&titles=Albert%
20Einstein&prop=langlinks&lllimit=500 shows all langlinks for the Albert
Einstein article.

Cheers,

Marius Hoch (hoo)


On Fri, 2013-02-22 at 10:25 -0800, Jiang BIAN wrote:

> Hi MediaWiki developers,
>
>
> I noticed that on en.wikipedia.org, interlanguage wikilinks are gone,
> possibly due to this change:
> http://blog.wikimedia.de/2013/02/13/wikidata-live-on-the-english-wikipedia/.
>
>
> Our project is still working with old interlanguage link (parsing
> "[[en:Proxy server]]"). Is there other way to get the interlanguage
> link besides talking with www.wikidata.org?
> The example in API doc seems return a wrong
> result: <a href="https://en.wikipedia.org/w/api.php?action=query&titles=Albert%">https://en.wikipedia.org/w/api.php?action=query&titles=Albert%
> 20Einstein&prop=langlinks (Albert Einstein contains so many
> interlanguage link).
>
>
>
>
> Thanks
>
>
>
> --
> Jiang BIAN
>
> This email may be confidential or privileged.  If you received this
> communication by mistake, please don't forward it to anyone else,
> please erase all copies and attachments, and please let me know that
> it went to the wrong person.  Thanks.
> _______________________________________________
> Mediawiki-api mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-api



_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: How to get interlanguage ilink from MediaWiki API

Jiang BIAN
In reply to this post by Jiang BIAN
Thanks Marius and Mark.

Will the API keep unaffected after interlanguages are moved to wikidata.org?

On Fri, Feb 22, 2013 at 10:44 AM, Mark A. Hershberger <[hidden email]> wrote:
On 02/22/2013 01:25 PM, Jiang BIAN wrote:
> Our project is still working with old interlanguage link (parsing
> "[[en:Proxy server]]"). Is there other way to get the interlanguage link
> besides talking with www.wikidata.org <http://www.wikidata.org>?
> The example in API doc seems return a wrong result

The API document is correct, but you will need to use the llcontinue
parameter to get the next batch of results.

<a href="https://en.wikipedia.org/w/api.php?action=query&amp;titles=Albert%20Einstein&amp;prop=langlinks&amp;llcontinue=736|az" target="_blank">https://en.wikipedia.org/w/api.php?action=query&titles=Albert%20Einstein&prop=langlinks&llcontinue=736|az

You can use the lllimit parameter to get more results in any one response.

--
http://hexmode.com/

There is no path to peace. Peace is the path.
   -- Mahatma Gandhi, "Non-Violence in Peace and War"



--
Jiang BIAN

This email may be confidential or privileged.  If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it went to the wrong person.  Thanks.

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: How to get interlanguage ilink from MediaWiki API

Brad Jorsch (Anomie)
On Fri, Feb 22, 2013 at 1:49 PM, Jiang BIAN <[hidden email]> wrote:
>
> Will the API keep unaffected after interlanguages are moved to wikidata.org?

Considering that
https://en.wikipedia.org/w/api.php?titles=ASCII&action=query&prop=langlinks
returns numerous langlinks even though the links have all been removed
from the wikitext, it looks like the answer is "yes".

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: How to get interlanguage ilink from MediaWiki API

Jiang BIAN


On Fri, Feb 22, 2013 at 11:15 AM, Brad Jorsch <[hidden email]> wrote:
On Fri, Feb 22, 2013 at 1:49 PM, Jiang BIAN <[hidden email]> wrote:
>
> Will the API keep unaffected after interlanguages are moved to wikidata.org?

Considering that
https://en.wikipedia.org/w/api.php?titles=ASCII&action=query&prop=langlinks
returns numerous langlinks even though the links have all been removed
from the wikitext, it looks like the answer is "yes".
Brad, your use of "looks like" makes me a little confusing.
Let me clarify my question:
After interlanguage link is moved to wikidata.org, what should I expect from https://en.wikipedia.org/w/api.php?titles=ASCII&action=query&prop=langlinks? old info of the article or the up-to-date language link info kept on wikidata.org?


Thanks


_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api



--
Jiang BIAN

This email may be confidential or privileged.  If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it went to the wrong person.  Thanks.
_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: How to get interlanguage ilink from MediaWiki API

Legoktm
In reply to this post by Brad Jorsch (Anomie)
Somewhat related, there is an open bug which would indicate whether the langlink is locally stored or from a foreign source (Wikidata).
https://bugzilla.wikimedia.org/show_bug.cgi?id=41345
-- Legoktm


On Fri, Feb 22, 2013 at 1:15 PM, Brad Jorsch <[hidden email]> wrote:
On Fri, Feb 22, 2013 at 1:49 PM, Jiang BIAN <[hidden email]> wrote:
>
> Will the API keep unaffected after interlanguages are moved to wikidata.org?

Considering that
https://en.wikipedia.org/w/api.php?titles=ASCII&action=query&prop=langlinks
returns numerous langlinks even though the links have all been removed
from the wikitext, it looks like the answer is "yes".

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api


_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api