xfolk

From Microformats Wiki
Revision as of 17:06, 7 July 2005 by Bud (talk | contribs) (→‎Example)
Jump to navigation Jump to search


xFolk

xFolk is a simple and open format for publishing collections of social bookmarks like those produced by de.licio.us, de.lirio.us, and blogmarks. Using xFolk makes it easy to develop and share generalized javascripts for manipulating bookmarks without having to learn the peculiarities of the service that generated them. xFolk also makes it possible for bookmarks to be easily remixed in external services like the experimental gataga search engine. xFolk may be embedded in (X)HTML, Atom, RSS, and arbitrary XML. It is one of several open microformat standards.

Draft Specification

Editor

Bud Gibson, The Community Engine

Authors

Copyright

This specification is (C) 2004-2024 by the authors. However, the authors intend to submit (or already have submitted, see details in the spec) this specification to a standards body with a liberal copyright/licensing policy such as the GMPG, IETF, and/or W3C. Anyone wishing to contribute should read their copyright principles, policies and licenses (e.g. the GMPG Principles) and agree to them, including licensing of all contributions under all required licenses (e.g. CC-by 1.0 and later), before contributing.

Patents

This specification is subject to a royalty free patent policy, e.g. per the W3C Patent Policy, and IETF RFC3667 & RFC3668.

Inspiration and Acknowledgments

Thanks to: David Plaut who introduced me to the idea that items may partially belong to many categories at once. More recently, thanks to: Tantek Çelik, Kevin Marks, Steve Mallet, Brian DelVecchio, and François Hodierne who have contributed to the development of xFolk with thoughtful critiques and implementations.

Introduction

Social bookmarking services let users save and tag bookmarks to share with other users. Over the past year, the number of these services has mushroomed, with popular examples including: del.icio.us, furl, de.lirio.us, and blogmarks.

Lack of an open, interoperable data standard is a major issue in using social bookmarking services. An open standard would make it possible to easily collect social bookmark data and remix it to invent new services along the lines of gataga's experimental bookmark search engine. An open standard would also make it possible to write javascripts that work across services as some currently do for del.icio.us, enabling across-the-board improvements in user experience.

xFolk is an open social bookmarking standard that aims to achieve both benefits. xFolk derives its name from folksonomy, the practice of aggregating bookmarks by tag or class, but currently has much broader application. Social bookmarking services that adopt xFolk will continue to differentiate themselves with data services. But, the data itself will be easy to manipulate by third party scripts and easy to share. As a result, bookmarking services will be able to offer a wider array of options to their users at low cost and focus on what truly differentiates them.

Semantic XHTML Design Principles

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.

  1. 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.
    1. For types with multiple components, use nested elements with class names equivalent to the names of the components.
    2. Plural components are made singular, and thus multiple nested elements are used to represent multiple text values that are comma-delimited.
  2. Use the most accurately precise semantic XHTML building block for each object etc.
  3. 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>).
  4. 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.
  5. 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

Extensive analysis of social bookmarking services and linkblogs, reported on here, here, here, and here, reveals that the data published by both bookmarking services and many different linkblogs can be covered with the following elements:

  • A bookmarked or tagged link.
  • A title for the entry.
  • Tags for the link.
  • An extended description or summary of the link.

As demonstrated in early iterations of the xFolk standard, this general schema can be translated into markup by:

  1. creating a container element for each entry of class xfolkentry,
  2. using an <a> element for the bookmarked or tagged link of class taggedlink,
  3. using title attribute for the tagged link <a> element, if it exists, as the entry title, otherwise using the element value,
  4. using reltag for the tags, and
  5. using a container element of class extended, such as <p>, for any extended description or summary.

A given xFolk entry will always contain a tagged link including a title with all other elements optional. Entries may have more than one tag as well as more than one element of class extended. Multiple elements of class extended are ordered using their document order. Semantic elements within xFolk entries may be nested at arbitray depths.

Many social bookmarking systems exist, each with its own markup conventions. Further, many people are already publishing personal link blogs. xFolk is proposed with ease of adapting these current practices as one of its prime concerns. Therefore, few assumptions are made as to the exact kinds of elements used for an xFolk entry. Rather, the work of defining semantics is left entirely to the class and rel (in the case of reltag) attribute values.

It is expected that developers will use XPath or equivalent syntax in accessing xFolk entry elements. a requirement for XPath is that the (X)HTML document be well-formed but not necessarily valid. Thus, while undesirable, it is possible to serviceably use xFolk in an (X)HTML document that does not validate.

XMDP Profile

See xFolk Entry 1.0 RC meta data profile for the XMDP profile of xFolk.

Example

Here is a sample bookmark as displayed in del.icio.us's standard markup:

<div class=“post”> 
             ------------
  <div>
    <a class=“delLink” href=“http://www.sifry.com/alerts/archives/000306.html”> <!--will change-->
      Sifry's Alerts: Technorati launches Related Tags
    </a> 
  </div>
  <div <strong>class=“extended”</strong>> 
    Ever wanted to see what posts are related to other posts, what tags 
    are related to others? Now you can! Just check under the Tag 
    description on most tag pages, like this one, or this one, and you'll
    see the patterns. Can you smell the emergence?
  </div>
  <div class=“meta”>
    to
    <a <strong>class=“delNav”</strong> href=“/fpgibson/folksonomy”>folksonomy</a>
    <a <strong>class=“delNav”</strong> href=“/fpgibson/technorati”>technorati</a>
    ... <a class=“delNav” href=“/url/cbcabf7de070fdb46598ee679367be49”>
    and 1 other person
    </a>
    ... on 2005-04-09
  </div>
</div>


and an equivalent in hCard with various elements optimized appropriately. See hCard Example 1 for the derivation.

<div class="vcard">
 <a class="url fn" href="http://tantek.com/">
  Tantek Çelik
 </a>
 <div class="org">Technorati</div>
</div>

This hCard might be displayed as::

Tantek Çelik
Technorati

Note: The version information is unnecessary in hCard markup directly since the version will be defined by the profile of hCard that is used/referred to in the 'profile' attribute of the <head> element.

Examples in the wild

This section is informative.

The following sites have published hCards, and thus are a great place to start for anyone looking for examples "in the wild" to try parsing, indexing, organizing etc. If you have an hCard on your own page, feel free to add it to the top of this list. Once the list grows too big, we'll make a separate wiki page.

Implementations

This section is informative.

The following implementations have been developed which either generate or parse hCards. If you have an hCard 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.

  • The hCard creator is a very simple, yet illustrative, open source user interface / form / script which creates an hCard in real-time as you type in a set of contact information.
  • rfc2629.xslt now attempts to generate hCard information (RFC2629 is an XML format for authoring RFCs and Internet Drafts, see example document)
  • iChat buddy list to hCards - Open source AppleScript to automatically convert one's buddy list in the MacOSX iChat AIM client into a valid XHTML 1.0 Strict list of hCards.
  • X2V is a bookmarklet that parses hCard and produces a .vcf (vCard) stream. Note: needs to be updated as the spec is refined

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. There is a separate document where we are keeping our brainstorms and other explorations relating to hCard:

Discussions

Q&A

  • If you have any questions about hCard, check the hCard FAQ, and if you don't find answers, add your questions!

Issues

  • Please add any issues with the specification to the separate hCard issues document.