Page MenuHomePhabricator

Provide namespaces metata in tools labs replicated database
Closed, DuplicatePublic

Description

For MW2SPARQL [1] and probably for other tools labs tools it would be very convenient to have in the same SQL server as the wiki database replicas a table giving the mapping between namepace id and namespace names. It would be useful for, e.g. returning in the query results full page title instead of just the namespace id and the remaining parts of the title as text.

MW2SPARQL was creating two tables in the old database replicas servers but it is not possible with the new ones.
The table schemas are:

CREATE TABLE IF NOT EXISTS enwiki_ns_id2name (
     ns_id INTEGER NOT NULL, 
     ns_name VARCHAR(100) NOT NULL,
     PRIMARY KEY(ns_id)
)
CREATE TABLE IF NOT EXISTS enwiki_ns_name2id (
     ns_name VARCHAR(100) NOT NULL, 
     ns_id INTEGER NOT NULL, 
     PRIMARY KEY(ns_name)
)

The two tables are different because ns_name2id contains also aliases and ns_id2name only the default namespace name

[1] https://github.com/Tpt/mw2sparql

Event Timeline

Tpt added a subscriber: zhuyifei1999.

Thank you @zhuyifei1999 for having a look at this task but T50625 is not solved anymore because user's databases are not available in new replica servers. So, I believe this task is relevant and should stay open.

Then in that case it would be a duplicate of T180558.