Abstract
RSS 1.0 (RDF Site Summary) is a well-known XML format commonly used for syndicating news headlines. By design it is an extensible format in which metadata expressed using any RDF vocabulary can be linked to its component items, while still maintaining compatibility with applications such as newsreaders that may be unaware of such vocabularies. This paper will discuss some interesting applications that can be built with RSS as a base. The annotation of collections of photographs is used as a case study.
Using an RDF representation of Wordnet, the lexical database of English, we attach keywords to photographs to indicate what they objects they depict. With simple inference logic, we create improved search engines over this data. We can automatically build a Yahoo-like hierarchical web site of photographs organised by the meaning of their keywords. Using the Friend Of A Friend (FOAF) vocabulary, we can record which photographs show particular people. Applications can then display related information with the photograph by using information gathered by spidering the existing network of FOAF information on the web.
RDF's natural integration with the web's URI system makes it easy to build applications in a loosely-coupled style. Tools for this project built using Perl and Java easily interoperate, using the RDF output of one as the input of another. New applications can be built by others using any language or environment with RDF and HTTP support (even Mozilla), without needing to be granted any special database access or other privileges.
Keywords
Table of Contents
My site (http://www.picdiary.com) is a weblog of collections of pictures. There's not much text, the pictures are the main focus and just have a few lines of description. For a while it had been lacking good search facilities, and was built out of static HTML. The pictures didn't have any associated metadata apart from a caption and a directory structure that grouped them into collections. Scraping the captions and URLs out of the static HTML gave me some basic XML files that described the pictures.
I decided to use RDF Site Summary (RSS) as the 'container' format to describe each picture collection and its metadata. RSS works just as well for summarising lists of pictures as it does for lists of web pages - they're all just URLs. Things become a lot more interesting when you start attaching metadata to the pictures - it becomes possible to construct useful web applications that use the explicit linking between photos that share a common location, subject or time, and even to create implicit links by exploiting ontological relationships between words in the English language or known links in social networks.
RSS is designed to summarise the contents of a website for consumption by a newsreader (or RSS aggregator). In the abstract, it a container format for lists of associated items. These lists are known as channels.
In its 1.0 incarnation it is formulated using the Resource Description Framework (RDF) and may be consumed either as a naive XML format or interpreted as a labelled graph model. The basic graph structure of the RSS model looks like this:
A channel has a basic set of properties (link, title, description) and is associated with an RDF Sequence of items. Each item itself has a link, title and optional description. These are all modelled as text literals, partly for backwards compatibility with earlier RSS formats.
RSS 1.0 turns out to be an ideal format for collating information about groups of photographs. A set of photos around a particular topic, event or time fit nicely into the concept of channel and items, each with title, description and link. Once formulated in RSS, they may be easily templated into different formats.
As usual with RDF, a model can be extended using arbitrary vocabulary differentiated using XML namespaces. In RSS 1.0 terminology, these namespaces are called 'modules'. There are a number of standardised modules for common vocabularies such as Dublin Core and for common uses of RSS such as search results and additional content formats beyond plain text.
The simplicity of the RSS model means that the only available URIs for use as subjects of new statements are the channel and the items. There are all sorts of useful statements that can be attached to photos - a thumbnail image, descriptions of who and what the photo depicts, information about the time and method of photography, etc. One set of such statements looks like this:
Here we have taken a photo that has an RSS title and link, and added some depiction and thumbnail information. The photo depicts both things and people, so we use URIs representing nouns from the Wordnet ontology to describe the things, and contact and name information labeled using the FOAF namespace to identify the people.
One of the most useful features of RDF is its clearly defined aggregation operation. Two RDF models may be merged to create a new model that contains all the statements of the original models, and the resulting model is itself a valid RDF model. This enables the gathering of 'facts' from a (semantic) web of documents into an aggregate model.
Having annotated many collections of photos using RSS 1.0 with additional RDF statements, we can start to build useful applications by simply aggregating all the models into a single model then applying query and inference techniques to the result.
Parsers for RDF/XML are available for many languages. When building applications to search and display picture annotations, I used a mixture of perl and Java, passing dynamically-generated RDF between them using simple HTTP GET operations in the Representational State Transfer (REST) style. Being a list-oriented format, RSS also works well for containing query results, and has the additional advantage that any RSS-capable client can display the results. In this way, one can choose to ignore any HTML web presentation and simply subscribe to the results of a query using an RSS reader.
Friend Of A Friend (FOAF) is a very useful project created by participants in the rdfweb ("semantic web vapourware for the masses") project. It is an experiment in mapping of social networks and has vocabulary for describing simple relationships between and properties of people, organisations, projects and documents. A common use of it is for an individual to create a "FOAF file" at an advertised URL which contains a description of themselves and pointers to the people they know, often with a GPG signature to provide some authenticity. An RDF spider (often known as a "scutter") can gather up FOAF files and "smush" them together into a single model that unifies the individual pieces of information into a network. Applications such as Foafnaut give compelling visualisations of the information that are at least as good as those provided by centralised commercial endeavours such as Friendster and Friendsreunited.
In the more simple domain of photo annotation, FOAF is very useful as a source of vocabulary that also allows the photos to participate in the aggregated social network models described above. FOAF lets us say that a picture depicts a particular person, and that another URI is the thumbnail of a photo.
With this information, we can add useful additional links to a web presentation of a photo collection such as "see more pictures of Jo Walsh". A simple index RDF file can be built that uses the rdfs:seeAlso predicate to guide scutters into the disparate RSS channels so that the FOAF depictions they specify can be used by any FOAF tool.
As systems for consuming RDF become more sophisticated, the process of inference - deriving new statements from an existing model by the application of a set of rules - is becoming more and more commonly used. For example, the rule:
"PERSON <foaf:depiction> PIC" implies "PIC <foaf:depicts> PERSON"
can be applied to the triple:
Matt Biddulph <foaf:depiction> [jpeg URL] .
to produce the augmented model:
Matt Biddulph <foaf:depiction> [jpeg URL] .
[jpeg URL] <foaf:depicts> Matt Biddulph .
Ontologies may be specified using a language such as OWL that describe a vocabulary of classes and predicates, and the relationships between triples using those classes and predicates.
Wordnet, the "lexical database of English", is a freely-reusable information base that gives descriptions and semantic links between a large set of words of the English language. The project also provides a set of tools for a variety of languages that allow the programmer to query the database. Dan Brickley formulated an RDF ontology from the nouns in this database, giving URIs such as http://xmlns.com/wordnet/1.6/Dog . Using the hyponym/hypernym (suborbinate/superordinate word) relationships from the database, we can infer from RDF statements such as:
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Dog> .
the fact that a Dog is also a Mammal:
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Mammal> .
Armed with this capability, we can build a very useful augmented search engine that displays some understanding of the semantic scope of its search terms. Taking a set of statements whose objects are Wordnet URIs, we can pre-computed an augmented inference model where each statement is duplicated into each of its ancestor hypernyms. The full set of expansions of the statement [jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Dog> is:
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Canine> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Canid> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Carnivore> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Placental> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Placental_mammal> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Eutherian> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Eutherian_mammal> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Mammal> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Vertebrate> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Craniate> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Chordate> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Animal> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Animate_being> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Beast> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Brute> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Creature> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Fauna> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Organism> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Being> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Living_thing> .
[jpeg URL] <foaf:depicts> <http://xmlns.com/wordnet/1.6/Entity> .
Using this augmented model, any search for "being", "carnivore" or "mammal" will find the picture of the dog. Searches for "building" will find hotels, churches, houses and other related photographs.
This is a somewhat brute-force approach to the building of inference models. Version 2 of Jena will have support for automatically built, lazily-evaluated inference models based on RDF Schema and OWL. These models will behave just as regular non-inference-based models when used with Jena features such as the RDQL query system.
Using similar techniques, we can build a web-navigable hierarchy of photographs in the style of DMOZ or the Yahoo directory. Given a Wordnet URI, we can query for all depictions of that term, then ask the Wordnet database for the immediate hypernyms and hyponyms of that term. We then query for a count of depictions of each of those terms, then build an RSS channel that lists depictions and has pointers to the hypernym and hyponym terms:
The graph structure of RDF is ideal for attaching both simple and complicated, interlinked metadata to resources such as photographs made available on the web. There are a variety of tools available for many languages that allow one to parse, query and produce RDF. RDF sits well with the existing structures and conventions of the World Wide Web, forming a Semantic Web of machine-interpretable information that can be used to build interesting applications. The distributed nature of the Semantic Web allows for easy sharing of this information and for serendipitous discovery and reuse in an open and unplanned way.
When building the code described in this paper, two RDF toolkits came in very useful. For Java, I used Jena (http://www.hpl.hp.com/semweb/jena.htm), a product of HP Labs in Bristol. It includes an RDF parser with a very simple interface called ARP that can be used independently of the rest of the toolkit. It has a SAX-like callback style which passes triples into assertion handlers supplied by the user. Jena also includes an API for navigating RDF graphs, a serialiser that can create N-TRIPLE, N3 and RDF/XML output, a number of storage mechanisms for persisting RDF models in BerkeleyDB and RDBMS backends, support for DAML and RDF Schema ontology features, and a query language that draws ideas from SQL and logic programming to answer declarative queries.
In my perl code, I used the perl wrappers for Dave Beckett's Redland library (http://www.redland.opensource.ac.uk/). It has similar features to Jena apart from (in the current release, 0.12) lacking a query language. It has bindings for many other languages and is the fastest and most memory-efficient library I know of.
Also available from the perl CPAN library is the RDF::Core package. Its parser, serialiser, storage and query language are implemented in pure perl, which makes it more suitable for use in certain restricted hosting environments.
Libby Miller has an excellent demo http://swordfish.rdfweb.org/discovery/2001/08/codepict/ that uses FOAF photo annotations to plot "co-depiction paths" between any two people who are depicted in the FOAF network. A co-depiction path is a series of photos that link two people by co-depiction in the same way that Six Degrees Of Kevin Bacon links two actors by giving a series of films that link them by co-star. Dan Brickley gives an example: "eg i have a picture that depicts libby and me; one with me and chaals; another with chaaals and eric". This forms a path from Libby to Eric.
![]() ![]() |
Design & Development by deepX Ltd. |