ExtendingSkosCore

From W3C Wiki
Jump to: navigation, search

Extending SKOS Core

This is a wiki draft of a proposed note to describe how to 'extend' SKOS Core.

Abstract

@@TODO

RDF and RDFS in a Nutshell

In this document, the following prefixes are used to abbreviate URIs:


@prefix skos: <http://www.w3.org/2004/02/skos/core#>.
@prefix rdf: <@@TODO> .
@prefix rdfs: <@@TODO> .
@prefix foaf: <@@TODO> .
@prefix dc: <@@TODO> .
@prefix dct: <@@TODO> .


@@TODO

How to Declare RDF Properties and RDFS Classes

The SKOS Core Vocabulary consists of some RDF properties and some RDFS classes. For example, skos:Concept is an RDFS class, and skos:prefSymbol is an RDF property. To extend SKOS Core in either of the two ways described below, you will need to know how to declare your own RDF Properties and RDFS Classes.

The procedure for declaring an RDF Property or an RDFS Class is exactly the same as the procedure for declaring a SKOS Concept:

  1. First you allocate a URI to the property/class you wish to declare.
  2. Second, you create some RDF statements that describe the property/class. This is also known as creating an RDF description of the property/class.
  3. Third, you serialise the RDF description of your property/class using one of the RDF syntaxes, either RDF/XML, Notation 3, N-Triples or RDF/A. You should make sure your serialisation is well-formed according to the rules of the syntax used.
  4. Finally, you publish the RDF description on the web.

Declaring an RDF Property

So, for example, let's look at the skos:prefSymbol property.

The URI http://www.w3.org/2004/02/skos/core#prefSymbol has been allocated by the W3C (as owners of the URI) as the identifier for this property. The notation skos:prefSymbol is a shorthand for this URI, where the prefix skos: stands for http://www.w3.org/2004/02/skos/core#.

The skos:prefSymbol property is described by the following RDF statements, presented below as a visualisation of the RDF graph:

[IMG]

Note the following statements:

skos:prefSymbol rdf:type rdf:Property .

  • This statement must be made for anything you wish to be treated as an RDF property.

skos:prefSymbol rdfs:label 'preferred symbol'@en .

  • This should be a human-readable label for the property.

skos:prefSymbol rdfs:domain rdf:Resource .

  • The domain of a property is the class of things you want to infer as the subject of statements involving the property. I.e. it is the class of things you want to use the property to make statements about. In this case, the domain is the class rdf:Resource because we want to use the property skos:prefSymbol with any type of resource.

skos:prefSymbol rdfs:range foaf:Image .

  • The range of a property is the class of things you want to infer as the object of statements involving the property. I.e. it is the class of things to be used as the value of the property. In this case, the range of skos:prefSymbol is the class foaf:Image because we want images to be used as the value of the property.

skos:prefSymbol skos:definition 'The preferred symbolic label for a resource.'@en .

  • A property ought to have some human-readable description of what it means. You can use skos:definition for this.

skos:prefSymbol rdfs:comment 'No two concepts in the same concept scheme may have the same value for skos:prefSymbol.'@en .

  • Use rdfs:comment for any human-readable information about the property.

skos:prefSymbol skos:example <http://www.w3.org/2004/02/skos/core/examples/prefSymbol.rdf.xml> .

  • An example is always handy :)

skos:prefSymbol rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> .

  • http://www.w3.org/2004/02/skos/core is the URI of the resource where the definitive RDF description of skos:prefSymbol is published.

skos:prefSymbol vs:term_status 'testing' .

  • Indicates the stability of the property, i.e. the degree of confidence you may have in it remaining persistently in an unchanged form.

skos:prefSymbol dct:issued '2004-03-26' .

  • Housekeeping.

skos:prefSymbol dct:modified '2004-10-20' .

  • Housekeeping

The complete serialisation of these statements, using the RDF/XML syntax, is below:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rdf:RDF [
	<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
	<!ENTITY dc "http://purl.org/dc/elements/1.1/">
	<!ENTITY dct "http://purl.org/dc/terms/">
	<!ENTITY foaf "http://xmlns.com/foaf/0.1/">
	<!ENTITY vs "http://www.w3.org/2003/06/sw-vocab-status/ns#">
	<!ENTITY skos "http://www.w3.org/2004/02/skos/core#">
]>
<rdf:RDF 
  xml:base="http://www.w3.org/2004/02/skos/core" 
  xmlns:rdf="&rdf;" 
  xmlns:rdfs="&rdfs;" 
  xmlns:skos="&skos;" 
  xmlns:dc="&dc;" 
  xmlns:dct="&dct;" 
  xmlns:vs="&vs;" 
  xmlns:foaf="&foaf;">

  <rdf:Property rdf:ID="prefSymbol">
    <rdfs:label xml:lang="en">preferred symbol</rdfs:label>
    <rdfs:domain rdf:resource="&rdf;Resource"/>
    <rdfs:range rdf:resource="&foaf;Image"/>
    <skos:definition xml:lang="en">The preferred symbolic label for a resource.</skos:definition>
    <rdfs:comment xml:lang="en">No two concepts in the same concept scheme may have the same value for skos:prefSymbol.</rdfs:comment>
    <skos:example rdf:resource="http://www.w3.org/2004/02/skos/core/examples/prefSymbol.rdf.xml"/>
    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
    <vs:term_status>testing</vs:term_status>
    <dct:issued>2004-03-26</dct:issued>
    <dct:modified>2004-10-20</dct:modified>
  </rdf:Property>

