Saturday, February 16, 2013

Using Wikidata to display links to Wikipedia


Wikidata is a new wiki with a structured database (a bit like OmegaWiki), which is used, among other things, as a central repository for maintaining the interwiki links between the various Wikipedias.

In Wikidata, concepts are identified with a unique ID, like "Q41055". This ID gives you the links to the various Wikipedia articles (see: http://www.wikidata.org/wiki/Q208440 ). In OmegaWiki, concepts are called "DefinedMeaning", and also have a unique ID, like "159079" (see: http://www.omegawiki.org/DefinedMeaning:Schachfigur_(159079) ). They can be linked one-to-one with Wikidata IDs. Using the Wikidata ID, a link to Wikipedia is automatically retrieved and displayed on the side.

As usual, the user language is used to redirect the user to the Wikipedia that is in his language. See for example how the link changes when you view the same page in English , in French , in German or in Persian .

Before that, we already had links to Wikipedia, however one link had to be added for each language. The advantage of the new system over the previous one are:

  • we don't have to add a link for each language, as we did before, but just put one Wikidata ID.
  • the links are automatically updated when they are changed on Wikidata.
  • it works even when we don't have a translation in that language. For example, if we have a species, like Spalerosophis diadema that has no translation in French ("Spalerosophis diadema" is language "international") we can still have a link to a Wikipedia article.
  • it is an annotation at the DefinedMeaning level. This is more consistent with the other annotations, because it is about a concept (DM), whereas it was previously classified with the lexical annotations (like part of speech, gender, phonetics, etc.)


With the old system, we already created more than 15.000 links to Wikipedia. They will be converted automatically to Wikidata IDs.

Note that the link can work in the other direction too. When we have one-to-one correspondances between concepts in Wikidata and OmegaWiki, it can be used in Wikidata to get for example multilingual definitions for their concepts.

No comments: