[Labs-l] namespaces

Chad Horohoe chorohoe at wikimedia.org
Thu Nov 19 15:36:57 UTC 2015


On Thu, Nov 19, 2015 at 3:44 AM, Jaime Crespo <jcrespo at wikimedia.org> wrote:

> On Thu, Nov 19, 2015 at 12:26 PM, Yetkin Sakal <superyetkin at yahoo.com>
> wrote:
>
>> Are namespaces stored in replica databases? How can we link the
>> page_namespae column in the page table to retrieve the full page name?
>>
>
> The name of the column is not stored on the database (neither on labs dbs
> nor in production). There is not such a thing as a canonical name for
> namespaces, but you can go to
>

There are such things as canonical namespaces, they're the english
translations.
The code is littered with instances of this. But otherwise you're right, we
don't store
the names in the databases, they're by number.


> a) the source code of mediawiki for the predefined names and its
> translations to each language
>

For core namespaces, you can check out Defines.php which will clearly give
you
the number -> name match.


> b) our custoom/publicly available configuration for custom names/namespaces
> <
> https://github.com/wikimedia/operations-mediawiki-config/blob/master/wmf-config/InitialiseSettings.php#L1947
> >
>
> Please note that the same page/namespace can redirect to different names,
> depending on the local language:
> e.g. https://es.wikipedia.org/wiki/Talk:Portada redirects to
> https://es.wikipedia.org/wiki/Discusi%C3%B3n:Portada.
>
>
I'll also add api.php, which can easily give you this for any wiki. For
example:
https://es.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces|namespacealiases

This is probably your best bet, actually.

-Chad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.wikimedia.org/pipermail/labs-l/attachments/20151119/bb0af552/attachment.html>


More information about the Labs-l mailing list