FOAF Vocabulary Specification 0.95

Namespace Document 26 November 2009 - Rehydrated Edition

This version:
http://xmlns.com/foaf/spec/20090606.html (rdf)
Latest version:
http://xmlns.com/foaf/spec/ (rdf)
Previous version:
http://xmlns.com/foaf/spec/20071002.html (rdf)
Authors:
Dan Brickley, Libby Miller
Contributors:
Members of the FOAF mailing list (foaf-dev@lists.foaf-project.org) and the wider RDF and SemWeb developer community. See acknowledgements.

Abstract

This specification describes the FOAF language, defined as a dictionary of named properties and classes using W3C's RDF technology.

Status of This Document

FOAF has been evolving gradually since its creation in mid-2000. There is now a stable core of classes and properties that will not be changed, beyond modest adjustments to their documentation to track implementation feedback and emerging best practices. New terms may be added at any time (as with a natural-language dictionary), and consequently this specification is an evolving work. The FOAF RDF namespace, by contrast, is fixed and it's identifier is not expected to change. Furthermore, efforts are underway to ensure the long-term preservation of the FOAF namespace, its xmlns.com domain name and associated documentation.

This document is created by combining the RDFS/OWL machine-readable FOAF ontology with a set of per-term documents. Future versions may incorporate multilingual translations of the term definitions. The RDF version of the specification is also embedded in the HTML of this document, or available directly from the namespace URI by content negotiation.

The FOAF specification is produced as part of the FOAF project, to provide authoritative documentation of the contents, status and purpose of the RDF/XML vocabulary and document formats known informally as 'FOAF'.

The authors welcome comments on this document, preferably via the public FOAF developers list foaf-dev@lists.foaf-project.org; public archives are available. A historical backlog of known technical issues is acknowledged, and available for discussion in the FOAF wiki. Proposals for resolving these issues are welcomed, either on foaf-dev or via the wiki. Further work is also needed on the explanatory text in this specification and on the FOAF website; progress towards this will be measured in the version number of future revisions to the FOAF specification.

This revision of the specification includes a first draft description of the new foaf:openid property. The prose description of this property is likely to evolve, but the basic mechanism seems robust. To accompany this support for OpenID in the FOAF specification, the FOAF wiki has also been updated to support usage of OpenID by members of the developer community. This revision of the spec also involves a change in the DTD declared at the top of the document. This is a foundation for using inline RDFa markup in future versions. The current version however does not yet validate according to this document format; it contains RDF/XML markup describing FOAF in machine-readable form. We welcome feedback on whether to retain this markup at the expense of DTD-based validation.

As usual, see the changes section for details of the changes in this version of the specification.

Table of Contents

FOAF at a glance

FOAF terms, grouped in broad categories.

FOAF Basics

Personal Info

Online Accounts / IM

Projects and Groups

Documents and Images

Example

Here is a very basic document describing a person:

<foaf:Person rdf:about="#me" xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <foaf:name>Dan Brickley</foaf:name>
  <foaf:mbox_sha1sum>241021fb0e6289f92815fc210f9e9137262c252e</foaf:mbox_sha1sum>
  <foaf:homepage rdf:resource="http://danbri.org/" />
  <foaf:img rdf:resource="/images/me.jpg" />
</foaf:Person>

This brief example introduces the basics of FOAF. It basically says, "there is a foaf:Person with a foaf:name property of 'Dan Brickley' and a foaf:mbox_sha1sum property of 241021fb0e6289f92815fc210f9e9137262c252e; this person stands in a foaf:homepage relationship to a thing called http://danbri.org/ and a foaf:img relationship to a thing referenced by a relative URI of /images/me.jpg

1 Introduction: FOAF Basics

The Semantic Web

To a computer, the Web is a flat, boring world, devoid of meaning. This is a pity, as in fact documents on the Web describe real objects and imaginary concepts, and give particular relationships between them. For example, a document might describe a person. The title document to a house describes a house and also the ownership relation with a person. Adding semantics to the Web involves two things: allowing documents which have information in machine-readable forms, and allowing links to be created with relationship values. Only when we have this extra level of semantics will we be able to use computer power to help us exploit the information to a greater extent than our own reading. - Tim Berners-Lee "W3 future directions" keynote, 1st World Wide Web Conference Geneva, May 1994

