adr
This document represents adraftmicroformat specification. Although drafts are somewhat mature in the development process, the stability of this document cannot be guaranteed, and implementers should be prepared to keep abreast of future developments and changes. Watch this wiki page, or follow discussions on the#microformats IRC channelto stay up-to-date.
adr(pronounced "adder"; FAQ:"why 'adr'?") is a simple format for marking up address information, suitable for embedding in HTML, XHTML, Atom, RSS, and arbitrary XML.adris a 1:1 representation of theadrproperty in the vCard standard (RFC2426) in HTML, one of several openmicroformatstandards. It is also a property ofhCard.
Draft Specification
- Editor/Author
- Tantek Çelik(http://tantek /,and before atTechnorati, Inc.)
Copyright
Per the public domain release onmy user page,this specification is released into the public domain.
Public Domain Contribution Requirement.Since the author(s) released this work into the public domain, in order to maintain this work's public domain status, all contributors to this page agree to release their contributions to this page to the public domain as well. Contributors may indicate their agreement by adding thepublic domain release templateto their user page per theVoluntary Public Domain Declarations instructions.Unreleased contributions may be reverted/removed.
Patents
This specification is subject to a royalty free patent policy, e.g. per theW3C Patent Policy,and IETFRFC3667&RFC3668.
Inspiration and Acknowledgments
Thanks to everyone who participated in theGeo Microformat BOF at O'Reilly's Where 2.0 conference,and in particular toNat Torkingtonand Vee McMillen ofO'Reillyforarranging and hosting the BOF.
Introduction and Background
The vCard standard (RFC2426), has been broadly and interoperably implemented (e.g. Apple's Address Book application). ThehCardmicroformat has similarly received significant adoption, from numerous sites publishing the format, to hCard to vCard proxies, to clientside javascript parsers.
At theWhere 2.0 conferencein June 2005, there was widespread recognition that the community needed a way to simply and easily publish visible, extractable, address information on the Web, given how often bloggers, and numerous other sites publish address information. Thegeo microformat BOFdiscussed this very topic, and concluded with a consensus decision to just try usingadrfrom vCard/hCard.
This specification introduces theadrmicroformat, which is a 1:1 representation of the aforementionedadrproperty from the vCard standard, by simply reusing theadrproperty and sub-properties as-is from thehCardmicroformat.
Publishers can both embedadraddresses directly in their web pages and feeds, as well as markup existing addresses in the context of the rest of the information in their web pages and feeds.
If the publisher knows and is publishing thenameof the location in addition to its address, then the publisher MUST usehCardinstead of justadrto publish the name and address of the location.
Semantic XHTML Design Principles
Note: the Semantic XHTML Design Principles were written primarily within the context of developinghCardandhCalendar,thus it may be easier to understand these principles in the context of thehCard design methodology(i.e. read that first).Tantek
XHTML is built on XML, and thus XHTML based formats can be used not only for convenient display presentation, but also for general purpose data exchange. In many ways, XHTML based formats exemplify the best of both HTML and XML worlds. However, when building XHTML based formats, it helps to have a guiding set of principles.
- Reuse the schema (names, objects, properties, values, types, hierarchies, constraints) as much as possible from pre-existing, established, well-supported standards by reference. Avoid restating constraints expressed in the source standard. Informative mentions are ok.
- For types with multiple components, use nested elements with class names equivalent to the names of the components.
- Plural components are made singular, and thus multiple nested elements are used to represent multiple text values that are comma-delimited.
- Use the most accurately precisesemantic XHTMLbuilding block for each object etc.
- Otherwise use a generic structural element (e.g.
<span>
or<div>
), or the appropriate contextual element (e.g. an<li>
inside a<ul>
or<ol>
). - Use class names based on names from the original schema, unless the semantic XHTML building block precisely represents that part of the original schema. If names in the source schema are case-insensitive, then use an all lowercase equivalent. Components names implicit in prose (rather than explicit in the defined schema) should also use lowercase equivalents for ease of use. Spaces in component names become dash '-' characters.
- Finally, if the format of the data according to the original schema is too long and/or not human-friendly, use
<abbr>
instead of a generic structural element, and place the literal data into the 'title' attribute (where abbr expansions go), and the more brief and human readable equivalent into the element itself. Further informative explanation of this use of<abbr>
:Human vs. ISO8601 dates problem solved
Format
Singular Properties
SeehCard: Singular vs. Plural Propertiesfor the list of which "adr" properties (sub-properties in hCard) are singular. Note analysis in progress:adr-singular-properties.
Human vs. Machine readable
If an<abbr>
element is used for a property, then thetitle
attribute of the<abbr>
element is the value of the property, instead of the contents of the element, which instead provide a human presentable version of the value.
Similarly, if an<img>
element is used for one or more properties, it must be treated as follows:
- For the
PHOTO
property and any other property that takes aURLas its value, thesrc
attribute provides the property value. - For other properties, the
<img>
element'salt
attribute is the value of the property.
Value excerpting
Sometimes only part of an element which is the equivalent for a property should be used for the value of the property. For this purpose, the special class namevalue
is used to excerpt out the subset of the element that is the value of the property. SeehCardfor details on this.
Root Class Name
The root class name for anadraddress isadr
.
Property List
This is the list of properties inadr,taken fromhCard:
post-office-box
extended-address
street-address
locality
region
postal-code
country-name
Thetype
sub-property is omitted because without the context of a type of address forwhom,it doesn't make much sense.
XMDP Profile
Seehcard-profilefor theXMDPprofile of hCard which contains the above complete list of properties, with references to their RFC 2426 definitions.
Parsing Details
SeehCard parsing,with the only difference being that "adr" is the root class name, rather than "vcard".
Examples
This section is informative.
Sample adr
Here is a sampleadr
:
<div class= "adr" > <div class= "street-address" >665 3rd St.</div> <div class= "extended-address" >Suite 207</div> <span class= "locality" >San Francisco</span>, <span class= "region" >CA</span> <span class= "postal-code" >94107</span> <div class= "country-name" >U.S.A.</div> </div>
which might be displayed as:
Note that this is aliveadr
microformat, which will be found on this page by parsers.
More Examples
SeehCard example ADRfor more examples.
Seeadr examplesfor additional uses of ADR.
Examples in the wild
This section isinformative.
The following sites have published adrs, outside their normal context of hCards, and thus are a great place to start for anyone looking for examples "in the wild" to try parsing, inde xing, organizing etc., in addition tohCardexamples in the wild. If you find adrs outside of hCards anywhere else, feel free to add them to the top of this list. Once the list grows too big, we'll make a separate wiki page.
- I Prefer Guest Benefit Programuses adr on search results pages for city/state/country information, example:Search page for Bangalore
- Preferred Hotels and Resortsuses adr on search results pages for city/state/country information, example:Search page for London
- Sterling Hotelsuses adr on search results pages for city/state/country information, example:Search page for Barcelona
- Sterling Design Hotelsuses adr for city/state/country information on search results pages, example:Search page for Miami
- Grows on Youuses the microformat to mark up the addresses of open gardens.
- Stems Floristuses the microformat on the front page to markup up the two store addresses
- theMechanismuses the adr microformat to mark up the locations of
their offices.
- Mister-Mapuses the adr microformat to mark up the streets, zip-codes, regions and country names.
(See alsohcard-examples-in-wild)
Implementations
This section isinformative.
The following implementations have been developed which either generate or parse adrs outside the context of hCards. If you have an adr implementation, feel free to add it to the top of this list. Once the list grows too big, we'll make a separate wiki page.
- GreaseRouteis a GreaseMonkey user script (also available as a simple Firefox Extension) which will add icons for displaying the location, or route to, anadrusing a MapQuest map. The route is displayed from the starting location based on the viewer's IP-Address as determined by theHostIPgeolocation service.
- GreaseRouteEmbedis another GreaseMonkey user script that will actually embed a route image in the webpage when the user clicks the "route" link.
- GeoPressis aWordPressplugin that supports embedding adrs, geo, maps (dynamically switchable between Google-Yahoo-Microsoft Maps), andGeoRSSfeeds.
- pnh_mfis a plugin forTextpatternthat supports embedding adrs and other microformats in templates and blog posts. Written byChris Casciano.
- ThehCard creator,though it creates complete hCards, can also be used simply to create adrs by filling out the address portion and simply copy and pasting the <div class= "adr" > element and its contents.
References
Normative References
Informative References
Similar Work
Work in progress
This specification is a work in progress. As additional aspects are discussed, understood, and written, they will be added.
Discussions
Q&A
- If you have any questions about hCard, check thehCard FAQfirst, and if you don't find answers, add your questions! (Odds are that anyadrquestion will apply tohCardas well).
- See alsofor other methods of feedback.
Issues
- Please add any issues with the specification to the separatehCard issuesdocument. Ditto.
Related Pages
- adr
- adr-examples
- adr-cheatsheet
- adr forms part ofhcard,so for feedback and issues, please use: