Quick Guide to Publishing a Thesaurus on the Semantic Web

W3C Working Draft 10 May 2005

This version:
Latest version:
Previous version:
(this is the First Public Working Draft)
Alistair Miles, CCLRC


This document describes in brief how to express the content and structure of a thesaurus, and metadata about a thesaurus, in RDF. Using RDF allows data to be linked to and/or merged with other RDF data by semantic web applications. The Semantic Web, which is based on the Resource Description Framework (RDF), provides a common framework that allows data to be shared and reused across application, enterprise, and community boundaries.

Status of this Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This document is a First Public Working Draft published by the Semantic Web Best Practices and Deployment Working Group, part of the W3C Semantic Web Activity. The Working Group intends the Quick Guide to Publishing a Thesaurus on the Semantic Web to become a W3C Working Group Note.

This Quick Guide accompanies the SKOS Core Vocabulary Specification and SKOS Core Guide.

We encourage public comments. Please send comments to public-esw-thes@w3.org [archive] and start the subject line of the message with "comment:".

Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.



The Semantic Web provides a common framework that allows data to be shared and reused across application, enterprise, and community boundaries [Semantic Web Activity]. It is based on the Resource Description Framework (RDF) [RDF], which provides a simple data formalism for talking about things, their properties, inter-relationships, and categories (classes). For an overview of RDF, see [RDF Concepts]

This document describes in brief how to express the content and structure of a thesaurus, and metadata about a thesaurus, in RDF. Using RDF allows your data to be linked to and/or merged with other RDF data by semantic web applications. In practice, this means that data sources can be distributed across the web in a decentralised way, but still be meaningfully composed and integrated by applications, often in novel and unanticipated ways.

The examples in this guide are given as a visualisation of the RDF graph, e.g.


Graph of an RDF triple

An RDF graph can be serialised (i.e. encoded as a series of characters) according to any of three currently defined RDF syntaxes: RDF/XML [RDF Syntax], N3/Turtle [Turtle][N3], N-Triple [N-Triple]. All examples in this guide use the RDF/XML syntax for consistency.

The examples in this document use the SKOS Core Vocabulary, which is a set of properties and classes that can be used to express the conceptual content of a thesaurus as an RDF graph. SKOS Core is designed to be used with not only thesauri, but also other types of 'concept scheme', such as classification schemes, subject heading systems, controlled vocabularies, glossaries, taxonomies etc. For a complete description of SKOS Core, see [SKOS Core Guide].

The examples in this document also use the DCMI Metadata Terms, which are properties and classes for describing resource metadata. For more about DCMI Terms, see [DCMI Terms].

Note that the prefix skos: in this document stands for http://www.w3.org/2004/02/skos/core# - so for example skos:prefLabel is an abbreviation of http://www.w3.org/2004/02/skos/core#prefLabel.

Expressing a Thesaurus in RDF

Below is an extract from the UK Archival Thesaurus (UKAT) [UKAT]:

Term: Economic cooperation

Used For:
    Economic co-operation

Broader terms:
    Economic policy

Narrower terms:
    Economic integration
    European economic cooperation
    European industrial cooperation
    Industrial cooperation

Related terms:

Scope Note:
Includes cooperative measures in banking, trade, industry etc., between and among countries.

This example, expressed as an RDF graph using the SKOS Core Vocabulary, looks like:

Graph of extract from UKAT

Each of the blue circles in the image above represents a concept from the UKAT. The red circle represents the UKAT itself.

Each concept from the UKAT has an allocated URI. URIs are globally unique identifiers that may be used to refer to a resource unambiguously from any context. Anything can be a 'resource', not just web documents, therefore URIs can be used as identifiers for anything. For example, the URI:


... denotes the concept from the UKAT whose preferred term is 'Economic cooperation'. (The URIs are not shown in the visualisation of the graph above for the sake of readability.)

Allocating URIs to the concepts in a thesaurus allows anybody to refer to them unambiguously from any context.

For a complete description of considerations relevant to allocating URIs, see [WEBARCH]. See also the section 'HTTP URIs for Concepts' in [SKOS Core Guide].

