Knowledge Graph Academy · Modules 3 to 5 · SKOS and the ontology

Two Jobs for SKOS

SKOS labels and notes document your classes. SKOS concepts stand beside your classes as controlled values. The two jobs never mix, and the music graph shows both.

read five sections, then twelve questionsscore 0/12
1 · Two kinds of property

SKOS has two kinds of property, and only one of them may touch a class

The SKOS vocabulary splits into properties that describe a resource in words and properties that place a concept among other concepts. The W3C SKOS Reference (2009) declares the first kind as OWL annotation properties: skos:prefLabel, skos:altLabel and skos:hiddenLabel (condition S10), and skos:note with its six sub-properties skos:definition, skos:scopeNote, skos:example, skos:historyNote, skos:editorialNote and skos:changeNote (S16). None of them has a domain. An annotation property attaches to any resource and changes nothing a reasoner concludes about it.

The second kind is for concepts only. skos:broader, skos:narrower and skos:related are sub-properties of skos:semanticRelation, whose domain and range are skos:Concept (S19, S20). The mapping properties skos:exactMatch, skos:closeMatch, skos:broadMatch, skos:narrowMatch and skos:relatedMatch sit under the same super-property (S38). Write one of these with a class as subject or object, and you have said that the class is a concept.

GroupPropertiesIn OWL termsMay attach to
labelsskos:prefLabel, skos:altLabel, skos:hiddenLabelannotation properties, sub-properties of rdfs:labelanything: a concept, a class, a property, the ontology itself
notesskos:definition, skos:scopeNote, skos:example, skos:historyNote, skos:editorialNote, skos:changeNoteannotation properties, sub-properties of skos:noteanything
concept relationsskos:broader, skos:narrower, skos:related, the five …Match propertiesobject properties with domain and range skos:Conceptconcepts only
scheme membershipskos:inScheme, skos:topConceptOf, skos:hasTopConceptobject properties that tie a concept to a skos:ConceptSchemeconcepts and their schemes; an ontology is not a concept scheme

That split gives SKOS its two jobs in an ontology project. The annotation properties document the TBox, class by class and property by property. The concept properties build the CBox, a taxonomy whose concepts the ABox picks as values. Sections 2 and 3 show each job in Turtle; Section 4 says what to do when one word wants both jobs.

2 · Annotations on classes

SKOS labels and notes document a class better than rdfs:label alone

An OWL class usually comes with one rdfs:label and one rdfs:comment. SKOS adds the vocabulary of a working glossary: the words people also use, the words to catch in search, a definition that stands alone, a scope note that draws the boundary, an example, and a dated record of changes. All of them attach to the class as annotations, so the class means the same thing to a reasoner before and after.

# the Venue class from the Module 5 music graph, documented with SKOS
ex:venue a owl:Class ;
    rdfs:label        "Venue"@en ;
    skos:prefLabel    "Venue"@en ;
    skos:altLabel     "Performance space"@en, "Hall"@en ;
    skos:hiddenLabel  "Venu"@en ;
    skos:definition   "A place where events take place."@en ;
    skos:scopeNote    "Use for the building or site itself. The city it stands in is a value of located in, picked from the Places taxonomy."@en ;
    skos:example      "Wigmore Hall; The O2 Arena."@en ;
    skos:historyNote  "Added in version 0.5 when events gained a location."@en ;
    skos:editorialNote "Check whether festival grounds need their own class."@en .

# a property documented the same way
ex:performs-at a owl:ObjectProperty ;
    rdfs:label      "performs at"@en ;
    rdfs:domain     ex:person ;
    rdfs:range      ex:event ;
    skos:definition "Links a person to an event they appear in."@en ;
    skos:scopeNote  "One statement per appearance. A person who plays two nights has two events."@en .

Three rules carry over from the taxonomy