FOAF and the Semantic Web

FOAF, like the Web itself, is a linked information system. It is built using decentralised Semantic Web technology, and has been designed to allow for integration of data across a variety of applications, Web sites and services, and software systems. To achieve this, FOAF takes a liberal approach to data exchange. It does not require you to say anything at all about yourself or others, nor does it place any limits on the things you can say or the variety of Semantic Web vocabularies you may use in doing so. This current specification provides a basic "dictionary" of terms for talking about people and the things they make and do.

FOAF was designed to be used alongside other such dictionaries ("schemas" or "ontologies"), and to beusable with the wide variety of generic tools and services that have been created for the Semantic Web. For example, the W3C work on SPARQL provides us with a rich query language for consulting databases of FOAF data, while the SKOS initiative explores in more detail than FOAF the problem of describing topics, categories, "folksonomies" and subject hierarchies. Meanwhile, other W3C groups are working on improved mechanisms for encoding all kinds of RDF data (including but not limited to FOAF) within Web pages: see the work of the GRDDL and RDFa efforts for more detail. The Semantic Web provides us with an architecture for collaboration, allowing complex technical challenges to be shared by a loosely-coordinated community of developers.

The FOAF project is based around the use of machine readable Web homepages for people, groups, companies and other kinds of thing. To achieve this we use the "FOAF vocabulary" to provide a collection of basic terms that can be used in these Web pages. At the heart of the FOAF project is a set of definitions designed to serve as a dictionary of terms that can be used to express claims about the world. The initial focus of FOAF has been on the description of people, since people are the things that link together most of the other kinds of things we describe in the Web: they make documents, attend meetings, are depicted in photos, and so on.

The FOAF Vocabulary definitions presented here are written using a computer language (RDF/OWL) that makes it easy for software to process some basic facts about the terms in the FOAF vocabulary, and consequently about the things described in FOAF documents. A FOAF document, unlike a traditional Web page, can be combined with other FOAF documents to create a unified database of information. FOAF is a Linked Data system, in that it based around the idea of linking together a Web of decentralised descriptions.

The Basic Idea

The basic idea is pretty simple. If people publish information in the FOAF document format, machines will be able to make use of that information. If those files contain "see also" references to other such documents in the Web, we will have a machine-friendly version of today's hypertext Web. Computer programs will be able to scutter around a Web of documents designed for machines rather than humans, storing the information they find, keeping a list of "see also" pointers to other documents, checking digital signatures (for the security minded) and building Web pages and question-answering services based on the harvested documents.

So, what is the 'FOAF document format'? FOAF files are just text documents (well, Unicode documents). They are written in XML syntax, and adopt the conventions of the Resource Description Framework (RDF). In addition, the FOAF vocabulary defines some useful constructs that can appear in FOAF files, alongside other RDF vocabularies defined elsewhere. For example, FOAF defines categories ('classes') such as foaf:Person, foaf:Document, foaf:Image, alongside some handy properties of those things, such as foaf:name, foaf:mbox (ie. an internet mailbox), foaf:homepage etc., as well as some useful kinds of relationship that hold between members of these categories. For example, one interesting relationship type is foaf:depiction. This relates something (eg. a foaf:Person) to a foaf:Image. The FOAF demos that feature photos and listings of 'who is in which picture' are based on software tools that parse RDF documents and make use of these properties.

The specific contents of the FOAF vocabulary are detailed in this FOAF namespace document. In addition to the FOAF vocabulary, one of the most interesting features of a FOAF file is that it can contain "see Also" pointers to other FOAF files. This provides a basis for automatic harvesting tools to traverse a Web of interlinked files, and learn about new people, documents, services, data...

