A vocabulary for describing people, the links between them, and the things they create and do.
FOAF began as a playful idea: let people publish a machine-readable file about themselves and the people they know, so that the web could be crawled as a social graph. The project was started in 2000 by Dan Brickley and Libby Miller. The personal-profile use faded with the rise of closed social networks, but the vocabulary outlived it. FOAF terms are now some of the most reused in linked data, mostly for describing people, organizations and the documents about them.
Namespace and versions
All FOAF terms live under http://xmlns.com/foaf/0.1/. The 0.1 is frozen. The specification has been revised many times, reaching version 0.99 in 2014, but the namespace stayed the same so that data written in 2002 still uses valid terms. Instead of changing URIs, FOAF marks each term with a status:
| Status | Meaning |
|---|---|
| stable | not expected to change |
| testing | widely used, may still be refined |
| unstable | may change or be removed |
| archaic | kept for older data, not recommended |
Several heavily used terms, including foaf:depiction, have long carried the “testing” label despite wide adoption.
Core classes
FOAF’s classes cover the usual subjects of a profile: foaf:Agent and its subclasses foaf:Person, foaf:Organization and foaf:Group; foaf:Document and its subclass foaf:Image; foaf:OnlineAccount; and foaf:Project. A foaf:PersonalProfileDocument is a document describing a person, the original FOAF file.
The class foaf:Agent is broad on purpose. It covers anything that acts, including software, which is useful when a record needs to say an automated service produced something.
There is no FOAF class for places or events. Projects that need them combine FOAF with other vocabularies, for instance W3C Basic Geo for coordinates or schema.org for events, and FOAF stays focused on agents and documents.
Properties most often reused
Outside personal profiles, a handful of FOAF properties do most of the work:
- foaf:name, a sub-property of
rdfs:label, gives anything a name. - foaf:page and foaf:isPrimaryTopicOf link things to documents about them.
foaf:depictionlinks things to images.foaf:homepageandfoaf:mboxidentify agents.
For people specifically, FOAF adds foaf:nick, foaf:givenName, foaf:familyName, foaf:knows, and contact properties such as foaf:phone. Organizations use foaf:member to list members.
Identity without central identifiers
FOAF was designed at a time when most people had no URI. Its answer was inverse functional properties. foaf:mbox, foaf:homepage and foaf:isPrimaryTopicOf are declared so that two descriptions sharing a value can be inferred to describe the same thing. foaf:mbox_sha1sum allowed this to work with a hash of the email address, so the address itself need not be published. The protection is weak, since a known address can be hashed and compared, but it kept addresses out of plain view for casual crawlers.
The technique still works, and it still needs care. Shared generic mailboxes (an “info@” address used by a whole office) or shared landing pages will merge distinct people. Many current data sets use stable URIs and authority links (ORCID, VIAF, Wikidata) for identity, and keep FOAF for descriptive properties.
FOAF beside other vocabularies
FOAF combines naturally with Dublin Core. A typical record uses dcterms:creator to point from a work to a person, and FOAF to describe that person. With SKOS, FOAF covers agents while concepts and subjects stay in the SKOS vocabulary. For detailed contact information, the W3C vCard ontology provides typed addresses and telephone numbers that FOAF does not, and schema.org overlaps with FOAF for basic person properties; mappings between the two are routine in data that targets both linked data clients and search engines.
Example in RDF
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<https://example.org/id/person/0412> a foaf:Person ;
foaf:name "Ana Lee" ;
foaf:nick "alee" ;
foaf:mbox <mailto:[email protected]> ;
foaf:homepage <https://example.org/people/ana-lee/> ;
foaf:depiction <https://example.org/images/ana-lee.jpg> ;
foaf:knows <https://example.org/id/person/0977> .
<https://example.org/id/org/city-library> a foaf:Organization ;
foaf:name "City Library" ;
foaf:member <https://example.org/id/person/0412> .
Questions about FOAF
What is FOAF?
FOAF, short for Friend of a Friend, is an RDF vocabulary for describing people, organizations, groups, documents and the relationships between them. It was started in 2000 by Dan Brickley and Libby Miller and is one of the most widely reused vocabularies in linked data.
What is the FOAF namespace?
The namespace is http://xmlns.com/foaf/0.1/ and the usual prefix is foaf. The 0.1 in the URI has never changed, even though the specification itself has reached version 0.99, so that existing data remains valid.
Is FOAF an ontology or a vocabulary?
Both terms are used. FOAF is written in RDFS and OWL and includes a few OWL features such as inverse functional properties, but it is designed as a practical vocabulary for describing things, not a formal model of a domain.
What do the FOAF term status labels mean?
Each FOAF term is marked stable, testing, unstable or archaic. Stable terms are not expected to change, testing terms are in wide use but could still be refined, unstable ones may change, and archaic ones are kept only for older data.
Is FOAF still used?
Yes. Personal FOAF profile files are less common than in the 2000s, but FOAF terms such as foaf:name, foaf:page, foaf:depiction and foaf:isPrimaryTopicOf are used throughout linked data, including DBpedia, library authority data and many institutional data sets.