An RDF/XML serialisation of the RDF description of the 'Economic cooperation' concept from the UKAT is below:


    <skos:Concept rdf:about="http://www.ukat.org.uk/thesaurus/term.php?t=1750">
        <skos:prefLabel>Economic cooperation</skos:prefLabel>
        <skos:altLabel>Economic co-operation</skos:altLabel>
        <skos:scopeNote>Includes cooperative measures in banking, trade, industry etc.,
          between and among countries.</skos:scopeNote>
        <skos:broader rdf:resource="http://www.ukat.org.uk/thesaurus/term.php?t=4382"/>
        <skos:narrower rdf:resource="http://www.ukat.org.uk/thesaurus/term.php?t=2108"/>
        <skos:narrower rdf:resource="http://www.ukat.org.uk/thesaurus/term.php?t=9505"/>
        <skos:narrower rdf:resource="http://www.ukat.org.uk/thesaurus/term.php?t=15053"/>
        <skos:narrower rdf:resource="http://www.ukat.org.uk/thesaurus/term.php?t=18987"/>
        <skos:related rdf:resource="http://www.ukat.org.uk/thesaurus/term.php?t=3250"/>
        <skos:inScheme rdf:resource="http://www.ukat.org.uk/thesaurus"/>


Note that, in expressing the content of a thesaurus such as the UKAT in RDF using SKOS Core, each descriptor (preferred term) becomes a preferred label for a concept, and each non-descriptor (non-preferred term) becomes an alternative label for a concept.

Note also the skos:inScheme property - this property may be used to assert a link between a concept and the concept scheme(s) in which it participates. SKOS Core places no restriction on the number of schemes in which a concept may participate.

Creating and Maintaining an RDF Representation of a Thesaurus

Most thesauri are managed via a thesaurus management system. Where the thesaurus management system stores its data in a relational database, or in an XML or structured text file format, or where the standard output of the thesaurus management system is an XML or structured text format, it is usually possible to create an RDF representation of the thesaurus via an automated procedure (e.g. database report, text parsing program, XSLT transformation).

A full discussion of conversion techniques and best practice is beyond the scope of this document. However, note that when using an automated procedure, care must be taken to ensure that the output generated is sensible and conforms to the recommended usage of the SKOS Core Vocabulary. For example, if an XML format contains an XML element whose name is 'scopenote' it should not be automatically assumed that the textual content of these elements should be converted to the value of a skos:scopeNote property. Perhaps these 'scopenote' elements actually contain definitions, in which case the skos:definition property should be used; or perhaps the 'scopenote' elements have been used very loosely and contain all kinds of note types, in which case the more general skos:publicNote property would be more appropriate.

Also note that maintaining an RDF representation of a thesaurus requires clear policies for versioning and change management. For example, users need to know if the meaning associated with a URI is stable, and if it isn't they need to know how and when it may change. A fuller discussion of management best practice is currently being undertaken by the Vocabulary Management Task Force of the Semantic Web Best Practices and Deployment Working Group.

Expressing Thesaurus Metadata in RDF

RDF can also be used to express metaproperties of a thesaurus, such as it's title, description, date of modification and so on. The DCMI Metadata Terms [DCMI Terms] include a number of useful properties for this purpose. For example, below is an RDF/XML serialisation of the UKAT metadata:


    <skos:ConceptScheme rdf:about="http://www.ukat.org.uk/thesaurus">
        <dc:title>The UK Archival Thesaurus</dc:title>
        <dc:description>A subject thesaurus produced to support indexing in the UK 
          archive sector.</dc:description>
        <dc:creator>UK Archival Thesaurus project</dc:creator>
        <dc:rights>All rights reserved. Data in the UK Archival Thesaurus may be freely
          used and copied, without prior permission, for educational and other non-commercial
          purposes. These purposes include (but are not limited to) the incorporation of UKAT
          data into indexes, thesauri and finding aids created by organisations and projects
          in the archive sector and the wider heritage sector, in the UK and elsewhere. Under
          no circumstances may copies of UKAT data be sold without prior written permission
          from the UKAT Project (support@ukat.org.uk).</dc:rights>
        <skos:hasTopConcept rdf:resource="http://www.ukat.org.uk/thesaurus/hierarchy.php?f=1"/>         
        <skos:hasTopConcept rdf:resource="http://www.ukat.org.uk/thesaurus/hierarchy.php?f=2"/>         
        <skos:hasTopConcept rdf:resource="http://www.ukat.org.uk/thesaurus/hierarchy.php?f=3"/>         
        <skos:hasTopConcept rdf:resource="http://www.ukat.org.uk/thesaurus/hierarchy.php?f=4"/>         
        <skos:hasTopConcept rdf:resource="http://www.ukat.org.uk/thesaurus/hierarchy.php?f=5"/>         
        <skos:hasTopConcept rdf:resource="http://www.ukat.org.uk/thesaurus/hierarchy.php?f=6"/>         
        <skos:hasTopConcept rdf:resource="http://www.ukat.org.uk/thesaurus/hierarchy.php?f=8"/>         


