This wiki has been archived and is now read-only.

SKOS Constraints

From RDF Data Shapes Working Group
Jump to: navigation, search

SKOS is a well-known data sharing standard used to represent hierarchical models such as taxonomies. While the vocabulary schema itself is defined as an OWL Ontology, the specification also includes additional integrity constraints that could not be expressed in OWL:

Example (http://www.w3.org/TR/2009/REC-skos-reference-20090818/#L1567):

   S14: A resource has no more than one value skos:prefLabel per language tag.

pfps: I would argue that these are no more constraints than much of the rest of SKOS. Instead they should be handled by the ontology. Of course, OWL does not have the capabilities to state the above condition, so the only recourse is to use something like below. The larger question is whether these sorts of situations should be considered to be central use cases for the Working Group's solution.

(See http://lists.w3.org/Archives/Public/public-data-shapes-wg/2014Nov/0021.html for a discussion of that point)


       spin:constraint [
           a sp:Construct ;
           sp:text """
               CONSTRUCT {
                   _:cv a spin:ConstraintViolation ;
                        rdfs:label ?message ;
                        spin:violationRoot ?this ;
                        spin:violationPath skos:prefLabel .
               WHERE {
                   ?this skos:prefLabel ?label1 .
                   ?this skos:prefLabel ?label2 .
                   FILTER ((lang(?label1) = lang(?label2)) && (?label1 != ?label2)) .
                   BIND (CONCAT("Constraint S14: a resource has no more than one value of skos:prefLabel per language tag (@", lang(?label1), ").") AS ?message) .
       ] .