Foafscape - a Browser for Friend of a Friend Documents

Mark Giereth (mark.giereth@iis.uni-stuttgart.de)

Machine-readable descriptions of people are an important aspect in "Semantic Web"1 applications because people link together different information resources such as projects, documents, organisations, products, etc. and know other people. By gathering and assembling those descriptions, large social networks between people augmented by virtual resources can be built. Friend of a friend (FOAF)2 is a vocabulary for describing such augmented social networks. Although FOAF is designed to be machine-readable, it can be useful to browse augmented social networks in the same way the WWW is browsed, e.g. in knowledge management applications. Existing FOAF applications mainly follow the approach of using XSLT3 to transform FOAF RDF/XML documents into XHTML or SVG (cf. FoaF Explorer4, FOAFnaut5), so that standard browsers and plug-ins can be used to display the data in a human-readable form.

Foafscape6 in contrast is a standalone browser for FOAF documents. It provides a compact graph-based visualization and integrates a local repository used for search and offline browsing. Design goals of Foafscape are:

  1. easy to use and install

  2. compact and intuitive graph-based visualization of FOAF documents

  3. hypertext like navigation between linked FOAF documents

  4. integration of a local repository for search and offline browsing

  5. usage of filters to show only relevant parts of the document

  6. easy creation and modification of FOAF documents

  7. inference technics to derive implicit knowledge

  8. plattform-independent implementation

At the moment Foafscape has an experimental character. This paper gives a short overview of Foafscape. It focuses on two aspects: (i) the visualization of FOAF documents and (ii) the integration of a local repository.

Visualization of FOAF documents

A standard way to visualize general RDF documents is to present them as graphs with an edge for each predicate and a node for each subject and object. Large graphs with many nodes and edges are the result of this approch and therefore it is often difficult to find relevant information. Foafscape instead combines several nodes into one structured node in order to produce a more compact view. If there is an image available (e.g. via 'foaf:img', 'foaf:depiction' or 'foaf:logo') the image is used to visualize the structured node. If no image is available then a meaningful icon is used instead.

Filters can be defined for properties and classes in which the user is interested in. This also reduces the number of nodes and edges. The complete (unfiltered) list of properties and their values of a resource is displayed in a separate window, when the resource is selected by the user. Figure 1 shows an example of how Foafscape visulalizes a FOAF document.

In order to navigate in a FOAF network, the 'rdfs:seeAlso' properties are interpreted as links to other documents. By double-clicking on these links the new document is downloaded, parsed and rendered - similar to normal WWW browsers.


Figure 1



Integration of a local repository

A local repository is used for (i) offline browsing, (ii) document search and (iii) retrieving ingoing references from other FOAF documents. The repository caches all browsed documents together with their images, so they can be viewed offline. It stores the documents in an JDBC database. Foafscape is deployed with the HSQLDB7 database - a lightweight Java based database engine which needs no separate installation. The documents are mainly stored in the a large 'triples' table which contains all subject-predicate-objects triples. The repository additionally stores images and metadata (such as parse errors, download-date, last-usage-date, etc.).

Foafscape integrates a FOAF Crawler for populating the repository with FOAF documents. We use the Google Web API8 to receive a list of initial FOAF document URLs. The following Google query, for example, gets a list of (possible) FOAF URLs restricted to the domain www.w3.org:

allinurl:foaf filetype:rdf site:www.w3.org

Starting with this initial URL list FOAF documents are downloaded, parsed and stored. This is done recursively by adding 'rdfs:seeAlso' references to the URL list.

At the moment the document search functionality is very basic. A set of triples can specified - each mapped to a SQL query on the 'triples' table. Currently it is asumed that all triples have the same subject. The prefix mapping is set in the preferences. Here is a short example:

(?X foaf:name "Mark Giereth") (?X rdf:type foaf:Person)

It is mapped to the SQL queries:

SELECT subj FROM triples t WHERE t.obj like '%Mark%' AND t.pred='http://xmlns.com/foaf/0.1/name'

SELECT subj FROM triples t WHERE t.obj='http://xmlns.com/foaf/0.1/Person'
AND t.pred='http://www.w3.org/1999/02/22-rdf-syntax-ns#type'

Then the query results are merged. For those subjects which are included in all results the document URL is returned. In the future it is planned to implement a more complete graph search on the repository.

Architecture overview

Foafscape is implemented as a standalone Java Swing application. It requires the Jena9 Semantic Web Framework for parsing and JDBC database for the repository, such as MySQL or the lightweight HSQLDB database engine. It can use GraphViz10 for layout which gives better results as the internal layout algorithms.

Figure 2 shows a typical szenario. (1) When the user types in an URL or double-clicks on a link, the content of the URL is downloaded via HTTP (online modus) or read from the repository (offline modus). (2) Then the content is parsed using a RDF parser. (3) If the document is not contained in the repository then it is stored. (4) The RDF model can be augmented by ingoing references from other repository documents. (5) The RDF model is filtered according to the filter definition and (6) layouted.


Figure 2




Future work

It is planned to:



Links

1 http://www.w3.org/2001/sw/

2 http://www.foaf-project.org/

3 http://www.w3.org/TR/xslt

4 http://xml.mfd-consult.dk/foaf/explorer/

5 http://www.foafnaut.org/

6 http://www.iis.uni-stuttgart.de/foafscape/

7 http://hsqldb.sourceforge.net/

8 http://www.google.com/apis/

9 http://jena.sourceforge.org

10 http://www.research.att.com/sw/tools/graphviz/