The remainder of this specification describes how to publish and interpret descriptions such as these on the Web, using RDF/XML for syntax (file format) and terms from FOAF. It introduces a number of categories (RDF classes such as 'Person') and properties (relationship and attribute types such as 'mbox' or 'workplaceHomepage'). Each term definition is provided in both human and machine-readable form, hyperlinked for quick reference.

What's FOAF for?

For a good general introduction to FOAF, see Edd Dumbill's article, XML Watch: Finding friends with XML and RDF (June 2002, IBM developerWorks). Information about the use of FOAF with image metadata is also available.

The co-depiction experiment shows a fun use of the vocabulary. Jim Ley's SVG image annotation tool show the use of FOAF with detailed image metadata, and provide tools for labelling image regions within a Web browser. To create a FOAF document, you can use Leigh Dodd's FOAF-a-matic javascript tool. To query a FOAF dataset via IRC, you can use Edd Dumbill's FOAFbot tool, an IRC 'community support agent'. For more information on FOAF and related projects, see the FOAF project home page.

Background

FOAF is a collaborative effort amongst Semantic Web developers on the FOAF (foaf-dev@lists.foaf-project.org) mailing list. The name 'FOAF' is derived from traditional internet usage, an acronym for 'Friend of a Friend'.

The name was chosen to reflect our concern with social networks and the Web, urban myths, trust and connections. Other uses of the name continue, notably in the documentation and investigation of Urban Legends (eg. see the alt.folklore.urban archive or snopes.com), and other FOAF stories. Our use of the name 'FOAF' for a Web vocabulary and document format is intended to complement, rather than replace, these prior uses. FOAF documents describe the characteristics and relationships amongst friends of friends, and their friends, and the stories they tell.

FOAF and Standards

It is important to understand that the FOAF vocabulary as specified in this document is not a standard in the sense of ISO Standardisation, or that associated with W3C Process.

FOAF depends heavily on W3C's standards work, specifically on XML, XML Namespaces, RDF, and OWL. All FOAF documents must be well-formed RDF/XML documents. The FOAF vocabulary, by contrast, is managed more in the style of an Open Source or Free Software project than as an industry standardarisation effort (eg. see Jabber JEPs).

This specification contributes a vocabulary, "FOAF", to the Semantic Web, specifying it using W3C's Resource Description Framework (RDF). As such, FOAF adopts by reference both a syntax (using XML) a data model (RDF graphs) and a mathematically grounded definition for the rules that underpin the FOAF design.

The FOAF Vocabulary Description

This specification serves as the FOAF "namespace document". As such it describes the FOAF vocabulary and the terms (RDF classes and properties) that constitute it, so that Semantic Web applications can use those terms in a variety of RDF-compatible document formats and applications.

This document presents FOAF as a Semantic Web vocabulary or Ontology. The FOAF vocabulary is pretty simple, pragmatic and designed to allow simultaneous deployment and extension. FOAF is intended for widescale use, but its authors make no commitments regarding its suitability for any particular purpose.

Evolution and Extension of FOAF

The FOAF vocabulary is identified by the namespace URI 'http://xmlns.com/foaf/0.1/'. Revisions and extensions of FOAF are conducted through edits to this document, which by convention is accessible in the Web via the namespace URI. For practical and deployment reasons, note that we do not update the namespace URI as the vocabulary matures.

The core of FOAF now is considered stable, and the version number of this specification reflects this stability. However, it long ago became impractical to update the namespace URI without causing huge disruption to both producers and consumers of FOAF data. We are therefore left with the digits "0.1" in our URI. This stands as a warning to all those who might embed metadata in their vocabulary identifiers.

The evolution of FOAF is best considered in terms of the stability of individual vocabulary terms, rather than the specification as a whole. As terms stabilise in usage and documentation, they progress through the categories 'unstable', 'testing' and 'stable'.

The properties and types defined here provide some basic useful concepts for use in FOAF descriptions. Other vocabulary (eg. the Dublin Core metadata elements for simple bibliographic description), RSS 1.0 etc can also be mixed in with FOAF terms, as can local extensions. FOAF is designed to be extended. The FoafVocab page in the FOAF wiki lists a number of extension vocabularies that are particularly applicable to use with FOAF.

