# XFN and FOAF

- Eric A. Meyer

## Introduction

Although it would seem at first glance that XFN (XHTML Friends Network) and FOAF (Friend Of A Friend) are attempting to do the same thing, on closer inspection we can see a number of differences. Although they serve the same very laudable goal—allowing authors to express human relationships—their approaches and implications are dissimilar. This document aims to briefly compare and contrast the two technologies.

## XFN

XFN is a lightweight method of annotating links to indicate a personal relationship with the person responsible for the linked resource, and as such strengthens existing links in a manner that is both machine-readable and human-comprehensible.

Technically speaking, XFN is a relationship datatype with suggested values provided for ease of use in a wide variety of situations, including HTML, XHTML, and XML documents. Thanks to its simplicity and its foundation in existing specifications, it is very easily understood, and it is easily adopted by authors. By building upon the links that already exist in the Web, XFN complements existing information in place, as it were.

It is most likely that XFN will be used in "blogrolls," but of course any link to a personal Web site can be annotated using XFN values, regardless of the context in which that link appears. For example, a link from the text of a blog entry to another site might be given a `rel` attribute containing one or more XFN values. In a blogroll, the advantage in adding XFN information is that it can show which blogs belong to friends, which ones belong to acquaintances, and which ones are favorite sites but are not written by anyone the author knows personally. It is even possible that an author could create `meta` or `link` elements that use XFN values to express personal relationship information, but this approach is not encouraged by the creators of XFN, as it adds unnecessary complexity.

As an author-centric language, XFN relationships are solely in the hands of authors. It is the case that an author can claim a relationship that does not exist, but the lack of a return link can be taken as an indication that the relationship is a one-sided affair, or at best that one of the authors is lax in updating XFN information. In any case, is up to each author to provide information about his or her relationships with other people.

## FOAF

FOAF is an RDF format intended to provide "a way of representing information about people in a way that is easily processed, merged and aggregated" [1] and is primarily concerned with allowing an author to provide a detailed personal description, as well as provide machine-readable links to, and information about, other people.

Technically speaking, FOAF "is an RDF/XML 'Semantic Web' vocabulary"[2] with a suggested framework for expressing personal information, and which stands as its own resource, separate from any single document. It can also be included into a document written in another markup language as comments within that language, although this practice is not universally accepted. FOAF is extensible and potentially quite complex, and in addition to allowing an author to provide personal information, it allows others to provide information about an author, and vice versa.

FOAF has potential uses in a wide variety of situations, including but not limited to address books, contact databases, organizational directories, and the formation of virtual communities where the various members of a given social group can provide detailed information about themselves to each other, and to the world. Because it is so open-ended, the potential uses for FOAF could hardly be listed here. However, it does not have a defined way to represent any relationship other than "friend" (thus the name of the format), which could potentially limit its uses in situations where the participants in a FOAF network may not all agree on what it means to be a "friend."

Due to the way it is structured, FOAF makes it possible for other people to provide information about an author, whether or not said information is accurate. This opens the possibility of flawed personal information entering FOAF-space, and purging it with better information may be difficult or impossible. As of this writing, there is no apparent way to "mod" or rate the worth of a given piece of FOAF information, although such a mechanism would certainly help correct the potential problem of inaccuracies in FOAF-space.

## Combining XFN and FOAF

In cases where an author already has an investment in FOAF, or wishes to provide the deeper level of information FOAF allows, it is still possible to incorporate XFN. An author in this case would simply create a FOAF property that represents the relationship between two people, and use XFN values within that property, pointing to the XFN specification for normative definitions of the values used, thus providing a measure of stability to the expression of human relationships other than "friend." This allows the FOAF information to be enriched by the finer-grained relationship information embodied by XFN values.

1. [1] The FOAF FAQ, section 1.1.2: "What is FOAF?"
2. [2] Ibid.

And [XFN] [GMPG]