linked-statistics / xkos

A SKOS extension for statistical classifications
35 stars 8 forks source link

Add a notationPattern Datatype property #34

Closed FranckCo closed 8 years ago

FranckCo commented 8 years ago

Usually, the codes (notations in SKOS) of the items of a particular level of a classification all share a defined structure.

For example, in the NACE, the codes of the first level are one capital letter (A, B, ...), the codes of the second level are made of two digits (01, 02, ...), the codes of the third level are two digits followed by a point followed by a digit (01.1, 01.2, ...), etc.

It is interesting to capture this information since it can be used to check if a particular token is a valid classification item code for a given level.

The xkos;notationPattern property is introduced for this purpose. Its domain is skos:Concept and its type is xs:token. This token will be a regular expression that can be used to check a code structure.

cygri commented 8 years ago

xs:token seems inappropriate as a datatype for this. xs:token is for unordered lists of whitespace-separated values.

skos:Concept as range seems strange. Wouldn't this make more sense on a skos:ConceptScheme or skos:Collection or some other collection of concepts?

FranckCo commented 8 years ago

You're right Richard, my mistake, I meant xkos:ClassificationLevel (subclass of skos:Collection) as domain. Regarding the xs:token datatype, it is just to insure that we are not bothered by leading or trailing spaces in the regular expression.

cygri commented 8 years ago

I would be more bothered by having to write out the unusual datatype on all values of this property…

:Level2 xkos:notationPattern "[0-9]{4}"^^xsd:token.
FranckCo commented 8 years ago

Ah, I see your point. OK for dropping the token thing then, guess I was being too XMLish :-)

FranckCo commented 8 years ago

Fixed in commit 82d448f.