Proposed Additional Quality Issues - cmader/qSKOS GitHub Wiki
This page complements the currently implemented Quality Issues with additional, not yet implemented issues that may be useful to be included in qSKOS.
According to Harpring2010, qualifiers should not be used to
- represent a compound concept
- define a term
- establish a term's hierarchical context
Description | name AND qualifier are both prefered labels of other concepts in the vocabulary. |
Example | "cathedral (baroque)" and the concepts "cathedral" and "baroque" already exist |
Implementation |
I. Find concepts with qualifiers in their prefLabels in a triplestore with RDFS inferencing: SELECT * WHERE {?concept rdf:type skos:Concept. ?concept skos:prefLabel ?label. FILTER regex(?label, "^\\p{L}+\\p{Zs}\\(.*\\)")}
II. Check if the name and qualifier parts of the returned labels are both concepts (Can also be done by a trivial SPARQL query)
|
Description | No other concept labeled with name exists AND the skos:scopeNote is empty. |
Example | "school (elementary)". Better use "elementary school". |
Implementation |
Description | No other concept labeled with name exists AND the concept is not part of a hierarchy. |
Example | |
Implementation |
Description | Textual constraints on some properties like rdfs:label and subclasses thereof. |
Example | Rules of quality assurance processes like NCIt where concept names must start with a letter or underscore. |
Implementation |
In a triple store with RDFS entailment, this can be tested with the SPARQL query
SELECT * WHERE {?concept rdf:type skos:Concept. ?concept skos:prefLabel ?label. FILTER regex(?label, "^[^_\\p{L}]")}
|
Description | Concepts that can easily be confused by the vocabulary users should be associatively connected by skos:related. Such concepts can be identified by sharing (substrings of) the prefered label AND are not directly connected by any SKOS property. |
Example | Harpring2010, "military camps" and "military bases". |
Implementation |
Description | According to the SKOS reference, mapping relations should connect concepts that lie in different concept schemes. |
Example | |
Implementation |
Description | The SKOS reference recommends that skos:broader is used only to assert a direct (immediate) hierarchical link |
Example | |
Implementation |
Implementation in SPARQL: ASK WHERE { ?x skos:broaderTransitive ?y . ?y skos:broaderTransitive ?z . ?x skos:broader ?z . ?x skos:inScheme ?s . ?y skos:inScheme ?s . ?z skos:inScheme ?s . FILTER (((?x != ?y) && (?y != ?z)) && (?x != ?z)) . }Implementation in SPIN: CONSTRUCT { _:b0 a spin:ConstraintViolation . _:b0 rdfs:comment "skos:broader should should be used to assert a direct (immediate) hierarchical link" . _:b0 rdfs:label ?message . _:b0 spin:violationRoot ?this . _:b0 spin:violationPath skos:broader . } WHERE { ?this skos:broaderTransitive ?y . ?y skos:broaderTransitive ?z . ?this skos:broader ?z . ?this skos:inScheme ?s . ?y skos:inScheme ?s . ?z skos:inScheme ?s . FILTER (((?this != ?y) && (?y != ?z)) && (?this != ?z)) . ?this skos:prefLabel ?thisLabel . ?z skos:prefLabel ?zLabel . BIND (CONCAT("skos:broader relation from ", ?thisLabel, " to ", ?zLabel, " does not assert an immediate hierarchical link") AS ?message) } |
Description | skos:broadMatch should be used only to assert a direct (immediate) hierarchical link between two concept schemes |
Example | |
Implementation |
Implementation in SPARQL: ASK WHERE { ?x skos:broaderTransitive ?y . ?y skos:broaderTransitive ?z . ?x skos:broadMatch ?z . ?x skos:inScheme ?scheme1 . ?z skos:inScheme ?scheme2 . { ?y skos:inScheme ?scheme2 . } UNION { ?y skos:inScheme ?scheme1 . } . FILTER ((((?x != ?y) && (?y != ?z)) && (?x != ?z)) && (?scheme1 != ?scheme2)) . }Implementation in SPIN: CONSTRUCT { _:b0 a spin:ConstraintViolation . _:b0 rdfs:comment "skos:broadMatch should should be used to assert a direct (immediate) hierarchical link between two concept schemes" . _:b0 rdfs:label ?message . _:b0 spin:violationRoot ?this . _:b0 spin:violationPath skos:broadMatch . } WHERE { ?this skos:broaderTransitive ?y . ?y skos:broaderTransitive ?z . ?this skos:broadMatch ?z . ?this skos:prefLabel ?thisLabel . ?z skos:prefLabel ?zLabel . ?this skos:inScheme ?scheme1 . ?z skos:inScheme ?scheme2 . { ?y skos:inScheme ?scheme2 . } UNION { ?y skos:inScheme ?scheme1 . } . FILTER ((((?this != ?y) && (?y != ?z)) && (?this != ?z)) && (?scheme1 != ?scheme2)) . BIND (CONCAT("skos:broadMatch relation from ", ?thisLabel, " to ", ?zLabel, " does not assert an immediate hierarchical link") AS ?message) . } |
Description |
A SKOS model should be a conservative extension of each concept scheme inside the model, following a well-established constraint on ontology networks. This means that every broaderTransitive-assertion between two concepts from the same concept scheme S should be derivable from the concept scheme S alone, i.e., should still be derivable when we remove all mapping-relations from S to other concept schemes. |
Example | |
Implementation |
Implementation in SPARQL: ASK WHERE { ?x skos:broaderTransitive ?y . ?x skos:inScheme ?s . ?y skos:inScheme ?s . NOT EXISTS { ?x :broaderTransitiveLocal ?y . } . }Implementation in SPIN: CONSTRUCT { _:b0 a spin:ConstraintViolation . _:b0 rdfs:comment "(CE) Model is not a conservative extension of its concepts chemes" . _:b0 rdfs:label ?message . _:b0 spin:violationRoot ?this . _:b0 spin:violationPath skos:broaderTransitive . } WHERE { ?this skos:broaderTransitive ?y . ?this skos:inScheme ?s . ?y skos:inScheme ?s . ?this skos:prefLabel ?thisLabel . ?y skos:prefLabel ?yLabel . ?s skos:prefLabel ?sLabel . NOT EXISTS { ?this :broaderTransitiveLocal ?y . } . BIND (CONCAT("The SKOS model is not a conservative extension of concept scheme ", ?sLabel, ". The broaderTransitive-relation from ", ?thisLabel, " to ", ?yLabel, " is not derivable from scheme ", ?sLabel, " alone") AS ?message) . }The above implementations make use of the property broaderTransitiveLocal representing the transitive closure of local broader-links, i.e., broader-links between concepts from the same concept scheme. The semantics for broaderTransitiveLocal can be implemented with the following SPARQL inference rule: CONSTRUCT { ?x :broaderTransitiveLocal ?y . } WHERE { ?x skos:broader ?y . ?x skos:inScheme ?s . ?y skos:inScheme ?s . } plus an inference rule saying that broaderTransitiveLocal is transitive. To increase the recall ("completeness") of the conservative extension constraint, add also the following two SPARQL inference rules:
CONSTRUCT { ?x skos:broaderTransitive ?z . } WHERE { ?x skos:broaderTransitive ?y . ?y skos:exactMatch ?z . } CONSTRUCT { ?x skos:broaderTransitive ?z . } WHERE { ?x skos:exactMatch ?y . ?y skos:broaderTransitive ?z . } The conservative extension constraint assumes that a concept belongs to at most one concept scheme, see quality issue "Non-unique Concept Scheme" below. For theoretical background, see "Semantics for mapping relations in SKOS", Web Reasoning and Rule Systems 2013 |
Description |
As stated in the SKOS primer, "there is no mechanism in SKOS to record that a specifc statement ... pertains to a specific concept scheme". However, if we assume as a modelling convention that a concept may belong to at most one concept scheme, we can identify a concept scheme S with all assertions that refer only to concepts that are in scheme S. An assertion x skos:broader y , e.g., can be considered a part of concept scheme S if both x and y belong to S. |
Example | |
Implementation |
Implementation in SPARQL: ASK WHERE { ?this skos:inScheme ?scheme1 . ?this skos:inScheme ?scheme2 . FILTER (?scheme1 != ?scheme2) . } Implementation in SPIN: CONSTRUCT { _:b0 a spin:ConstraintViolation . _:b0 rdfs:comment "A concept can't belong to two different concept schemes" . _:b0 rdfs:label ?message . _:b0 spin:violationRoot ?this . _:b0 spin:violationPath skos:inScheme . } WHERE { ?this skos:inScheme ?scheme1 . ?this skos:inScheme ?scheme2 . ?this skos:prefLabel ?thisLabel . ?scheme1 skos:prefLabel ?scheme1Label . ?scheme2 skos:prefLabel ?scheme2Label . FILTER (?scheme1 != ?scheme2) . BIND (CONCAT("Concept ", ?thisLabel, " belongs to concept scheme ", ?scheme1Label, " and to concept scheme ", ?scheme2Label) AS ?message) . } |