FOAF - Friend of a Friend

Chapter 8 : Introduction to the Semantic Web

Eng. Dr. Tiroshan Madushanka

What is FOAF?

Friend of a Friend Vocabulary

Official Definition

"FOAF is all about creating and using machine-readable homepages that describe people, the links between them, and the things they create and do."

❌ Traditional Web Pages

  • Personal info readable only by humans
  • Cannot be processed automatically
  • No standard format
  • Isolated information islands

✓ FOAF Documents

  • Machine-readable personal data
  • Automatic agent processing
  • Standard vocabulary (OWL)
  • Aggregatable & cross-linkable

Key Insight

FOAF is simply a vocabulary (ontology) written in OWL that includes standard terms to describe personal information. It serves as a standard for everyone who wants to markup their homepages in a machine-readable format.

Why FOAF Matters

The Power of Aggregation
👤 You
👤 Friend
👤 Friend

A decentralized network of machine-readable personal data

Aggregation Magic

Suppose you publish a simple FOAF document with just your name and homepage. Your friend publishes her FOAF document using foaf:knows to link to you, and includes a foaf:plan describing your current life goals. After aggregation, your profile suddenly includes a plan you didn't even add!

FOAF Benefits

  • Decentralized Creation: Each individual controls their own data
  • Comprehensive Views: Aggregation combines distributed information
  • Community Navigation: Cross-link members and find similar interests
  • Search Enhancement: Engines can personalize results based on interests

FOAF Vocabulary

Core Terms for Personal Information

FOAF Namespace

http://xmlns.com/foaf/0.1/

foaf:Person

Core class

foaf:name

Full name

foaf:nick

Nickname

foaf:mbox

Email address

foaf:homepage

Personal website

foaf:knows

Relationships

foaf:img

Image

foaf:title

Title (Dr, Mr)

foaf:depiction

Picture of person

📌 Vocabulary Scope

Today, the FOAF vocabulary also includes basic terms to describe documents, projects, groups, and organizations such as companies. It is the most frequently encountered RDF document on the Internet!

Identifying People

The foaf:mbox Property

The Challenge

How do you uniquely identify a person without a central URI authority? FOAF uses email addresses as practical identifiers since friends typically know each other's emails.

foaf:mbox INVERSE FUNCTIONAL

Defined as an inverse functional property, ensuring that at most one individual can own a specific email. If two FOAF documents have the same foaf:mbox value, they describe the same person.

<foaf:Person> <foaf:name>Liyang Yu</foaf:name> <foaf:mbox rdf:resource="mailto:liyang910@yahoo.com"/> </foaf:Person> <!-- In a friend's document: --> <foaf:Person> <foaf:name>lao yu</foaf:name> <foaf:mbox rdf:resource="mailto:liyang910@yahoo.com"/> <foaf:title>Dr</foaf:title> </foaf:Person> <!-- Agent concludes: Same person with two names! -->

foaf:mbox_sha1sum PRIVACY PROTECTION

A SHA1 hash representation of your email address. Long and ugly, but protects your privacy from spam while still uniquely identifying you!

Describing Relationships

The foaf:knows Property

Connecting People

The foaf:knows property describes relationships between people. It creates the social graph that makes FOAF powerful.

<foaf:Person> <foaf:name>Liyang Yu</foaf:name> <foaf:mbox rdf:resource="mailto:liyang910@yahoo.com"/> <foaf:knows> <foaf:Person> <foaf:name>Jin Chen</foaf:name> <foaf:mbox rdf:resource="mailto:yuchen@yuchen.net"/> </foaf:Person> </foaf:knows> </foaf:Person>

⚠️ Important Note

foaf:knows is NOT symmetric! "I know Jin Chen" does not imply "Jin Chen knows me." Check the FOAF vocabulary definition to confirm this.

rdfs:seeAlso HYPERLINK OF FOAF

Acts as a hyperlink to another FOAF document. This is how the crawler (called scutter) discovers and builds the network of FOAF documents. Essential for connecting your document to the wider FOAF circle!

Pictures in FOAF

foaf:depiction vs foaf:depicts

foaf:depiction

  • Entity → Image relationship
  • "This person is shown in this image"
  • Used FROM the Person object
  • foaf:depiction rdf:resource="photo.jpg"

foaf:depicts

  • Image → Entity relationship
  • "This image shows this person"
  • Inverse of depiction
  • foaf:depicts rdf:resource="#person"
<foaf:Person> <foaf:name>Liyang Yu</foaf:name> <foaf:mbox rdf:resource="mailto:liyang910@yahoo.com"/> <foaf:depiction rdf:resource="http://www.yuchen.net/yu.jpg"/> </foaf:Person>

Understanding the Difference

depiction: "I (the person) am depicted in this image"
depicts: "This image depicts me (the person)"
They are inverse properties - choose based on your starting point!