One preferred label per language. Condition S14 applies to any resource, so a class gets one skos:prefLabel in English, one in Finnish, and so on. Keep it the same string as rdfs:label: Protégé and most other tools read rdfs:label to show a name, and skos:prefLabel is a sub-property of it (S11), so the two agree after inference and should agree before it.

Definition and scope note do different work. The definition says what the class means and stands on its own. The scope note says how to apply it: what is in, what is out, and which neighbour to use at the edge. For a class, the edge is usually another class or a taxonomy, and the scope note is where you write "the city is a value of located in".

Every label and note gets a language tag. An untagged literal escapes the one-per-language rule and cannot be picked up by a language-aware tool.

What a reasoner does with theseNothing. Annotation properties have no logical consequences in OWL. A scope note on ex:venue does not restrict what can be a venue; a definition does not make the class equivalent to anything. That is the reason they are safe to add in quantity, and the reason they can never replace a domain, a range or a subclass axiom.

What the annotation job never includes

No skos:broader between classes: the class hierarchy is rdfs:subClassOf, and a reasoner propagates types through it. No skos:inScheme on a class: a class belongs to an ontology, a concept belongs to a scheme. No rdf:type skos:Concept on a class: one IRI with two readings confuses every tool and every reader. The labels and notes go on; the concept relations stay off.

3 · Concepts beside classes

SKOS concepts stand beside the classes as controlled values, picked through a property

A class answers "what kind of thing is this?", and the answer is written with rdf:type. A concept answers "which term from the list applies?", and the answer is written as the value of a property whose range is skos:Concept. Paul McCartney is a Person; his occupation is the concept Musician, picked from the Occupations taxonomy.

# TBox: the property that draws its values from a taxonomy
ex:has-occupation a owl:ObjectProperty ;
    rdfs:label   "has occupation"@en ;
    rdfs:domain  ex:person ;
    rdfs:range   skos:Concept ;
    rdfs:comment "A controlled value from the Occupations taxonomy."@en .

# CBox: the taxonomy, SKOS and nothing else
ex:occupations a skos:ConceptScheme ; skos:prefLabel "Occupations"@en ; skos:hasTopConcept ex:musician .
ex:musician  a skos:Concept ; skos:prefLabel "Musician"@en ; skos:topConceptOf ex:occupations .
ex:composer  a skos:Concept ; skos:prefLabel "Composer"@en ; skos:broader ex:musician ; skos:inScheme ex:occupations .

# ABox: typed with the class, tagged with the concept
ex:paul-mccartney a ex:person ;
    rdfs:label        "Paul McCartney"@en ;
    ex:has-occupation ex:musician .

class rdf:type

Has instances with their own properties and identity. A hierarchy of rdfs:subClassOf, and a reasoner propagates types along it: every Venue is a Place if Venue is a subclass of Place.

concept a property value

Has labels, synonyms, definitions and a place in a scheme. A hierarchy of skos:broader, which a reasoner leaves alone: tagging Paul with Composer says nothing about Musician until a query climbs the hierarchy.

The hierarchy answers questions through a property path

"Which venues are in the United Kingdom?" has no instance tagged United Kingdom. The O2 Arena is located in London, and London is narrower than United Kingdom in the Places taxonomy. The query climbs skos:broader as far as it needs to:

SELECT ?venue WHERE {
  ?venue rdf:type ex:venue ;
         ex:located-in/skos:broader* ex:united-kingdom .
}

The star means zero or more steps, so a venue tagged United Kingdom directly also answers. The same shape with rdf:type/rdfs:subClassOf* climbs the class hierarchy. Classes and concepts each have a hierarchy; they are climbed by different properties, and the question decides which one you need.

Three ways to say which taxonomy a property draws from