</rdf:RDF>


This RDF description is published (along with descriptions of the other classes and properties of SKOS Core) at http://www.w3.org/2004/02/skos/core - note that your server should be configured to deliver any RDF/XML content as content-type=application/rdf+xml.

Declaring an RDFS Class

Let's look at the skos:Concept class.

The URI for this class is http://www.w3.org/2004/02/skos/core#Concept as allocated by the W3C.

The RDF description of this class looks like:

[IMG]

Note the following statements:

skos:Concept rdf:type rdfs:Class .

  • Must be included for any class.

skos:Concept rdfs:label 'Concept'@en .

  • As for properties, it's a good idea for classes to have human readable labels.

skos:Concept skos:definition 'An abstract idea or notion; a unit of thought.'@en .

  • As for properties, it's a good idea for classes to have a human-readable description of their meaning. You can use skos:definition for this.

skos:Concept skos:example <http://www.w3.org/2004/02/skos/core/examples/Concept.rdf.xml> .

  • An example is always handy :)

skos:Concept rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> .

  • http://www.w3.org/2004/02/skos/core is the URI of the resource where the definitive RDF description of skos:Concept is published.

skos:Concept vs:term_status 'testing' .

  • Indicates the stability of the class, i.e. the degree of confidence you may have in it remaining persistently in an unchanged form.

skos:Concept dct:issued '2004-03-26' .

  • Housekeeping.

skos:Concept dct:modified '2004-12-17' .

The complete serialisation of these statements, using the RDF/XML syntax, is below:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rdf:RDF [
	<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
	<!ENTITY dc "http://purl.org/dc/elements/1.1/">
	<!ENTITY dct "http://purl.org/dc/terms/">
	<!ENTITY foaf "http://xmlns.com/foaf/0.1/">
	<!ENTITY vs "http://www.w3.org/2003/06/sw-vocab-status/ns#">
	<!ENTITY skos "http://www.w3.org/2004/02/skos/core#">
]>
<rdf:RDF 
  xml:base="http://www.w3.org/2004/02/skos/core" 
  xmlns:rdf="&rdf;" 
  xmlns:rdfs="&rdfs;" 
  xmlns:skos="&skos;" 
  xmlns:dc="&dc;" 
  xmlns:dct="&dct;" 
  xmlns:vs="&vs;" 
  xmlns:foaf="&foaf;">

  <rdfs:Class rdf:ID="Concept">
    <rdfs:label xml:lang="en">Concept</rdfs:label>
    <skos:definition xml:lang="en">An abstract idea or notion; a unit of thought.</skos:definition>
    <skos:example rdf:resource="http://www.w3.org/2004/02/skos/core/examples/Concept.rdf.xml"/>
    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
    <vs:term_status>testing</vs:term_status>
    <dct:issued>2004-03-26</dct:issued>
    <dct:modified>2004-12-17</dct:modified>
  </rdfs:Class>

</rdf:RDF>


This RDF description is published (along with descriptions of the other classes and properties of SKOS Core) at http://www.w3.org/2004/02/skos/core - note that your server should be configured to deliver any RDF/XML content as content-type=application/rdf+xml.

Scenario 1: Extension by Combination (Pic'n'Mix)

Now that you know how to declare RDF properties and RDFS classes, lets look at the first extension scenario, which is 'extension by combination' or 'Pic'n'Mix'.

RDF has been designed to allow RDF vocabularies such as SKOS Core to be used in combination with other RDF vocabularies such as Dublin Core, OWL and FOAF. In the above examples, properties from the rdf, rdfs, dct, vs and skos namespaces were used in combination to build a description of a class or property. The same goes when creating RDF descriptions of concepts ... you can use as much or as little of SKOS Core as you like, and you're perfectly free to invent your own properties and/or classes to use in combination with SKOS Core.

For example, you might want to use SKOS to help you describe in RDF the topic of interest of an environmental organisation. Here the first step is declare the class of environmental organisations, e.g. ...


@@TODO


The next step is to declare a property to represent the topic of interest relationship, e.g. ...


@@TODO


Now these two properties can be used to describe some environmental organisations, e.g. ...


@@@TODO


Of course, the range of possibilities is endless, and you are free to use any part of SKOS Core in combination with your own classes and properties as you see fit.

N.B. when using pic'n'mix bear in mind that generic applications that understand SKOS Core will just ignore anything unknown. To capture as much as possible of common semantics, and to maximise interoperability, we recommend that wherever possible you use the second scenario, that is extension by refinement.

@@TODO

Scenario 2: Extension by Refinement

@@TODO