Wikipedia:Persondata

Persondata is special metadata which can be added to biographical articles. This metadata can then be extracted and processed automatically (unlike conventional Wikipedia content). It consists of a set of standardized data fields which include basic information about the person, such as name, birthday, place of birth, etc. This metadata can be used for a variety of purposes, including advanced search capabilities, statistical analysis, automated categorization, and birthday lists. The addition of persondata will not affect the normal display of an article since the information remains hidden unless a user sets their user stylesheet to display it.

As of August 25, 2007, there are approximately 12,200 articles with persondata. (As of July 2007 the German Wikipedia has over 163,400 articles with "Personendaten" .)

Using the template
To use the Persondata template, copy the wikitext below to the end of a biographical article and fill in the parameters manually, or use this javascript which can add the template and fill in the information semi-automatically from infoboxes. If you add the template manually, place it just before the categories and interlanguage links. (DEFAULTSORT is not a real template but direct part of categorization, and therefore should be located between persondata and categories.)

Next, fill out the data fields. Make sure the name is entered with the surname first (the same way you would with a category listing). Do not delete empty data fields, for example, if a person is still alive, you'll leave the date and place of death blank. Here is an example of a properly filled out template:

Viewing persondata
By default, persondata is invisible to normal users. In order to make persondata visible, you must edit your user stylesheet. To do this, first make sure you are logged in. Then create a page at User:YourUserName/monobook.css and add the following line:

table.persondata {display:table;}

or, if you use Microsoft Internet Explorer:

table.persondata {display:block;}

Tip: After saving User:YourUserName/monobook.css, please empty the Browser-Cache, to see the changes: Mozilla/Firefox: Shift-Ctrl-R, Internet Explorer: Ctrl-F5, Opera: F5, Safari: ⌘-R, Konqueror: Ctrl-R.

If you can see the following block about Ferdinand Magellan, you have successfully made persondata visible:

To make persondata invisible again, simply remove the line of CSS given above from your user stylesheet.

Data fields
The data fields NAME, ALTERNATIVE NAMES, SHORT DESCRIPTION, DATE OF BIRTH, PLACE OF BIRTH, DATE OF DEATH, and PLACE OF DEATH are used to construct a persondata record. These fields can possibly be extended in the future.

Wikilinks in the persondata are not currently necessary; however, they may be useful for some future application.

Name
When specifying the person's name, use the following format: [surname], [forename] [middle names], [title]. For most cases this will be straightforward, for example, "George Walker Bush" becomes "Bush, George Walker". In some cases, however, there may be ambiguity about a person's surname. When in doubt, format the name according to how you would expect it to be alphabetized. For example, Ludwig van Beethoven would be alphabetized under "Beethoven", while Townes Van Zandt would be alphabetized under "Van Zandt". If you're not sure, ask someone familiar with the subject how they would alphabetize the name or consult a cataloguing guide such as the AACR2.

It is usually a good idea to list as much of a person's name as possible in the name field to avoid confusion with similar names. Do not include honorifics (such as "Dr.", "Professor", or "PhD"), however, unless they are part of a title of nobility.

Motivation
Without uniform formatting, it is very difficult to automatically extract useful information from biographical articles. It is also impossible to automatically alphabetize all the biographical articles since the titles typically begin with the person's first name. By adding standardized metadata to such articles, we can facilitate the creation of new applications for Wikipedia content, such as Wikipedia CD-ROMs, custom search applications, etc. Hopefully, this will be the first of many steps towards enriching Wikipedia with semantic content.

Extraction from an SQL database
Using an SQL query, the persondata can be filtered from Wikipedia articles stored in a database. As an example, here is an SQL query that can be used to extract persondata from wikisign.org:

SELECT pages.cur_namespace, pages.cur_title, SUBSTRING(SUBSTRING(pages.cur_text FROM INSTR(pages.cur_text,'{{Persondata')), 1,     INSTR(SUBSTRING(pages.cur_text FROM INSTR(pages.cur_text,'{{Persondata')),'}}')+1) AS 'Persondata' FROM cur AS pd JOIN templatelinks AS tl  ON pd.cur_namespace = tl.tl_namespace AND pd.cur_title = tl.tl_title JOIN cur AS pages ON tl.tl_from = pages.cur_id AND pages.cur_namespace = 0 WHERE pd.cur_namespace = 10 AND pd.cur_title = 'Persondata'

In order to be useful, however, the persondata must be further divided into individual data fields.

Extraction from the XML dump
''to be done. This may help you:''

At http://tools.wikimedia.de/~voj/pd/staging-area/ there is Persondata extracted from the German Wikipedia and script to extract this data from the XML dump. After transforming the data is then loaded into a database (an application of Extract, transform, load). You may need the following scripts:


 * Extract - calls three piped STX-scripts to extract Persondata templates
 * addNamespaces.stx
 * extractPersonendaten.stx - change "Personendaten" to "Persondata" in this script
 * pd2tab.stx - change parameter names in this script
 * Transform - needs to be rewritten for English Wikipedia
 * load.pl - you must create a MySQL database first
 * Full ETL-Process - runs the other scripts