See [DCMI Terms] for a description of the recommended usage of these properties.

To make statements about a thesaurus in RDF, the thesaurus must have an allocated URI. For example, the URI:


... denotes the UKAT itself.

Note that SKOS Core models a thesaurus as a 'concept scheme'. For more about this, see the section 'Concept Schemes' in [SKOS Core Guide].

Note also that, in the example above, a link has been asserted between the UKAT thesaurus and the top concepts in the UKAT thesaurus (in the UKAT they are known as 'fields') using the skos:hasTopConcept property. Using this property is recommended, as it gives applications an efficient way of locating the top concepts for a given scheme.

Publishing RDF Data

The simplest way to publish RDF data is to create one or more RDF documents containing your data, and publish them on the web via a normal HTTP server.

Note that, although the examples above all use the RDF/XML serialisation syntax (i.e. file format), there are two other alternative syntaxes for RDF: N3/Turtle [N3][Turtle] and N-Triples [N-Triples]. For documents containg RDF data in the RDF/XML format, the 'content-type' field in the HTTP header for that document should be 'application/rdf+xml'.

You can also publish your RDF data on the web via a dedicated RDF server such as Joseki [Joseki] or Sesame [Sesame]. Publishing via an RDF server allows anyone to query the thesaurus over the web via an RDF query language such as SPARQL [SPARQL].

Current practice dictates that if you use HTTP URIs as identifiers for your thesaurus and its concepts, then those URIs should dereference to an RDF description of the thing they identify.

Further Reading


[DCMI Terms]
DCMI Metadata Terms. Dublin Core Metadata Initiative, 2004. (See http://dublincore.org/documents/dcmi-terms/)
Joseki Jena RDF Server. Sourceforge. (See http://www.joseki.org/)
Tim Berners-Lee. Primer: Getting into RDF & Semantic Web using N3. World Wide Web Consortium, 2004. (See http://www.w3.org/2000/10/swap/Primer)
Jan Grant, Dave Beckett, editors. RDF Test Cases (Section 3. N-Triples). World Wide Web Consortium, 2004. (See http://www.w3.org/TR/rdf-testcases/#ntriples)
Resource Description Framework (RDF). (See http://www.w3.org/RDF/)
[RDF Concepts]
Graham Klyne, Jeremy Carroll, editors.Resource Description Framework (RDF): Concepts and Abstract Syntax. World Wide Web Consortium, 2004. (See http://www.w3.org/TR/rdf-concepts/)
[RDF Syntax]
Dave Beckett, editor. RDF/XML Syntax Specification (Revised). World Wide Web Consortium, 2004. (See http://www.w3.org/TR/rdf-syntax-grammar/)
[Semantic Web Activity]
Semantic Web Activity Statement. World Wide Web Consortium, 2001. (See http://www.w3.org/2001/sw/Activity)
Sesame RDF Database. (See http://www.openrdf.org/)
[SKOS Core Guide]
Alistair Miles, Dan Brickley, editors. SKOS Core Guide. World Wide Web Consortium, 2004. (See http://www.w3.org/2004/02/skos/core/guide/)
Eric Prud'hommeaux, Andy Seaborne, editors. SPARQL Query Language for RDF. World Wide Web Consortium, 2004. (See http://www.w3.org/TR/rdf-sparql-query/)
Dave Beckett. Turtle - Terse RDF Triple Language. ILRT, University of Bristol, 2004. (See http://www.ilrt.bris.ac.uk/discovery/2004/01/turtle/)
The UK Archival Thesaurus. See (http://www.ukat.org.uk/)
Ian Jacobs, Norman Walsh, editors. Architecture of the World Wide Web, Volume One. World Wide Web Consortium, 2004. (See http://www.w3.org/TR/webarch/)