inspire-eu-rdf / inspire-rdf-guidelines

INSPIRE data in RDF
http://inspire-eu-rdf.github.io/inspire-rdf-guidelines/
13 stars 4 forks source link

RDF representation of union data types #13

Closed jechterhoff closed 7 years ago

jechterhoff commented 8 years ago

Description

A <<union>> class represents a choice between a set of different properties and their values. Unions are used in INSPIRE application schemas and need to be represented in INSPIRE RDF schemas as well.

The schema conversion rule for union data types in ISO 19150-2 is insufficient as it does not handle cases where values are a mix of object or datatypes, or the same value type is used by more than one option. The conversion rule focuses on the value types used by the properties of a union, completely ignoring the fact that the properties themselves can carry meaning and therefore must not be discarded.

An approach is needed to represent union data types in INSPIRE RDF schemas.

jechterhoff commented 8 years ago

A <<union>> can be represented in OWL using a logical combination of unqualified cardinality constraints. The according class expression ensures that values are only given for one of the union properties.

:opt1 rdf:type owl:DatatypeProperty ; rdfs:range xsd:string .

:opt2 rdf:type owl:DatatypeProperty ; rdfs:range xsd:integer .

:opt3 rdf:type owl:DatatypeProperty ; rdfs:range xsd:string .

:Union1 rdf:type owl:Class ;

rdfs:subClassOf [ rdf:type owl:Class ; owl:unionOf ( [ owl:intersectionOf ( [ rdf:type owl:Restriction ; owl:onProperty :opt1 ; owl:minCardinality "1"^^xsd:nonNegativeInteger] [ rdf:type owl:Restriction ; owl:onProperty :opt2 ; owl:cardinality "0"^^xsd:nonNegativeInteger] [ rdf:type owl:Restriction ; owl:onProperty :opt3 ; owl:cardinality "0"^^xsd:nonNegativeInteger]) ; rdf:type owl:Class] [ owl:intersectionOf ( [ rdf:type owl:Restriction ; owl:onProperty :opt1 ; owl:cardinality "0"^^xsd:nonNegativeInteger] [ rdf:type owl:Restriction ; owl:onProperty :opt2 ; owl:cardinality "0"^^xsd:nonNegativeInteger] [ rdf:type owl:Restriction ; owl:onProperty :opt3 ; owl:minCardinality "1"^^xsd:nonNegativeInteger]) ; rdf:type owl:Class] [ owl:intersectionOf ( [ rdf:type owl:Restriction ; owl:onProperty :opt1 ; owl:cardinality "0"^^xsd:nonNegativeInteger] [ rdf:type owl:Restriction ; owl:onProperty :opt2 ; owl:minCardinality "1"^^xsd:nonNegativeInteger] [ rdf:type owl:Restriction ; owl:onProperty :opt3 ; owl:cardinality "0"^^xsd:nonNegativeInteger]) ; rdf:type owl:Class] ) ] .

jechterhoff commented 8 years ago

However, if the <<union>> itself is represented as an OWL class, then encoding of actual data would require the creation of individuals that just represent the "choice". A more natural approach would be to encode the "choice" where it is actually of interest, i.e. where the <<union>> is used as value type.

jechterhoff commented 8 years ago

Therefore, don't convert the <<union>> to an OWL class. Instead, transform it as follows:

jechterhoff commented 7 years ago

The described approach has been documented in the guidelines.