How to add a mapping namespace

From Mediawiki1
Revision as of 01:16, 16 May 2012 by Chrisahn (talk | contribs)
Jump to navigationJump to search

As an example, we use a fictitious language with code "xx" and Wikipedia rank 44.

Note: more code changes will be needed for the first language code that contains a dash "-". Please update this guide.


Get language code and rank

Get the wiki language code and rank from http://s23.org/wikistats/wikipedias_html.php

namespace number: multiply the rank by 2 and add 200

talk namespace number: add 1 to the namespace number

Example: language code "xx", rank 44, namespace number 288, talk namespace number 289

CAUTION: If the calculated namespace number already exists for another language (because the ranking has changed) do NOT change the existing namespace number. Please find a neighboring or close enough number that works.

If 288 is in use, we choose other numbers, let’s say 298 and 299


Update the extraction framework

edit core/org.dbpedia.extraction.wikiparser.Namespace.scala

add something like this at the appropriate position in the code

"xx"->288

Commit and push the changes to default branch.


Update and restart the mapping server

Log onto the machine that's serving http://mappings.dbpedia.org/server/ URLs.

Stop the server:

ps axfu | grep java

Look for class ...server.Server, and then:

kill <process id>

Then update, compile and start the server:

cd /home/dbpedia-server/dbpedia/extraction_framework
hg pull
hg update
mvn clean install --projects core,server
cd server
../run server &>server-<YYYY>-<MM>-<DD>.01.log &


Update mappings wiki

Update the MediaWiki settings

Log onto the machine that is serving http://mappings.dbpedia.org/index.php URLs.

open htdocs/mappings/LocalSettings.php

add the following lines at the right position in the code

"xx" => 288

Restart the Apache server

edit mappings wiki sidebar

Edit MediaWiki:Sidebar.

Add a link at for the new language:

** {{fullurl:Special:AllPages|namespace=288}}|Mappings (xx)

c) edit http://mappings.dbpedia.org/index.php/Template:Class, http://mappings.dbpedia.org/index.php/Template:Datatype, http://mappings.dbpedia.org/index.php/Template:DatatypeProperty, http://mappings.dbpedia.org/index.php/Template:ObjectProperty

add two lines for label@xx

d) edit http://mappings.dbpedia.org/index.php/Mapping_Statistics and http://mappings.dbpedia.org/index.php/DBpedia_datasets

e) generate statistics for new language run RedirectExtractor, InfoboxExtractor, TemplateParameterExtractor (see dump/extraction.server.properties) run CreateMappingStats (launcher ‘stats’ in server/pom.xml) copy src/main/statistics/mappingstatistics_bg.txt to same folder on server Update and deploy sprint stuff.