What is SKOS and How to Serialize in RDF/XML
This article provides an overview of the Simple Knowledge Organization System (SKOS), a standard model for expressing classification systems, taxonomies, and thesauri on the Semantic Web. It explains the foundational elements of SKOS, including concepts, schemes, and semantic relations, followed by a direct demonstration of how to represent and serialize this data using the RDF/XML format.
Understanding SKOS
The Simple Knowledge Organization System (SKOS) is a W3C standard based on the Resource Description Framework (RDF). It bridges the gap between informal, human-readable organization structures and formal, logically rigorous ontologies (such as OWL). SKOS is widely used to publish controlled vocabularies, subject heading lists, and thesauri in a machine-readable format.
The primary building blocks of SKOS include:
- Concepts (
skos:Concept): The core units of thought or meaning within a vocabulary (e.g., “Mammal”, “Economic Policy”). - Concept Schemes (
skos:ConceptScheme): The aggregation of concepts representing an entire vocabulary, thesaurus, or taxonomy. - Lexical Labels: Human-readable terms assigned to
concepts, categorized into preferred labels
(
skos:prefLabel), alternative labels/synonyms (skos:altLabel), and hidden labels for search optimization (skos:hiddenLabel). - Semantic Relations: Links establishing
relationships between concepts:
skos:broaderandskos:narrowerfor hierarchical relationships.skos:relatedfor associative, non-hierarchical links.
- Documentation Properties: Properties for
definitions and context, such as
skos:definition,skos:scopeNote, andskos:example.
Serializing SKOS in RDF/XML
RDF/XML is an XML-based syntax used to encode RDF graphs. When
serializing SKOS to RDF/XML, you declare the RDF and SKOS XML
namespaces, define a skos:ConceptScheme, and define each
skos:Concept with their respective labels and semantic
links.
Example RDF/XML Serialization
The following example defines a taxonomy about animals, demonstrating a concept scheme, preferred and alternative labels, and hierarchical relationships.
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#">
<!-- Concept Scheme Definition -->
<skos:ConceptScheme rdf:about="http://example.org/vocab/animals">
<skos:prefLabel xml:lang="en">Animal Taxonomy</skos:prefLabel>
<skos:definition xml:lang="en">A basic vocabulary classifying animal species.</skos:definition>
<skos:hasTopConcept rdf:resource="http://example.org/vocab/animals/mammals"/>
</skos:ConceptScheme>
<!-- Top Concept: Mammals -->
<skos:Concept rdf:about="http://example.org/vocab/animals/mammals">
<skos:inScheme rdf:resource="http://example.org/vocab/animals"/>
<skos:topConceptOf rdf:resource="http://example.org/vocab/animals"/>
<skos:prefLabel xml:lang="en">Mammal</skos:prefLabel>
<skos:altLabel xml:lang="en">Mammalia</skos:altLabel>
<skos:narrower rdf:resource="http://example.org/vocab/animals/canines"/>
</skos:Concept>
<!-- Narrower Concept: Canines -->
<skos:Concept rdf:about="http://example.org/vocab/animals/canines">
<skos:inScheme rdf:resource="http://example.org/vocab/animals"/>
<skos:prefLabel xml:lang="en">Canine</skos:prefLabel>
<skos:altLabel xml:lang="en">Dog family</skos:altLabel>
<skos:broader rdf:resource="http://example.org/vocab/animals/mammals"/>
<skos:definition xml:lang="en">A carnivorous mammal of the family Canidae.</skos:definition>
</skos:Concept>
</rdf:RDF>Breakdown of the Code Structure
- Namespaces: The root
<rdf:RDF>element declaresrdf:andskos:namespaces, allowing parsers to validate and resolve the vocabulary terms. - URIs: The
rdf:aboutattribute gives each resource (the scheme and the individual concepts) a unique Uniform Resource Identifier (URI). - Scheme Membership:
skos:inSchemepoints each concept back to its parent scheme, whileskos:topConceptOfidentifies top-level entries in the hierarchy. - Bilateral Hierarchies: The relationship between
“Mammals” and “Canines” is explicitly stated using
skos:narroweron the parent concept andskos:broaderon the child concept.