The range skos:Concept admits any concept from any scheme. A comment on the property, as above, tells a person which taxonomy to pick from, and the ABox Workbench shows that comment next to the picker. When the range must be tighter, declare a class of concepts for the scheme, ex:occupation-concept rdfs:subClassOf skos:Concept, type every concept in the scheme with it, and use it as the range. That class lives in the TBox only to say "a value from this scheme"; it is still a kind of concept, and it is never a class of real things. The third way, an OWL restriction on skos:inScheme, does the same with more syntax and is left for later.

For tagging anything with any concept, dcterms:subject already exists and needs no declaration of your own.

4 · One word, two layers

When the same word wants to be a class and a concept, the questions decide

The music graph has a class Venue and could have a Places taxonomy with a concept Venues; it has a concept String instruments and could have a class String instrument. A word earns a class when a question needs instances of it with their own properties: a specific bass guitar with a serial number, an owner and a purchase date. A word earns a concept when a question needs it as a term to pick, with synonyms, a definition and a place among other terms. One word rarely needs both. Keep the one the questions use, and the ABox Workbench flags a concept that shares its name with a class so the choice is made on purpose.

When both are needed, the shared word is allowed. A query matches IRIs, never labels, and nothing in RDF, OWL or SKOS stops a class and a concept from sharing a name as long as their IRIs differ. The question is how a reader will tell them apart: a namespace per layer (ont:Venue, kind:venue), an IRI convention inside one namespace (ex:Venue, ex:venue), or two labels. Instruments in Three Layers, Section 7 lays out the options and the clash that one shared IRI causes.

Links that keep the layers apart, and links that merge them

StatementVerdictWhy
ex:venue rdfs:seeAlso ex:venuesfinerdfs:seeAlso is an annotation. It points a reader from the class to the related concept and changes nothing for a reasoner.
ex:venue owl:sameAs ex:venuesavoidowl:sameAs is for individuals. A class on one side leaves OWL DL and tells tools the class and the concept are one resource.
ex:venue skos:exactMatch ex:venuesavoidA mapping property between concepts. It makes the class a concept, and skos:exactMatch is transitive, so the equivalence spreads.
ex:o2-arena rdf:type ex:venuesavoidrdf:type needs a class as its object. A concept there becomes a class as well as a concept.
ex:venues rdfs:subClassOf ex:venueavoidA concept is an individual; it has no subclass relation to anything.
ex:venue skos:broader ex:placeavoidDomain and range skos:Concept make both classes concepts. The class hierarchy is rdfs:subClassOf.
Punning, for laterOWL 2 allows one IRI to be a class and an individual at the same time; the two readings never interact in a reasoner. Published vocabularies use it with care, and tools display it in confusing ways. In this course, one IRI is one thing: a class or a concept.
5 · The checks

Six checks keep the two layers apart in any file

CheckWhat to look for
1. Concept relations stay on conceptsEvery subject and object of skos:broader, skos:narrower, skos:related and the …Match properties is typed skos:Concept and nothing else.
2. Classes are typed onceNo IRI is both owl:Class and skos:Concept. No class has skos:inScheme.
3. rdf:type points at classesEvery object of rdf:type in the ABox is declared owl:Class (or is skos:Concept itself, for the taxonomy). No instance is typed with a concept.
4. Controlled values go through a propertyEvery property that takes a concept has rdfs:range skos:Concept or a declared subclass of it. A concept as the value of a property with a class range is a mismatch, and the workbench says so.
5. One preferred label per languageOn concepts and on annotated classes alike. Synonyms are skos:altLabel.
6. Links between layers are annotationsA class that corresponds to a concept says so with rdfs:seeAlso or a documented annotation property of your own, never with owl:sameAs, skos:exactMatch or rdf:type.

The ABox Workbench applies checks 2, 3 and 4 to a loaded file and names each finding in plain words. The SKOS in One Sitting tutorial covers check 5 and the rest of the taxonomy side.

6 · Knowledge check

Twelve questions, one point each

Pick an answer and the explanation appears, with a link back to the section that teaches it. The matching questions award the point only when every row is right.

score 0/12