FOAF Auto-Discovery: Publishing and Linking FOAF files

If you publish a FOAF self-description (eg. using foaf-a-matic) you can make it easier for tools to find your FOAF by putting markup in the head of your HTML homepage. It doesn't really matter what filename you choose for your FOAF document, although foaf.rdf is a common choice. The linking markup is as follows:

  <link rel="meta" type="application/rdf+xml" title="FOAF"
               href="http://example.com/~you/foaf.rdf"/>

...although of course change the URL to point to your own FOAF document. See also: more on FOAF autodiscovery and services that make use of it.

FOAF and RDF

Why does FOAF use RDF?

FOAF is an application of the Resource Description Framework (RDF) because the subject area we're describing -- people -- has so many competing requirements that a standalone format could not do them all justice. By using RDF, FOAF gains a powerful extensibility mechanism, allowing FOAF-based descriptions can be mixed with claims made in any other RDF vocabulary

People are the things that link together most of the other kinds of things we describe in the Web: they make documents, attend meetings, are depicted in photos, and so on. Consequently, there are many many things that we might want to say about people, not to mention these related objects (ie. documents, photos, meetings etc).

FOAF as a vocabulary cannot incorporate everything we might want to talk about that is related to people, or it would be as large as a full dictionary. Instead of covering all topics within FOAF itself, we buy into a larger framework - RDF - that allows us to take advantage of work elsewhere on more specific description vocabularies (eg. for geographical / mapping data).

RDF provides FOAF with a way to mix together different descriptive vocabularies in a consistent way. Vocabularies can be created by different communites and groups as appropriate and mixed together as required, without needing any centralised agreement on how terms from different vocabularies can be written down in XML.

This mixing happens in two ways: firstly, RDF provides an underlying model of (typed) objects and their attributes or relationships. foaf:Person is an example of a type of object (a "class"), while foaf:knows and foaf:name are examples of a relationship and an attribute of an foaf:Person; in RDF we call these "properties". Any vocabulary described in RDF shares this basic model, which is discernable in the syntax for RDF, and which removes one level of confusion in understanding a given vocabulary, making it simpler to comprehend and therefore reuse a vocabulary that you have not written yourself. This is the minimal self-documentation that RDF gives you.

