Tags

Integrity constraints in SKOS (part 2)

UPDATE: tested with the new Pellet 2.1.0 and Pellet ICV 0.4

We focus on the SKOS integrity constraint with number S13.

S13 skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise disjoint properties.

Meaning that according to the SKOS spec the following data are not allowed:
<skos:Concept rdf:ID="Concept_1">
<skos:altLabel xml:lang="en">test</skos:altLabel>
<skos:prefLabel xml:lang="en">test</skos:prefLabel>
<rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>Concept_1</rdfs:label>
</skos:Concept>

We investigate if and how this constraint can be implemented using following technologies:

  • OWL 1
  • SPIN
  • OWL 2 DL
    • OWL 2 DL reasoners
  • Pellet ICV

OWL 1


OWL 1 didn't provide the means to assert that if the same pair of individuals is related by more than one property among a given set of disjoint properties, the ontology is inconsistent.

SPIN


Trying to enforce the constraint with SPIN.
The ASK query to define the constraint is:

ASK
WHERE {
OPTIONAL {?subject skos:prefLabel ?pref.}
OPTIONAL {?subject skos:altLabel ?alt.}
OPTIONAL {?subject skos:hiddenLabel ?hidden.}
FILTER (?pref = ?alt || ?alt = ?hidden || ?pref = ?hidden)}
and translated to a spin:constraint on e.g. the Class skos:Concept

ASK WHERE {
OPTIONAL {
?this skos:prefLabel ?pref .
} .
OPTIONAL {
?this skos:altLabel ?alt .
} .
OPTIONAL {
?this skos:hiddenLabel ?hidden .
} .
FILTER (((?pref = ?alt) || (?alt = ?hidden)) || (?pref = ?hidden)) .
}
The result of the SPIN constraint checking in Topbraid Composer:

S13 in TBC


OWL 2


OWL 2 provides the new construct DisjointProperties to state that properties are mutually exclusive.
A disjoint properties axiom takes a set of ObjectProperties or a set of DataProperties and states that those are pair-wise disjoint.

DisjointObjectProperties := 'DisjointObjectProperties' '(' axiomAnnotations ObjectPropertyExpression ObjectPropertyExpression { ObjectPropertyExpression } ')'
DisjointDataProperties := 'DisjointDataProperties' '(' axiomAnnotations DataPropertyExpression DataPropertyExpression { DataPropertyExpression } ')'
I do not find anything in the OWL 2 spec about being able to say that annotation properties are disjoint.
And our SKOS properties skos:prefLabel, skos:altLabel and skos:hiddenLabel are defined as annotation properties.

Can I define skos:prefLabel et all. to be of type and annotation property and data property?

Not in OWL 2 DL, since the sets of IRIs used as object, data, and annotation properties in a DL ontology must be ensured to be disjoint.

Anyhow I wondered what OWL 2 DL reasoners would do if I used following axioms:
<owl:AnnotationProperty rdf:about="http://www.w3.org/2004/02/skos/core#altLabel">
<owl:propertyDisjointWith rdf:resource="http://www.w3.org/2004/02/skos/core#prefLabel"/>
<rdfs:comment xml:lang="en">skos:prefLabel, skos:altLabel and
skos:hiddenLabel are pairwise disjoint properties.</rdfs:comment>
<rdfs:label xml:lang="en">alternative label</rdfs:label>
<skos:definition xml:lang="en">An alternative lexical label for a resource.</skos:definition>
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
<rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
<skos:example xml:lang="en">Acronyms, abbreviations, spelling
variants, and irregular plural/singular forms may be included among the
alternative labels for a concept. Mis-spelled terms are normally
included as hidden labels (see skos:hiddenLabel).</skos:example>
</owl:AnnotationProperty>
together with these data
<skos:Concept rdf:about="http://ec.europa.eu/esco/S13#Concept_1">
<skos:prefLabel xml:lang="en">aaa</skos:prefLabel>
<skos:altLabel xml:lang="en">aaa</skos:altLabel>
<skos:hiddenLabel xml:lang="en">aaaaa</skos:hiddenLabel>
<rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>Concept_1</rdfs:label>
</skos:Concept>

OWL2 DL reasoners


Pellet 2

In Pellet 2.0.2, I get:

Consistent: No
Reason: null

Changing the skos:altlabel to 'aaaa' gives:

Consistent: Yes

UPDATE: The same results with version Pellet 2.1.0.

HermiT

Doing the same with HermiT whatever content used, I get:

It all went pear-shaped: c

Conclusion

I'm not sure what to think about this all. My expectation was that the OWL2 DL reasoners would have come up with a warning that one cannot use a DisjointProperty axiom on Annotation Properties, but they don't. I must be missing something.

Pellet ICV


Pellet ICV is an extension to Pellet that interprets OWL ontologies with the Closed World Assumption in order to detect constraint violations in RDF data, comparable to what is done with XSD schemas for XML data.

I took the propertyDisjointness statements apart in a separate constraints file.

skos:altLabel a owl:AnnotationProperty .
skos:hiddenLabel a owl:AnnotationProperty .
skos:prefLabel a owl:AnnotationProperty .

[] a owl:AllDisjointProperties ;
owl:members (skos:prefLabel skos:altLabel skos:hiddenLabel) .
Running then following data through pellet icv 0.4 using the constraints file above:

[] a owl:Ontology ;
owl:imports <http://www.w3.org/TR/skos-reference/skos.rdf> .
<Test_1> a test:Thing.
<Test_1> skos:prefLabel "test"@en; skos:altLabel "test"@en; skos:hiddenLabel "test"@en .
gives indeed a constraint violation:

Validating 3 integrity constraints
Will stop after 1 constraint violation(s) are found
Validating constraint: disjointProperties prefLabel altLabel hiddenLabel

Constraint violated : Yes
Violating individuals (1): Test_1,
Number of constraint(s) violated: 1

However, if I leave out from my data the statements

[] a owl:Ontology ;
owl:imports <http://www.w3.org/TR/skos-reference/skos.rdf> .

and /or

<Test_1> a test:Thing.

I get:

Validating constraint: disjointProperties prefLabel altLabel hiddenLabel
Constraint violated : No
Validating constraint: disjointProperties prefLabel altLabel hiddenLabel
Constraint violated : No
Validating constraint: disjointProperties prefLabel altLabel hiddenLabel
Constraint violated : No

Number of constraint(s) violated: 0

Which leaves me completely puzzled.

Conclusion

And the winner for constraint S13 is SPIN.
OWLIC is able to do the same but still has some rough edges; surely to be revisited after feedback from C&P.

Comments

Rinke Hoekstra (unauthenticated)
Mar 25, 2010

The disjointness of data, object and annotation-properties is indeed required by the OWL 2 spec, as we set ourselves the goal to come up with a good use case for every type of 'punning'. For some reason, we did not find property-punning use-cases (though I can certainly think of several now), but it was probably late in the F2F. However, there is no technical reason that requires properties to be excluded from the punning capabilities of a reasoner. That's why Pellet 2 is able to raise the inconsistency.