Topics

As part of our work on FriendSpace, we've been thinking about the relationships between agents, the things they create and their interests. What's particularly interesting to me is whether or not particular "topics" can be discovered from the information each person includes in their FOAF and other documents.

FOAF has an interest property which can be used to express an interest like this:

<foaf:interest
  rdf:resource="http://example.com/document"/>

In the FOAF schema, the range of interest is a foaf:Document, which means that the application can conclude that http://example.com/document is a document. You could additionally specify a topic for the document like this:

<foaf:interest>
  <rdf:Description rdf:about="http://example.com/document">
    <foaf:topic rdf:resource="http://example.com/topic"/>
  </rdf:Description>
<foaf:interest>

FOAF specifies the range of foaf:topic to be a Resource, i.e. it could be anything. Conceptually this looks like:

A graph depicting a node labelled Agent, a node labelled Document and a node labelled with a question mark. The Agent node has an arrow pointing to the Document node  labelled interest. The Document node has an arrow pointing to the question mark node labelled topic, the question mark node has a label pointing back to the Document node labelled page.

I've also shown how the topic resource can refer back to the document, using the page property. There is an implication here that the agent is "interested" in the "topic" but this has to be a different sense of "interest" to that specified by FOAF since the range of interest is document and one can certainly be interested in things that aren't documents. FOAF does in fact provide the necessary property: topic_interest. However, this property is labelled as The foaf:topic_interest property is generally found to be confusing and ill-defined and is a candidate for removal. The goal was to be link a person to some thing that is a topic of their interests (rather than, per foaf:interest to a page that is about such a topic).. Some of the confusion may be caused by the spec itself which appears to be schizophrenic, referring to both topic_interest and interest_topic. Nevertheless, I think there's a case for reintroducing this property. More on this later.

You can also specify the topic of a weblog in a similar fashion:

<foaf:weblog>
  <rdf:Description rdf:about="http://example.com/weblog">
    <foaf:topic rdf:resource="http://example.com/topic"/>
  </rdf:Description>
<foaf:interest>

A graph depicting a node labelled Agent, a node labelled Document and a node labelled with a question mark. The Agent node has an arrow pointing to the Document node  labelled weblog. The Document node has an arrow pointing to the question mark node labelled topic, the question mark node has a label pointing back to the Document node labelled page.

What does this imply about the agent? There's certainly some level of "interest" in the "topic" since they're maintaining a weblog about it. However the implication is not, in my opinion, as strong as the previous one.

In his WordPress hack for RSS 1.0 output, Morten Frederiksen includes a foaf:topic for each rss:item like this:

<rss:item rdf:about="http://example.com/item">
  <foaf:topic rdf:parseType="Resource">
    <dc:title>topic name</dc:title>
    <foaf:page rdf:resource="http://example.com/document"/>
  </foaf:topic>
  <foaf:maker>
    <foaf:Person>
      <foaf:name>name</foaf:name>
    </foaf:Person>
  </foaf:maker>
</rss:item>

This results in a graph similar to this:

A graph depicting a node labelled Agent, a node labelled item, a node labelled Document and a node labelled with a question mark. The item node has an arrow pointing to the Agent node labelled maker and an arrow pointing to the question mark node labelled topic, the question mark node has a label pointing to the Document node labelled page.

Again, it might be reasonable to conclude that the agent has a foaf:interest in the document, and a general abstract "interest" in the "topic".

Can this pattern be extended into other types of document such as calendars? The RDF calendar effort is an attempt to mirror the icalendar specification in RDF. Potentially one could include a foaf:topic property for each calendar event and a maker for the calendar as a whole. The result would be something like:

A graph depicting a node labelled Agent, a node labelled Vcalendar, a node labelled Vevent, a node labelled Document and a node labelled with a question mark. The Agent node has an arrow pointing to the Vcalendar node labelled made. In return the Vcalendar node has an arrow pointing back to the Agent node labelled maker. The Vcalendar node also has an arrow pointing to the Vevent node labelled component. The Vevent node has an arrow pointing to the question mark node labelled topic. The question mark node has an arrow pointing to the Document node labelled page.

You can currently assign categories to events but these are text literals not URIs so they don't map cleanly to foaf:topic. A possible hack is to use URIs as category names and coerce the iCal/RDF converter to insert a foaf:topic property if the category looks like a URI. It is a hack though and there's precious little RDF calendar data out there as it is and virtually no tools to support it.

I think, in general, it is possible to use FOAF to assign topics to entities people have made or are responsible for. However, there are some holes in the FOAF interest model. How is one to declare an "interest" in a "topic". There is the foaf:topic_interest property but it's meaning os confusing. This area is made difficult because the foaf:interest property is squatting on a broad area of semantics and is making it hard to introduce new terms. The property has a restricted meaning but uses a very general English word for the property name. The FOAF spec defines this property as A page about a topic of interest to this person so it should really be called interestInWhateverThisPageIsAbout - or maybe something more succinct :).

My suggestion is to rename the foaf:topic_interest property to foaf:topicOfInterest with the definition: A topic that this person expresses an interest in.. Then, for completeness I'd also suggest the introduction of a foaf:Topic class. The domain of foaf:topicOfInterest and foaf:topic would be foaf:Topic. The range of foaf:topicOfInterest would be foaf:Agent. I'd also like to rename the foaf:interest property, but it's in widespread use so renaming might be hard. A pragmatic approach would be to deprecate it and introduce a less semanticly overloaded property.

Update: This is what I suggested in a message to the rdfweb-dev list:

My suggestion is to rename the foaf:topic_interest property to foaf:topicOfInterest or foaf:interestInTopic with the definition: A topic that this person expresses an interest in. Then, for completeness I'd also suggest the introduction of a foaf:Topic class. The domain of foaf:topicOfInterest and foaf:topic would be foaf:Topic. The range of foaf:topicOfInterest would be foaf:Agent.

A better name for foaf:interest is harder, in my posting I suggest rather tongue in cheek foaf:interestInWhateverThisPageIsAbout. Maybe pageAboutInterest or interestPage or, to parallel a suggestion above, interestInPageTopic (i.e. bob has interest in this page's topic).