XML Schema to OWL
[edit | delete | history]


The XSD2OWL packges is based on an XSL (XML Style Sheet) that performs a partial mapping from XML Schema to OWL. It is an implementation of the "XML Semantics Reuse Methodology" proposed in the PhD Thesis "A Semantic Web Approach to Digital Rights Management". It can be tested from the ReDeFer web page.


The XML Schema to OWL mapping is responsible for capturing the schema implicit semantics. This semantics are determined by the combination of XML Schema constructs. The XSD2OWL mapping is based on translating this constructs to the OWL ones that best capture their semantics. These translations are shown in Table 1.

Table 1. XSD2OWL translations for the XML Schema constructs and shared semantics with OWL constructs

XML Schema


Shared informal semantics


rdf: Property
owl: DatatypeProperty
owl: ObjectProperty

Named relation between nodes or nodes and values


rdfs: subPropertyOf

Relation can appear in place of a more general one


rdfs: range

The relation range kind


owl: Class

Relations and contextual restrictions package


owl: Restriction

Contextualised restriction of a relation


rdfs: subClassOf

Package concretises the base package


owl: maxCardinality
owl: minCardinality

Restrict the number of occurrences of a relation


owl: intersectionOf
owl: unionOf

Combination of relations in a context

The XSD2OWL mapping is quite transparent and captures a great part XML Schema semantics. The same names used for XML constructs are used for OWL ones, although in the new namespace defined for the ontology. Therefore, it produces OWL ontologies that make explicit the semantics of the corresponding XML Schemas. The only caveats are the implicit order conveyed by xsd: sequence and the exclusivity of xsd: choice.

For the first problem, owl: intersectionOf does not retain its operands order, there is no clear solution that retains the great level of transparency that has been achieved. The use of RDF Lists might impose order but introduces ad-hoc constructs not present in the original metadata. Moreover, as it has been demonstrated in practise, the elements' ordering does not contribute much from a semantic point of view. For the second problem, owl: unionOf is an inclusive union, the solution is to use the disjointness OWL construct, owl: disjointWith, between all union operands in order to make it exclusive.


The first figure presents a fragment of XMLSchema that defines a "grant" element as a xsd: choice. The first choice is a xsd: sequence of the "principal", "resource", "right" and "condition" elements. Only "right" is mandatory, i.e. it must occur at least once. The other choice is an "encriptedGrant" element. Moreover, the is the "validityInterval" element that is declared to be a substitutionGroup of the "condition" element, i.e. it can appear wherever the "condition" element can appear. The "validityInterval" element is defined as a xsd: sequence of "notBefore" and "notAfter", both non-mandatory.

The second figure shows the corresponding OWL mapping produced by the XSD2OWL XSL.

XSD Model OWL Model