Wikipedia:WikiProject Microformats
From Wikipedia, the free encyclopedia
| This is a WikiProject, a collaboration area and open group of editors dedicated to improving Wikipedia's coverage of a particular topic, or to organizing some internal Wikipedia process. Please see the Guide to WikiProjects and the Directory of WikiProjects for more information. |
- For quick access to examples, see: Category:Templates generating microformats
-
[Wikipedia's hCards] with geo information are yummy hack fodder … marking up data in a predictable manner is a great way to allow developers to play with your information. (Chris Heilmann, Yahoo Developer Network[1])
[edit] Project aims
- To encourage the deployment of microformats in Wikipedia
- by marking-up templates
- To share the resulting experience with other-language Wikipedias and other wiki- projects
- by harmonizing metadata template formats across projects
- by facilitating interwiki transfer of metadata between projects
- To document microformats in the article space, to the best possible standards
- To give feedback to the microformat community, so that microformats can be developed to best serve both Wikipedia and the wider on-line community
- To encourage the deployment of microformats in the Wikimedia application
- including (but not only) hCard in user profiles
- To advocate for the use of microformats by partner projects, metadata consumers, etc.
- by ensuring that templates are parsable in the wiki source code
[edit] What are microformats?
A Microformat (sometimes abbreviated μF or uF) is a way of adding simple semantic meaning to human-readable content which is otherwise, from a machine's point of view, just plain text. They allow data items such as events, contact details or locations, on HTML (or XHTML) web pages, to be meaningfully detected and the information in them to be extracted by software, and indexed, searched for, saved or cross-referenced, so that it can be reused or combined.
More technically, they are items of semantic mark up, using just standard (X)HTML with a set of common class-names and rel-attributes (though the latter are not used on MediaWiki). They are open and available, freely, for anyone to use.
For example, 52.48,-1.89 is a pair of numbers which may refer to anything; but in some contexts could be understood to be a set of geographic coordinates. By wrapping them in spans (or other HTML elements) with specific class names (in this case part of the geo microformat specification):
<span class="geo"><span class="latitude">52.48</span>, <span class="longitude">-1.89</span></span>
...machines can be told exactly what each value represents, and can then index it, look it up on a map, export it to a GPS device, or whatever.
Other microformats allow the encoding and extraction of events, contact information, social relationships, and so on. More are being developed.
Version 3 of the Firefox browser [2][3] includes, and version 8 of Internet Explorer may include[4], native support for microformats.
[edit] How can we use Microformats on Wikipedia?
(and, more generally, in MediaWiki)?
It is easier to apply them to templates rather than individual pages. That also means that individual authors need not know the intricacies of microformat mark-up, only how to use the relevant template. Many of the templates on Wikipedia require minimal changes, to use microformats to present their existing content with added meaning. While the functionality may already exist in the Wikipedia template, adding microformat mark-up will make that functionality available to people using the same tools they use when visiting other sites.
[edit] Project members
- Andy Mabbett (founder)
- Omegatron
- The Anome
- Quarl
- Qyd
- David Remahl
- Jeff McNeill
- Unforgiven24
- J JMesserly (talk)
[edit] Button
Use {{User Microformats}} to show your participation in this project.
[edit] Banner
Put {{ProjectMicroformats}} on the talk page of relevant articles.
[edit] Meta templates
[edit] For articles
- {{UF-coord-th}} - table header for columns of coordinates using {{coord}}.
- {{kml}} - links to KML services for pages with multiple occurrences of Geo.
- {{UF-timeline}} - links to siatec.net/timeline which generates a timeline of hCalendar microformats on the linking page
[edit] For talk pages
[edit] For templates
- {{Infobox}} has built-in support for adding microformat classes to the infoboxes it generates
[edit] For template documentation
- {{UF-hcal}} - where a start date requires {{Start date}}
- {{UF-hcal-2}} - where
class="dtstart"is hard-coded.
- {{UF-hcal-2}} - where
- {{UF-hcal-geo}}
- {{UF-hcard-geo}}
- {{UF-hcard-name}}
- {{UF-hcard-org}}
- {{UF-hcard-part}}
- {{UF-hcard-person}}
- {{UF-hcard-place}}
- {{UF-hcard+hcal}}
- {{UF-coord}}
- {{UF-coord-classes}}
[edit] Categories
- Microformats - 13
The following categories are not yet widely applied, and so under-represent the numbers concerned:
[edit] Parser functions
The following may be of use.
- #time (in MediaWiki version 1.6 and higher)
- Can change date formats around. For example, {{#time: c|10 June 2007}} produces 2007-06-10T00:00:00+00:00. The 'c' indicates that ISO8601 format should be used. A 'Y' instead of 'c' would return just the four digit year. However, this might run into trouble with the date parameter values on some templates. For instance, if a range (e.g. 1954-1955) were used in the date parameter {{#time: c|1954-1955}} would return Error: invalid time (per [2].
[edit] Related
- Wikipedia:Metadata
- Wikipedia:Biographical metadata
- Wikipedia:WikiProject Geographical coordinates
- Commons:Microformats Project
[edit] To do
Volunteers needed!
- Add hCard mark-up to templates (chiefly infoboxes) about places and people, modelled on existing examples.
- Add adr or hCard mark-up to navbox templates like these: Pink Floyd, Mike Patton, Sheffield buildings
- For tables like those in Category:Lists of mountains, update table rows to use hCard; perhaps by introducing table-row templates.
- Contribute to development of a policy on coordinates for linear features
- Contribute to development of a policy or policies on in-line microformats
[edit] Currently available
[edit] Geo
Geo (shortcut: WP:GEOUF) is for WGS84 coordinates (latitude;longitude).
Geo allows waypoints to be indexed ("find me all places within 2 km of X"), looked up on other websites, or uploaded to devices, such as GPS units.
{{coord}} applies the Geo microformat to coordinates on Wikipedia. It replaces the now-deprecated "coor *" family of templates.
| Quick "how to" |
|---|
To add the coordinates 57°18′22"N 4°27′32"W to the top of an article, use
These coordinates are in the format degrees/minutes/seconds |
For decimal coordinates, such as 44.112°N 86.913°W, use one of
|
| Values (including degrees, minutes and seconds) are separated by a pipe ("|"). Latitude (N/S) before longitude (E/W). Map datum is WGS84. To display the coordinates in the article as well, use "display=inline,title" instead of "display=title". Please don't be overly precise (0.0001° is <11 m, 1′′ is <31 m). |
Optional parameters:
Full example: {{coord|44.112|-87.913|region:US-WI_type:landmark|display=inline,title}} |
| For full details on the use of {{coord}}, see Template:Coord See also: Obtaining coordinates, coordinate conversion |
See also:
[edit] Geo examples on Wikipedia
See: Category:Templates generating Geo
Examples:
- Geo (microformat)#Example
- All of the articles using {{template:coord}} . Examples:
- Most of the articles in Category:Lists of coordinates
- Great Barr
- {{Geolinks-AUS-suburbscale}}
- GeoTemplate, which is called by many thousands of other Wikipedia pages.
- Example: the coordinates (top right) in Great Barr link to a list of maps for Great Barr; the latter now has a Geo microformat.
- Lists of coordinates using Geo in hCard:
- Robert Baden-Powell, 1st Baron Baden-Powell Featured Article uses {{coord}}, both "title" and "inline".
[edit] Extensions
There are three active proposals, none mutually-exclusive, and all backwards-compatible, to extend the geo microformat:
- geo-extension - for representing coordinates on other planets, moons etc., and with non-WSG84 schema
- Of use for Template:Lunar crater data
- geo-elevation - for representing altitude
- geo-waypoint - for representing routes and boundaries, using waypoints
[edit] Export to KML
Pages marked with {{coord}} can be exported as KML (for use in Google Earth, for example) via Brian Suda's site, in this format:
The same URL can be pasted into Google Maps as a search, and will show the locations, as push-pins on a map
The template: {{kml}} has been created for this purpose (and was immediately nominated for deletion!).
[edit] hCard
hCard is for contact details of people (both article subjects and user profiles), organisations and venues.
See Wikipedia:WikiProject Microformats/hcard for more.
[edit] Adr
The adr microformat for postal addresses and their individual components is a sub-set of hCard. See the above page for more information, or Category:Templates generating ADR microformats.
{{User:Coldacid/Templates/mf-adr}} generates an inline adr, either standalone or for placing within an existing HTML tag with class="adr" via the inadr paramter.
[edit] hCalendar
- hCalendar is for events - so that they can be added directly to calendar or diary programmes or websites. See Category:Templates generating hCalendars (note also Wikipedia:Selected anniversaries).
- Start and end dates of events. Editors have choices of two families of templates. Both emit microformat dates required for events.
- {{start date}} & {{ISO date}} emits the required ISO8601 date with
class="dtstart", and {{end date}} & {{ISO end date}} emit the date withclass="dtend"(not yet working for exclusive whole-day dates). - {{start-date}}, {{end-date}} family (note dashes in name)
- {{start-date}}, and {{bday}} emit the required ISO8601 date with
class="dtstart". bday emits the class bday for vcards. - {{end-date}} emits the date with
class="dtend". Dates are adjusted +1 unit of time, where unit of time is dependent on the precision. EG: {{end-date|December 31, 1976}} would generate 1977-01-01Z, whereas {{end-date|1939}} would generate 1940. In contravention of the hCalendar spec. - Note that there is a proposal to deprecate the use of {{start date}} and {{end date}}. See talk page for details.
- Background: readability- this family of templates are designed to make microformats coding less cumbersome for contributors, allowing them to express dates in the formats they are comfortable reading. These templates impose fewer restrictions, support time zones, can be used with links and Julian templates, have the ability to handle extreme dates (from 6999BC to 6999AD. Some of these features are not available in {{start date}} or {{end date}}.
- {{start-date}}, and {{bday}} emit the required ISO8601 date with
- {{start date}} & {{ISO date}} emits the required ISO8601 date with
- {{timeline-item}} (with {{timeline-start}} and {{timeline-end}}) generate a definition list for a series of dated events, each being wrapped in an hCalendar microformat.
- {{timeline-links}} passes a page's set of hCalendar events to external timeline-generating and other hCalendar-using websites.
[edit] Biographies
There are two schools of thought in the microformats community concerning whether hCalendar microformat should be used for birth and death dates. One school believes it not be used to represent a person's life-span because, from their point of view, a life is not semantically a single event, but a series of many events, starting with a birth-event, and ending with a death-event. These advocates point out that the hCard microformat already caters for the semantic markup of a life, as it as a birth-date property; and a death-date property is in the draft of the next version of its parent vCard specification. Others in the microformat community believe that an hCalendar vevent is the correct way to express birth and end dates for an individual. It has not been established which side is correct. For now, there is no property for expressing death dates using the hCard method. Tantek Çelik, editor and author of both the hCard and hCalendar specs, one of the founders of microformats movement, had earlier voted (as a minority) against adding a death date property to hCard to maintain a 1-1 correlation between the hCard and current vCard specification[5]. Advocates of the vevent method claim it is proper to use the dtend property for death date, and it has been used for thousands of genealogies[3]. This issue continues to be discussed microformats community, and methods of recording birth and death dates may change in the future. There is no consensus deprecating either use. Contibutors may use either.
[edit] hAtom
hAtom is for marking feeds.
It will not be possible to use hAtom in Wikipedia until it is possible to have an address element on pages. See Wikipedia:Village_pump_(technical)#address_element.
{{start date}} & {{ISO date}} now emit the required ISO8601 date with class="updated".
[edit] hReview
hReview is for marking up reviews, and could be used by, for example, Template:Infobox Album.
[edit] Other
[edit] Pseudo-microformats
Though not formally microformats (because they have not been developed using the "microformats process", and/ or involve hidden metadata), the following are related:
[edit] Classes
See /classes
[edit] Under development
[edit] Species
See /Species
[edit] Forthcoming
[edit] Citations
The proposed citation microformat will obviously be very relevant to Wikipedia, both for on-page citations and bibliographies, and for allowing people to cite Wikipedia, elsewhere. See Template talk:Cite book#Use in Bibliography and COinS in Wikipedia for work which is laying some of the groundwork for application of that microformat, once it is ready.
Citation microformats would allow the look-up of cited articles or books in libraries or shops, and the extraction of citation data for the page being voted, if it is to be cited elsewhere.
[edit] Currency
The proposed currency microformat may be useful, especially if the suggestion to include a date field for historical amounts is included., for example, on 1922 in Germany
- "Despite the ending of cash payments for the rest of 1922, the main cause of Germany's inability to pay, the steady depreciation of the mark, was ongoing. Towards the end of the year it assumed a disastrous rapidity. On August 1, the US Dollar still stood at 643 Marks to the Dollar and the British Pound at 2,850 Marks to the Pound. But on September 5 the dollar had already risen to 1,440 Marks and the pound to 6,525 Marks, and in December the pound was worth between 30,000 and 40,000 marks and the dollar between 7,000 and 9,000."
Currency would allow automatic conversion of amounts into other currencies ("how much is that in dollars?") or time ("how much would that be today?")
[edit] Other MediaWiki uses
[edit] Wikitravel
Wikitravel is using microformats, not least in Wikitravel listings
[edit] MediaWiki issues
- We need to be able to add classes and
relattributes to internal and external links, to generate, for example:
<a href="example.com" class="xxx">
or:
<a href="example.com" rel="yyy">
or a combination of both, where "xxx" is a valid microformat attribute such as "url" and "yyy" is a valid rel attribute such as "directory", "tag" or "colleague" (the latter from XFN).
For other issues encountered when adding microformats to Wikipedia and other pages, using Media Wiki mark-up, see [4]
[edit] Yahoo! Query Language
"Yahoo! Query Language" can be used to extract microformats from Wikipedia pages, as demonstrated at Retrieving and displaying data from Wikipedia with YQL
[edit] References
- ^ Heilman, Chris (2009-01-19). "Retrieving and displaying data from Wikipedia with YQL". Yahoo Developer Network. Yahoo. http://developer.yahoo.net/blog/archives/2009/01/wikipedia_w_yql.html. Retrieved on 2009-01-19.
- ^ Resig, John (2007-02-01). "Microformats in Firefox 3". http://ejohn.org/blog/microformats-in-firefox-3/. Retrieved on 2007-03-25.
- ^ Kaply, Mike (2007-05-09). "Microformats and Firefox 3 (for Developers)". http://www.kaply.com/weblog/2007/05/09/microformats-and-firefox-3-for-developers/. Retrieved on 2007-05-23.
- ^ Bounds, Darren (2007-05-02). "Microsoft drops hints about Internet Explorer 8". http://arstechnica.com/news.ars/post/20070502-microsoft-drops-hints-about-internet-explorer-8.html. Retrieved on 2007-05-02.
- ^ Tantek Çelik votes against the proposed death date property addition to hCard [1], but is in the minority