The FOAF Circle

How the Architecture Works
1

Create Your FOAF Document

Use the FOAF vocabulary. Remember to use foaf:knows to connect with friends and rdfs:seeAlso to link to other documents.

2

Link Your Homepage

Add a link from your HTML homepage to your FOAF document. Make the document accessible online.

3

Scutter Crawls the Web

The FOAF crawler (called scutter) visits the Web, finds FOAF files, and follows rdfs:seeAlso links to build the network.

4

Central Repository Maintained

The framework stores all information in a centralized database, keeping it up to date by running the scutter periodically.

5

User Interface for Exploration

Tools like FOAF Web view, FOAF Explorer, and foafnaut let you navigate and find friends in the circle.

Creating Your FOAF Document

Interactive FOAF Builder

🛠️ Build Your FOAF Profile

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1/"> <foaf:Person> <foaf:name>Your Name</foaf:name> <foaf:mbox rdf:resource="mailto:you@example.com"/> </foaf:Person> </rdf:RDF>

💡 Tools Available

The most popular tool for creating FOAF documents is FOAF-a-matic, a web-based authoring tool. You can also use a simple text editor with the FOAF vocabulary, then validate your document to ensure correct syntax.

Publishing Your FOAF

Joining the Circle

Step 1: Link Your Homepage

Add a link tag in your HTML header pointing to your FOAF document:

<!-- In your homepage HTML --> <html> <head> <link rel="meta" type="application/rdf+xml" title="FOAF" href="foaf.rdf"/> </head> <body>...</body> </html>

Methods to Join the Circle

  • FOAF Autodiscovery: Once you add the link tag, you're automatically linked to the circle!
  • Friend's rdfs:seeAlso: Ask a friend already in the circle to add a rdfs:seeAlso link to your document
<!-- Your friend adds this to their FOAF document --> <foaf:knows> <foaf:Person> <foaf:mbox rdf:resource="mailto:you@you.com"/> <rdfs:seeAlso rdf:resource="http://path_to_your_foaf.rdf"/> </foaf:Person> </foaf:knows>

Reusing FOAF Vocabulary

Updating the Camera Ontology

The Rule of Reuse

If an existing ontology has the terms you need, reuse it! This reduces duplicate ontologies and improves interoperability. Applications that understand one ontology will easily understand yours.

Camera Ontology + FOAF

Our camera ontology had a Person class. Since foaf:Person has the same semantics, we can make Photographer a direct subclass of foaf:Person instead of defining our own!

<!-- Before: Our own Person class --> <owl:Class rdf:ID="Person"/> <owl:Class rdf:ID="Photographer"> <rdfs:subClassOf rdf:resource="#Person"/> </owl:Class> <!-- After: Reusing FOAF --> <owl:Class rdf:ID="Photographer"> <rdfs:subClassOf rdf:resource="http://xmlns.com/foaf/0.1/Person"/> </owl:Class>

🎯 Benefits of Reuse

Fewer ontology documents = less ontology matching/merging headaches. Existing FOAF-aware applications will automatically understand your Photographer class!

FOAF Applications

Real-World Use Cases
  • 🔍 Enhanced Search Engines

    Search engines can locate your FOAF document and understand your interests, allowing them to rank results or exclude irrelevant pages.

  • 🛒 E-Commerce Personalization

    Online stores can read your FOAF file to recommend products based on your interests. They could even email your friends recommending products you bought!

  • 🎪 Conference Networking

    Navigate through FOAF documents to find participants with similar interests. Essential for large conferences with thousands of attendees!

  • 📊 Project Progress Reports

    Multiple research groups working on the same project can integrate their FOAF files to generate comprehensive, up-to-date progress reports automatically.

The Big Picture

Swoogle and FOAF are presented as Semantic Web examples to inspire you and demonstrate how the Semantic Web can be used in real-world applications. What will you create?

Knowledge Check

Test Your Understanding

Quiz: FOAF Concepts

Why is foaf:mbox defined as an inverse functional property?
What is the FOAF crawler called?

Chapter Summary

Key Takeaways

What We Learned

  • FOAF is a vocabulary/ontology for describing personal information in machine-readable format
  • Namespace: http://xmlns.com/foaf/0.1/
  • foaf:mbox is an inverse functional property that uniquely identifies people
  • foaf:knows creates the social graph (NOT symmetric!)
  • rdfs:seeAlso acts as the hyperlink between FOAF documents
  • The scutter crawler builds the network by following rdfs:seeAlso links
  • Reuse FOAF vocabulary in your own ontologies when applicable

FOAF in Practice

FOAF documents can be aggregated, explored, and cross-linked easily. This enables powerful applications from enhanced search to e-commerce personalization to conference networking.

🚀 Your Turn

Create your own FOAF document, link it to your homepage, and join the circle of friends! The Semantic Web is built by participation.

1 / 14