How to add a mapping namespace: Difference between revisions

From DBpedia Mappings
Jump to navigationJump to search
(Created page with '== How to create a mapping namespace for a new language == As an example, we use a fictitious language with code "xx" and Wikipedia rank 44. Note: '''more code changes will be ...')
 
No edit summary
Line 5: Line 5:
Note: '''more code changes will be needed for the first language code that contains a dash "-".'''
Note: '''more code changes will be needed for the first language code that contains a dash "-".'''


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


get wiki language code and rank from http://s23.org/wikistats/wikipedias_html.php
namespace number: multiply the rank by 2 and add 200
namespace number: multiply the rank by 2 and add 200
talk namespace number: add 1 to the namespace number
talk namespace number: add 1 to the namespace number
Example: language code "xx", rank 44, namespace number 288, talk namespace number 289
Example: language code "xx", rank 44, namespace number 288, talk namespace number 289
if 288 is in use, we choose numbers, let’s say 298 and 299
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.
2. update the extraction framework and server


a) edit core/org.dbpedia.extraction.wikiparser.Namespace
'''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 positions in the code
add something like this at the appropriate positions in the code
“xx->288
b) commit and push the changes to default branch


c) log onto 160.45.137.69
<pre>
"xx"->288
</pre>
 
Commit and push the changes to default branch.


with user name "dbpedia-server"
=== Update and restart the process that's serving http://mappings.dbpedia.org/server/ URLs ===
stop the server
 
Log onto the appropriate machine.
 
Stop the server:
 
<pre>
ps axfu | grep java
ps axfu | grep java
look for class ...server.Server
</pre>
 
Look for class ...server.Server, and then:
 
<pre>
kill <process id>
kill <process id>
in the terminal
</pre>
 
Then update, compile and start the server:
 
<pre>
cd /home/dbpedia-server/dbpedia/extraction_framework
cd /home/dbpedia-server/dbpedia/extraction_framework
hg pull
hg pull
Line 37: Line 56:
cd server
cd server
../run server &>server-<YYYY>-<MM>-<DD>.01.log &
../run server &>server-<YYYY>-<MM>-<DD>.01.log &
</pre>
=== update mappings wiki ===


3. update mappings wiki
TODO: add LocalSettings.php to some source repo!!!
TODO: add LocalSettings.php to some source repo!!!
a) log onto www5 (160.45.137.86)
a) log onto www5 (160.45.137.86)

Revision as of 02:10, 16 May 2012

How to create a mapping namespace for a new language

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 "-".

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 positions in the code

"xx"->288

Commit and push the changes to default branch.

Update and restart the process that's serving http://mappings.dbpedia.org/server/ URLs

Log onto the appropriate machine.

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

TODO: add LocalSettings.php to some source repo!!! a) log onto www5 (160.45.137.86)

with user name "Administrator" open C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\mappings\LocalSettings.php add the following lines at the right position in the code “xx"=> 288 restart the Apache server b) edit http://mappings.dbpedia.org/index.php/MediaWiki:Sidebar

add a link at the right position in the ranking with the right number and language code 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.