Secondly, there are mechanisms for saying which RDF properties are connected to which classes, and how different classes are related to each other, using RDF Syntax and OWL. These can be quite general (all RDF properties by default come from an rdf:Resource for example) or very specific and precise (for example by using OWL constructs, as in the foaf:Group example below. This is another form of self-documentation, which allows you to connect different vocabularies together as you please. An example of this is given below where the foaf:based_near property has a domain and range (types of class at each end of the property) from a different namespace altogether.

In summary then, RDF is self-documenting in ways which enable the creation and combination of vocabularies in a devolved manner. This is particularly important for a vocabulary which describes people, since people connect to many other domains of interest, which it would be impossible (as well as suboptimal) for a single group to describe adequately in non-geological time.

RDF is usually written using XML syntax, but behaves in rather different ways to 'vanilla' XML: the same RDF can be written in many different ways in XML. This means that SAX and DOM XML parsers are not adequate to deal with RDF/XML. If you want to process the data, you will need to use one of the many RDF toolkits available, such as Jena (Java) or Redland (C). RDF Interest Group members can help with issues which may arise; there is also the rdfweb-dev@yapours.rdfweb.org mailing list which is the main list for FOAF, and two active and friendly IRC channels: #rdfig and #foaf on freenode.

FOAF cross-reference: Listing FOAF Classes and Properties

FOAF introduces the following classes and properties. View this document's source markup to see the RDF/XML version.

%s %s

External Vocabulary References

The description of the terms in the FOAF 'dictionary' often make reference to classes and properties elsewhere. This section of the FOAF specification provides a placeholder reference for any FOAF mention of externally defined terms. For example, sometimes we might say that FOAF property has a domain or range of an externally defined class, or that a FOAF class is a sub-class of an external class, or 'disjoint with' such a class (ie. has no common members). Such claims help fix the intended meaning of FOAF terms in relationship to other 'peer' vocabularies.

Status Vocabulary

Each term in FOAF is annotated with properties from the SemWeb Vocab Status Ontology

This was created as an experiment in documenting FOAF's term-centric versioning model, in which a common fixed namespace URI is used, while term definitions slowly and independently evolve through different stability levels. This contrasts with other approaches to versioning which attach versioning information to larger sets of terms.

Note that this mechanism is itself experimental and, in theory at least, 'unstable'. The definitions of 'stable', 'unstable' and 'testing' cannot be defined as global absolutes, but only in relationship to the practices, expectations and social structures around some vocabulary. For their use in FOAF, future versions of this specification could usefully offer more detail about what to expect from a term labelled 'stable'.

vs:term_status
The vs:term_status property indicates the status of a vocabulary term, one of 'stable','unstable','testing'.

W3C Basic Geo (WGS84 lat/long) Vocabulary

Members of the FOAF and W3C Semantic Web Interest Group communities collaborated in 2003 to create a very simple vocabulary that described points in geographic space. This is the W3CBasic Geo Vocabulary. It assumes use of the WGS84 reference system and defines properties geo:lat, geo:long and geo:alt in terms of a class geo:SpatialThing.

The foaf:based_near property relates a spatial thing (typically a foaf:Agent of some kind) to another spatial thing, which can be described using geo:lat, geo:long etc.

RDF Vocabulary Description - core concepts

The FOAF dictionary of terms is defined using a family of W3C standards: RDF, RDF Schema and OWL. These share a data model and general approach, and provide for increasing levels of expressivity. Here we introduce the core OWL and RDF/S terms used directly in the machine-readable description of FOAF. See W3C's site for the latest and most authoritative OWL and RDF specifications.

FOAF is based on the exchange of free-form descriptions that are structured in terms of things having properties, where the value of each property is expressed as either textually (eg. a name or number), or by reference to another thing. FOAF (as an application of RDF) uses URI identifiers wherever possible to talk about things of interest, whether they are Web pages, classes of thing, properties of things, or even people. See the W3C Web Architecture specification for more background on URIs.

From core RDF, FOAF takes the notion that we are talking about things, and they fall into categories; we call these 'classes'. The core machinery we use from the RDF Schema and OWL technologies simply give us some built-in terminology for talking about things, classes and properties. Here we introduce some of these core concepts and discuss briefly how they relate to FOAF's approach to describing things.

rdf:Property
RDF has a built-in class called rdf:Property. This is the class of all things like foaf:homepage or dc:creator which define named kinds of relationship between pairs of things, or between things and textually-expressed information.
owl:DatatypeProperty
The OWL specifications give a name for those properties whose values are textually-expressed: "DataTypeProperty". RDF allows these to be either plain literal values (these can also carry an indicator of their language, via xml:lang), or else "data-typed", which means they are marked with a URI indicating their type (but no language tagging).
owl:ObjectProperty
ObjectProperty is OWL's name for those properties which are not textually-expressed; instead, they are used when mentioning or referring to some other thing. OWL encourages vocabularies to avoid using a single named property in both 'ObjectProperty' and 'DataTypeProperty' styles. However earlier usage, notably in the Dublin Core community, does just this. Each FOAF property is either an Object Property or DataType Property.
rdf:type
One of the most commonly used built-in relationships in RDF is 'type'. RDF type relates something to a class that it is in.
rdfs:subClassOf
RDFS gives a name for the relationship between some specific class and its more general superclass: 'subClassOf'. It would have perhaps been simpler if this was called 'superProperty'. So for example we say that foaf:Person has a subPropertyOf property whose value is foaf:Agent.
rdfs:Class
RDFS gives the name 'Class' to those things that represent classes of thing, ie. which are values of rdf:type for their members. The OWL language also (for technical reasons) defines owl:Class for essentially the same notion. OWL also includes powerful machinery for defining the membership rules for classes. This is not heavily used in FOAF, beyond the experimental mechanisms associated with foaf:Group.
rdfs:subClassOf
RDFS gives a name for the relationship between some specific class and its more general superclass: 'subClassOf'. It would have perhaps been simpler if this was called 'superProperty'. So for example we say that foaf:Person has a subPropertyOf property whose value is foaf:Agent.
rdfs:subPropertyOf
Similar to subClassOf but for hierarchies of properties, we can use rdfs:subPropertyOf to point to a more general super-property, for example we say foaf:aimChatID rdfs:subPropertyOf foaf:nick.
rdfs:domain
The RDFS specification introduced the notion of a property's domain. This is a way of saying, for some property, something about the kind of classes it is used with. If you know the domain or domains for some property, you know that whenever you see that property applied to something, then that thing ought to be a member of those classes. Note that this does not mean that every description using the property is compelled to mention all those classes, just that the meaning of the property implies also the type of the thing the property is applied to.
rdfs:range
RDFS also defines a property of properties called 'range'; this works just like rdfs:domain, except for the values of a property. If you know the range of some property, you know what kinds of thing are reasonable values for it.
owl:FunctionalProperty
OWL provides even more useful information about properties, such as the ability to say that a property is 'functional'. This means simply that for any particular thing, you can expect at most one value for that property. It is simplest to think of this as contextualised to any given time; although OWL doesn't talk about time explicitly. So we might say that 'age' is functional, even though a series of FOAF documents might be published, each truthfully giving different values for my 'age' which made sense in their original context. At the time of writing, the only W3C technology that can take a larger perspective on such different perspectives / views (or 'graphs') is SPARQL. If you have two different values for a given functional property, you know you have a problem; perhaps one is out-of-date, for example. Or perhaps they only differ in trivial detail (eg. date syntax, whitespace).
owl:InverseFunctionalProperty
OWL also gives a name for properties where common values tell us something about the identity of the thing having the property. On the Web this can be very useful. OWL tells us that two descriptions are of the same thing, if they include truthful mention of some 'inverse functional property' that has the same value. The classic FOAF example could be two mentions of a person having some particular foaf:homepage. This OWL construct is very useful for reasoning about identity and merging scattered and partial descriptions.
owl:inverseOf
OWL provides a property 'inverseOf' that holds between inverse properties; for example, any two things related by foaf:maker are related in the reverse direction by foaf:made.
owl:disjointWith
OWL also lets us indicate that two classes have no common members. This can be useful for clarifying modelling assumptions in a language-neutral manner; eg. we might ask whether anything can be both a foaf:Group and a foaf:Organization simultaneously.

Dublin Core terms

The Dublin Core specification provides term definitions that focus on issues of resource discovery, document description and related concepts useful for cultural heritage and digital library applications. FOAF can be used alongside any variants of Dublin Core, but works most effectively with the most modern Dublin Core terms namespace. Note that here we use the prefix 'dct:' to stand for the DC Terms namespace; however it is not unusual to see 'dc' also used.

dct:Agent
Dublin Core's notion of Agent is much like FOAF's; Dublin Core says "A resource that acts or has the power to act.", we say "things that do stuff". As nobody has provided a counter-example of something fitting one definition but not the other, we say here that foaf:Agent stands in an 'equivalent class' relationship to dct:Agent (and vice-versa).
dct:creator
The notion of 'creator' in the latest versions of Dublin Core matches FOAF's notion of 'maker'; based on their definitions, every pair of things that are related by one of those properties are also related by the other. We express this by saying that these properties stand in an 'equivalent property' relationship' to one another.

Wordnet terms

Earlier versions of this specification used an experimental companion namespace produced from the lexical database Wordnet (v1.6). This is currently offline, and corresponding sub-class relationships have been ommited from the FOAF documentation. More recent RDF representations of Wordnet now exist, however they don't map Wordnet synsets to classes, so can't be directly used here. Future versions of this specification might restore links to some version of Wordnet in RDF.

SIOC terms

Many terms in the SIOC vocabulary are defined with reference to FOAF. See the SIOC project for details. Future versions of this specification may provide more information here.