Wikipedia:WikiProject Microformats
{{Short description|Wikimedia subject-area collaboration}}
{{for|reader help|Help:Microformats}}
{{for|quick access to examples|Category:Templates generating microformats}}
{{WikiProject status|semi-active|parent=Computing|sc1=WP:UF}}
{{Update}}
{{Infobox WikiProject
|inactive =
|semi-active =
|name = Microformats
|bodystyle =
|image =
|imagesize =
|caption =
|shortcuts =
|shortcuts2 =
|category =
|category2 =
|portal =
|portal2 =
|commons =
|parent =
|parent2 =
|parent3 =
|parent4 =
|child =
|child2 =
|child3 =
|notice =
|notice-extended =
|userbox =
|userbox2 = User Microformats
|userbox3 =
|userboxnote =
|helps-organise-children =
|has-goals = Yes
|assessment =
|popular-pages =
|footnotes =
|csb =
|type =
}}
[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){{cite web|url= http://developer.yahoo.net/blog/archives/2009/01/wikipedia_w_yql.html | archiveurl= http://web.archive.org/web/20110127010715/http://developer.yahoo.com/blogs/ydn/posts/2009/01/wikipedia_w_yql/ | archivedate= 2011-01-27 | title=Retrieving and displaying data from Wikipedia with YQL|last=Heilman|first=Chris|date=2009-01-19|work=Yahoo Developer Network|publisher=Yahoo|accessdate=2009-01-19}}
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 maintain a plain-language guide to using Wikipedia's microformats
- 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
- To collaborate with other efforts to improve Wikipedia's metadata and data-reuse techniques such as linked data
What are microformats?
A Microformat (sometimes abbreviated μF or uF) is a way of adding simple semantic meaning to human-readable content that 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 that 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):
52.48,-1.89
... 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 do other useful things involving [or relating to] the place that corresponds to that "lat/lon" [that is, the place that is represented by that "geo microformat"].
Other microformats allow the encoding and extraction of events, biographical/ contact information, social relationships, species names, product details, reviews, audio recordings, and so on. More are being developed.
= Using our microformats =
Page content marked up with microformats may be extracted using various [http://microformats.org/wiki/browsers browser plugins] and [http://microformats.org/wiki/parsers parsers].
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.
Project participants
= Button =
Use {{tl|User Microformats}} to show your participation in this project.
= Banner =
Put {{tl|WikiProject Microformats}} on the talk page of relevant articles.
= Signature =
Consider adding an hCard to your signature, like this:
If your user name has more than one word, and is not a given-name+surname pair, use class="fn nickname"
.
Templates
- {{Tl|URL}} – input/ display / link =
www.example.com / http://www.example.com/ / http://www.example.com/
This wraps the displayed URL with class="url"
.
Meta templates
= For articles =
- {{tl|UF-coord-th}} – table header for columns of coordinates using {{tl|coord}}.
- {{tl|kml}} – links to KML services for pages with multiple occurrences of Geo.
- {{tl|UF-timeline}} – links to [http://www.siatec.net/timeline/index.php siatec.net/timeline] that generates a timeline of hCalendar microformats on the linking page
= For talk pages =
- {{tl|UF-hcard-geo-article}}
= For templates =
- {{tl|Infobox}} and {{tl|Navbox}} have built-in support for adding microformat classes to the templates they generate.
- {{tl|abbr}} and {{tl|abbrlink}} take a {{Para|class}} parameter.
= For template documentation =
- {{tl|UF-adr}}
- {{tl|UF-audio}}
- {{tl|UF-coord}} – {{UF-coord}}
- {{tl|UF-coord-classes}}
- {{tl|UF-date-part}} – Where dates are emitted for use inside other microformat templates
- {{tl|UF-date-warn}} – warning of ISO date limitation
- {{tl|UF-geo}}
- {{tl|UF-geo-other}} – for non-terrestrial coordinates
- {{tl|UF-hcal}} – where a start date requires {{tl|Start date}}
- {{tl|UF-hcal-auto}} – where
class="dtstart"
is hard-coded. - {{tl|UF-hcal-geo}}
- {{tl|UF-hcard-geo}}
- {{tl|UF-hcard-name}}
- {{tl|UF-hcard-org}}
- {{tl|UF-hcard-part}}
- {{tl|UF-hcard-person}}
- {{tl|UF-hcard-place}}
- {{tl|UF-hcard-short}}
- {{tl|UF-hcard+hcal}}
- {{tl|UF-hprod}}
- {{tl|UF-media}}
- {{tl|UF-species}}
Categories
- Microformats – {{PAGESINCATEGORY:Microformats}}
- :Category:WikiProject Microformats – {{PAGESINCATEGORY:WikiProject Microformats}}
- :Commons:Category:Microformat screenshots
= Articles =
- Articles with microformats – {{PAGESINCATEGORY:Articles with microformats}}
- Articles with Adr microformats – {{PAGESINCATEGORY:Articles with Adr microformats}}
- Articles with hAudio microformats – {{PAGESINCATEGORY:Articles with hAudio microformats}}
- Articles with hCards – {{PAGESINCATEGORY:Articles with hCards}}
- Articles with Geo – {{PAGESINCATEGORY:Articles with Geo}}
- Articles with hCards and Geo – {{PAGESINCATEGORY:Articles with hCards and Geo}}
- Articles with hProducts – {{PAGESINCATEGORY:Articles with hProducts}}
- Articles with hRecipes – {{PAGESINCATEGORY:Articles with hRecipes}}
- Articles with 'species' microformats – {{PAGESINCATEGORY:Articles with 'species' microformats}}
- Performing arts pages with videographic documentation — {{PAGESINCATEGORY:Performing arts pages with videographic documentation}}
= Template categories =
- :Category:Templates generating microformats – {{PAGESINCATEGORY:Templates generating microformats}}
- Templates generating ADR microformats – {{PAGESINCATEGORY:Templates generating ADR microformats}}
- Templates generating hAtom — {{PAGESINCATEGORY:Templates generating hAtom}}
- Templates generating hAudio microformats – {{PAGESINCATEGORY:Templates generating hAudio microformats}}
- Templates generating Geo – {{PAGESINCATEGORY:Templates generating Geo}}
- Templates generating hCalendars and Geo – {{PAGESINCATEGORY:Templates generating hCalendars and Geo}}
- Templates generating hCards and Geo – {{PAGESINCATEGORY:Templates generating hCards and Geo}}
- Templates generating hCalendars – {{PAGESINCATEGORY:Templates generating hCalendars}}
- Templates generating hCalendars and Geo – {{PAGESINCATEGORY:Templates generating hCalendars and Geo}}
- Templates generating microformat date and age — {{PAGESINCATEGORY:Templates generating microformat date and age}}
- Templates generating hCards – {{PAGESINCATEGORY:Templates generating hCards}}
- Templates generating hCards and Geo – {{PAGESINCATEGORY:Templates generating hCards and Geo}}
- Templates generating hProduct – {{PAGESINCATEGORY:Templates generating hProduct}}
- Templates generating hRecipe – {{PAGESINCATEGORY:Templates generating hRecipe}}
- Templates generating microformat dates — {{PAGESINCATEGORY:Templates generating microformat dates}}
- Templates generating microformat date and age — {{PAGESINCATEGORY:Templates generating microformat date and age}}
- Templates generating 'species' microformats – {{PAGESINCATEGORY:Templates generating 'species' microformats}}
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 {{#time: c|10 June 2007}}. 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|Error: Invalid time}} (per [http://en.wikipedia.org/w/index.php?title=Template_talk:Infobox_Book&curid=3044974&diff=150382027&oldid=150002396]).
Related
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: [http://en.wikipedia.org/w/index.php?title=Template:Pink_Floyd&diff=prev&oldid=260396999 Pink Floyd], [http://en.wikipedia.org/w/index.php?title=Template:Mike_Patton&diff=prev&oldid=260396793 Mike Patton], [http://en.wikipedia.org/w/index.php?title=Template:SheffieldStructures&diff=prev&oldid=260396299 Sheffield buildings]
- Add adr or hCard mark-up to stub templates
- 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
- Lobby for ability to use
tbody
in tables - Lobby for ability to use
class
andrel
attributes on internal (includingFile:
) and external links - see bugs, below
- Lobby for ability to use
class
attributes inimg
elements. - see bugs, below
- Make templates emit hidden categories such as :Category:Articles with hCards. See Emitting categories
- Add hAudio to templates like {{Tl|Listen}}/ {{Tl|Listen/core}}; {{Tl|Audio}}, {{Tl|Multi-listen item}}
- needs
tbody
in tables; see bugs, below - Follow [http://www.loc.gov/standards/datetime/ Extended Date Time Format efforts] at the USA’s Library of Congress
Currently available
= Geo =
Geo (shortcut: WP:GEOUF) is for WGS84 coordinates (latitude;longitude).
Geo allows waypoints to be indexed ("find me all places within {{Nowrap|2 km}} of X"), looked up on other websites, or uploaded to devices, such as GPS units.
{{tl|coord}} applies the Geo microformat to coordinates on Wikipedia. It replaces the now-deprecated "coor *" family of templates.
{{coord how-to}}
See also:
== 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
- {{tl|Geolinks-AUS-suburbscale}}
- GeoTemplate, which is called by many thousands of other Wikipedia pages.
- Example: click on the coordinates (top right) in Great Barr
- Lists of coordinates using Geo in hCard:
- Manchester Ship Canal
- Netherton Tunnel Branch Canal
- Robert Baden-Powell, 1st Baron Baden-Powell Featured Article uses {{tl|coord}}, both "title" and "inline".
== Extensions ==
There are three proposals, none mutually exclusive, and all backwards-compatible, to extend the geo microformat:
- [http://microformats.org/wiki/geo-extension-strawman geo-extension-strawman] – adds
class="body"
, for representing coordinates on other planets, moons etc.; and a class for non-WSG84 schema. See, for example; - Venera 7
- Hun Kal (crater)
- Templates using "body"
- [http://microformats.org/wiki/geo-elevation-examples geo-elevation-examples] – for representing altitude
- [http://microformats.org/wiki/geo-waypoint-examples geo-waypoint-examples] – for representing routes and boundaries, using waypoints
All proposals are now inactive in the wake of the hGeo format being accepted. The elevation proposal is part of hGeo proper, but all others will need to be re-proposed. Out of all three, Wikipedia templates currently do class="body"
only. The extension and elevation proposals are implemented by Swignition.
== Export to KML ==
Pages marked with {{tl|coord}} can be exported as KML (for use in Google Earth, for example) via Brian Suda's site, in this format:
:http://suda.co.uk/projects/microformats/geo/get-geo.php?type=kml&uri=http://en.wikipedia.org/wiki/List_of_volcanoes_in_the_United_States_of_America
The same URL can be pasted into Google Maps as a search, and will show [http://maps.google.co.uk/maps?f=q&hl=en&geocode=&q=http:%2F%2Fsuda.co.uk%2Fprojects%2Fmicroformats%2Fgeo%2Fget-geo.php%3Ftype%3Dkml%26uri%3Dhttp:%2F%2Fen.wikipedia.org%2Fwiki%2FList_of_volcanoes_in_the_United_States_of_America&ie=UTF8&z=2&om=1 the locations, as push-pins on a map]
The template: {{tl|kml}} has been created for this purpose (and was immediately nominated for deletion!).
= hAudio =
hAudio is for audio recordings; with or without audio files (we cannot currently link to audio files in hAudio, because Wikipedia editors cannot use the rel
attribute; see [https://bugzilla.wikimedia.org/show_bug.cgi?id=23225 bug 23225]).
= hCard =
hCard is for contact details of people (both article subjects and user profiles/sigs), organisations and venues.
See Wikipedia:WikiProject Microformats/hcard for more.
== 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.
{{tl|mf-adr}} generates an inline adr, either standalone or for placing within an existing HTML tag with class="adr" via the inadr paramter.
= hCalendar =
- hCalendar is for events – so that they can be added directly to calendar or diary programmes or websites (including as recurring events, so that the anniversaries of historic events may be celebrated); or charted in timelines. 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.
- {{tl|start date}} and {{tl|ISO date}} emits the required ISO8601 date with
class="dtstart"
, and {{tl|end date}} and {{Tl|ISO end date}} emit the date withclass="dtend"
(not yet working for exclusive whole-day dates). - {{tl|Start date and years ago}} – as above
- {{tl|start-date}}, {{tl|end-date}} family (note dashes in name)
- {{tl|start-date}}, and {{tl|bday}} emit the required ISO8601 date with
class="dtstart"
. bday emits the class bday for vcards. - {{tl|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. - {{tl|timeline-item}} (with {{tl|timeline-start}} and {{tl|timeline-end}}) generate a definition list for a series of dated events, each being wrapped in an hCalendar microformat.
- {{tl|timeline-event}} for use in ordinary lists, etc.
- {{tl|timeline-links}} passes a page's set of hCalendar events to external timeline-generating and other hCalendar-using websites.
hCalendar should not be used for years outside the range 1583–9999 CE.
= hAtom =
[http://microformats.org/wiki/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_%28technical%29#address_element.
{{tl|start date}} and {{Tl|ISO date}} now emit the required ISO8601 date with class="updated"
.
= hMedia =
hMedia is for video media.
= hReview =
hReview is for marking up reviews, and could be used by, for example, :Template:Infobox Album.
= hProduct =
hProduct is for marking up products.
= hRecipe =
hRecipe is for marking up recipes and, by logical extension, singular foodstuffs.
= hRESTS =
[http://knoesis.org/?q=research/srl/projects/hRESTs hRESTS] is a microformat for describing web service API operations.
= Other =
- [http://microformats.org/wiki/hresume hResume]
- [http://microformats.org/wiki/rel-tag rel-tag]
- XFN
= Microformat-like formats =
For microformat-style schemes developed elsewhere, see:
- [http://microformats.org/wiki/poshformats poshformats on microformats.org]
Though not formally microformats (because they have not been developed using the "microformats process", and/ or involve hidden metadata), the following are related:
Classes
See /classes
Under development
= Species =
See /Species
Forthcoming
= Citations =
The proposed citation microformat will be very relevant, both for on-page citations and bibliographies, and for allowing people to cite Wikipedia, elsewhere.
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.
= Currency =
The proposed [http://microformats.org/wiki/currency 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?")
MediaWiki issues
- We need to be able to add classes and
rel
attributes to internal and external links, to generate, for example:
or:
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).
- We need to be able to add
tbody
elements, with classes, to groups of table rows.
For other issues encountered when adding microformats to Wikipedia and other pages, using Media Wiki mark-up, see [http://microformats.org/wiki/mediawiki-mark-up-issues]
= Bugs =
- [https://bugzilla.wikimedia.org/show_bug.cgi?id=4740 Bug 4740 - thead, tbody, tfoot for wikitable syntax]
- [https://bugzilla.wikimedia.org/show_bug.cgi?id=23225 Bug 23225 - REL & CLASS attributes in links]
- [https://bugzilla.wikimedia.org/show_bug.cgi?id=23226 Bug 23226 - CLASS attributes in IMG elements]