Revision as of 21:13, 10 March 2007 editRajah (talk | contribs)Autopatrolled, Extended confirmed users, Pending changes reviewers10,215 edits updated count← Previous edit | Revision as of 21:17, 19 March 2007 edit undo32X (talk | contribs)Extended confirmed users, Pending changes reviewers3,018 edits →Using the template: {{DEFAULTSORT}} is part of the categoriesNext edit → | ||
Line 5: | Line 5: | ||
== Using the template == | == Using the template == | ||
To use the {{tl|Persondata}} template, copy the wikitext below to the end of a biographical article. The template should be placed just before the ] and ]. | To use the {{tl|Persondata}} template, copy the wikitext below to the end of a biographical article. The template should be placed just before the ] and ]. ({{tl|DEFAULTSORT}} is not a real template but direct part of categorization, therefore it should be located between persondata and categories.) | ||
<pre><nowiki> | <pre><nowiki> | ||
<!-- Metadata: see ] --> | <!-- Metadata: see ] --> |
Revision as of 21:17, 19 March 2007
Shortcut- ]
Persondata is special metadata which can be added to biographical articles. This metadata can then be extracted and processed automatically (unlike conventional Misplaced Pages 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 March 10, 2007, there are approximately 5,200 articles with persondata. (The German Misplaced Pages has over 100,000 articles with persondata.)
Using the template
To use the {{Persondata}} template, copy the wikitext below to the end of a biographical article. The template should be placed just before the categories and interlanguage links. ({{DEFAULTSORT}} is not a real template but direct part of categorization, therefore it should be located between persondata and categories.)
<!-- Metadata: see ] --> {{Persondata |NAME= |ALTERNATIVE NAMES= |SHORT DESCRIPTION= |DATE OF BIRTH= |PLACE OF BIRTH= |DATE OF DEATH= |PLACE OF DEATH= }}
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:
<!-- Metadata: see ] --> {{Persondata |NAME=Magellan, Ferdinand |ALTERNATIVE NAMES=Magalhães, Fernão de (Portuguese); Magallanes, Fernando de (Spanish) |SHORT DESCRIPTION=Sea explorer |DATE OF BIRTH=Spring ] |PLACE OF BIRTH=], ] |DATE OF DEATH=], ] |PLACE OF DEATH=], ], ] }}
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 (if you have not already) 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: Template:Persondata 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.
Fieldname | Examples |
---|---|
NAME |
Magellan, Ferdinand |
ALTERNATIVE NAMES |
Magalhães, Fernão de (Portuguese); Magallanes, Fernando de (Spanish) |
SHORT DESCRIPTION |
Sea explorer |
DATE OF BIRTH |
1480 |
PLACE OF BIRTH | |
DATE OF DEATH | |
PLACE OF DEATH |
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: , , . 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 Misplaced Pages content, such as Misplaced Pages CD-ROMs, custom search applications, etc. Hopefully, this will be the first of many steps towards enriching Misplaced Pages with semantic content.
Extraction of persondata
Extraction from an SQL database
Using an SQL query, the persondata can be filtered from Misplaced Pages 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 Misplaced Pages 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 Misplaced Pages
- load.pl - you must create a MySQL database first
- Full ETL-Process - runs the other scripts
See also
- , - corresponding template and example in Semantic Mediawiki (SMW); note that in SMW either the whole data field is a single link (relation), or the data field is not linked at all (attribute).
- hCard - a microformat with similar properties.