logo

OMWG D7.2: Ontology Mapping Language RDF/XML Syntax

DERI OMWG Working Draft last update 21 January 2007

This version:
http://www.omwg.org/TR/d7/rdf-xml-syntax/
Author:
François Scharffe
Editor:
Jérôme Euzenat

this document is available as a non normative PDF version


Table of contents

1 Introduction
1.1 Namespaces
1.2 Examples
2 General Structure
3 Header
4 Cell
5 From Entities to Expressions
5.1 Entities
5.2 Class Expression
5.3 Property Expression
5.4 Relation Expression
5.5 Instances
6 Paths, Values and Restrictions

1 Introduction

The ontology mapping language allows to specify correspondences between two ontologies. What makes it specific is the possibility to represent complex correspondences independently from the language the ontologies are modeled in. In other words the mapping language gives a way to represent all kinds of schema mappings. This document presents the RDF/XML syntax of the language. A Lisp style syntax is also maintained.

For more information about the language and available tools, please check this page.

1.1 Namespaces

This syntax is based on two vocabularies:

This document makes also reference to XML-Schema datatypes (http://www.w3.org/2001/XMLSchema) and Dublin Core vocabulary for annotations (http://purl.org/dc/elements/1.1/).

1.2 Examples

This document examples are based on a mapping between two ontologies dealing about wine.

You may find the complete example from which examples in this page are extracted here. The RDF graph of this example is available as a png file.

2 General Structure

The alignment language allows to describe mapping documents that each describe an alignment. Grammar 1 gives the structure of a mapping document: a header (annotations, onto1, onto2) and a number of cells (Cell)

Grammar 1. Alignment
Alignment ::= <align:Alignment rdf:about="uri">
annotation*
<align:level>2OMWG</align:level>
<align:onto1>onto</align:onto1>
<align:onto2>onto</align:onto2>
(<align:map>Cell</align:map>)*
</Alignment>

3 Header

The header of the document represent metadata about related ontologies and the document itself. Metadata can be added about the mapping document as part of this header. Metadata coming from the Alignment Format (xml, method, purpose, level, type) are described in the this format documentation (see Section 1.1). There is no limitation about which metadata to be added. We however recommend the use of Dublin Core descriptors. For each ontology are given its URI defined in the rdf:about field of the rdf description and formalism. Grammar 2 gives a description of the ontologies.

Grammar 2. Ontology
onto ::= <align:Ontology rdf:about="uri">
<align:location>uri</align:location>
<align:formalism>formalism</align:formalism>
</align:Ontology>

The formalism gives information about the ontology language used to represent it: A URI representing this language (usually the base URI for this language) and a string representing the name of this language. Grammar 3 gives the syntax for describing the formalism.

Grammar 3. Formalism
formalism ::= <align:Formalism>
<align:uri>uri</uri>
<align:name>string</name>
</align:Formalism>

Example 1 gives such a header for an alignment between Vin and Wine ontologies. The RDF graph of this example is available as a png file.

Example 1. Header
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE rdf:RDF SYSTEM "align.dtd" [
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
<!ENTITY wine "http://www.w3.org/TR/2003/CR-owl-guide-20030818/wine#">
<!ENTITY vin "http://www.scharffe.fr/ontologies/ontologieDuVin">
]>
<rdf:RDF xmlns="http://www.omwg.org/TR/d7/ontology/alignment"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:align="http://knowledgeweb.semanticweb.org/heterogeneity/alignment"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
<align:Alignment rdf:about="">
<align:xml>yes</align:xml>
<dc:creator rdf:resource="http://sw.deri.org/~francois/"/>
<dc:date>2006/06/07</dc:date>
<align:method>manual</align:method>
<align:purpose>example</align:purpose>
<align:level>2OMWG</align:level>
<align:type>**</align:type>
<align:onto1>
<align:Ontology rdf:about="http://www.w3.org/TR/2003/CR-owl-guide-20030818/wine#">
<align:location>http://www.w3.org/TR/2003/CR-owl-guide-20030818/wine#</align:location>
<align:formalism>
<align:Formalism>
<align:uri>http://www.w3.org/TR/owl-guide/</align:uri>
<align:name>owl</align:name>
</align:Formalism>
</align:formalism>
</Ontology>
</align:onto1>
<align:onto2>
<Ontology rdf:about="http://www.scharffe.fr/ontologies/OntologieDuVin">
<align:location>http://www.scharffe.fr/ontologies/OntologieDuVin.wsml</align:location>
<align:formalism rdf:parseType="Resource">
<align:Formalism>
<align:uri>http://www.wsmo.org/wsml/wsml-syntax/wsml-dl</align:uri>
<align:name>wsml</align:name>
</align:Formalism>
</align:formalism>
</rdf:Description>
</align:onto2>

4 Cell

Each correspondence is contained in a cell which describes the two related entities. Each cell contains the following information: a description of each entity, a measure of confidence in the correspondence, and a relation for the described correspondence. Grammar 4 gives the syntax of a cell.

Grammar 3. Formalism
Cell ::= <Cell rdf:about="uri">
annotation*
<entity1>entity</entity1>
<entity2>entity</entity2>
<measure rdf:datatype="float">float</measure>
<relation>relation</relation>
</Cell>

The measure field comes from the alignment format. It represents the confidence given to the correspondence described in the cell. This measure is given by a float which takes values between 0 and 1.

The relation field indicates which relation stands between the two related entities. Three values are possible:

Grammar 3.1. Relation
relation ::= Equivalence | Subsumes | SubsumedBy | InstanceOf | HasInstance

See example 2 for an example of cell with simple entities.

5 From Entities to Expressions

5.1 Entities

The ontological objects to be put into correspondence are defined in the entities. Entities can be of four types:

Entities can be simple (like a reference to a class) or more complex by grouping together many simple entities or adding conditions restricting their scope.




Grammar 5.1. Entities
Entity ::= classexpr | attrexpr | relexpr | instance

Example 2 shows a cell representing a correspondence between two simple entities. The RDF graph of this example is available as a png file.

Example 2. Correspondence between two simple entities
<Cell rdf:about="MappingRule_0">
<entity1><omwg:Class rdf:about="VintageYear"/></entity1>
<entity2><omwg:Class rdf:about="Millesime"/></entity2>
<measure rdf:datatype="float">1.0</measure>
<relation>equivalence</relation>
</Cell>

Expressions are constructed by combining entities using operators. They can be restricted using conditions. Note there is no possible combination or restriction between instance entities.

5.2 Class Expression

Class constructs are formed using one of the three operators and, or, not.

There are three possible conditions for class expressions:

Class conditions values are specified using restrictions.

Grammar 5.2. Class Expression
classexpr ::= <Class {rdf:about="uri"}?>
classconst?
classcond*
</omwg:Class>
classconst ::= <and><Collection>
<item>classexpr</item>
(<item>classexpr<item>)+
</Collection>
</and>
| <or><Collection>
<item>classexpr</item>
(<item>classexpr<item>)+
</Collection>
</or>
| <not>classexpr</not>
classcond ::= <attributeValueCondition>
restriction
</attributeValueCondition>
| <attributeTypeCondition>
restriction
</attributeTypeCondition>
| <attributeOccurenceCondition>
restriction
</attributeOccurenceCondition>

The following Example 3 specify a correspondence between a class and the union of three classes. Its RDF graph is available as a png file.

Example 3. Correspondence showing the 'or' operator
<align:Cell rdf:about="MappingRule_4">
<align:entity1>
<Class>
<or>
<Collection>
<item><Class rdf:about="Acidite"/></item>
<item><Class rdf:about="Astreingence"/></item>
<item><Class rdf:about="Amertume"/</item>>
</Collection>
</or>
</Class>
</align:entity1>
<align:entity2><Class rdf:about="WineFlavor"/></align:entity2>
<align:measure rdf:datatype='float'>1.</align:measure>
<align:relation>subsumption</align:relation>
</align:Cell></map>

5.3 Property Expression

Property constructs are formed using one of the three operators and, or, not.

There are three possible property conditions:

Transformations indicate modifications of property values. They are functions that can be called directly or via a web service. Example of transformations are unit conversions (function because static) or currency conversions (web services because dynamic). A transformation is called by indicating it's URI and parameters.

Grammar 5.3 Attribute Expression
attrexpr ::= <Property {rdf:about="uri"}?>
attrconst?
attrcond*
transformation?
</Property>
attrconst ::= <and><Collection>
<item>attrexpr</item>
(<item>attrexpr<item>)+
</Collection>
</and>
| <or><Collection>
<item>attrexpr</item>
(<item>attrexpr<item>)+
</Collection>
</or>
| <not>attrexpr</not>
attrcond ::= <valueCondition>
<Restriction>
<comparator>uri</comparator>
<value>pov</value> </Restriction>
</valueCondition>
| <domainRestriction>classexpr</domainRestriction>
| <typeCondition>pov</typeCondition>
transformation ::= <transf rdf:resource="uri">pov*</transf>

Example 4 illustrate the use of an attribute transformation.

Example 4. attribute value transformation
<align:Cell>
<align:entity1>
<Property rdf:about="&vin:annee_millesime">
<transformation rdf:resource="Transformation:Date2Int"></transformation>
</Property>
</align:entity1>
<align:entity2>
<Property rdf:about="&wine;hasVintageYear"/>
</align:entity2>
<align:measure rdf:datatype=’&xsd:float’>1.</align:measure>
<align:relation>subsumption</align:relation>
</align:Cell>

5.4 Relation Expression

Relation constructs are formed using one of the seven operators and, or, not, inverse, symmetric, transitive and reflexive.

There are three possible attribute conditions:

Grammar 5.4 Relation Expression
relexpr ::= <Relation {rdf:about="uri"}?>
relconst?
relcond*
</Relation>
relconst ::= <and rdf:parseType="Collection">relexprrelexpr+</and>
| <or rdf:parseType="Collection">relexprrelexpr+</or>
| <not>relexpr</not>
| <inverse>relexpr</not>
| <symmetric>relexpr</not>
| <transitive>relexpr</not>
| <reflexive>relexpr</not>
relcond ::= <domainRestriction>classexpr</domainRestriction>
| <rangeRestriction>classexpr</rangeRestriction>

5.5 Instances

Instance expressions are simply specified using the instance URIs:

Grammar 5.5. instance
instance ::= <Instance rdf:about="uri"/>

6 Paths, Values and Restrictions

Paths are used to target a particular property (attribute or relation) by navigating through the attributes and relations graph. At the end of a path is an attribute value or a relation co-domain instance that will serve in a restriction. Grammar 7 gives the syntax for paths and values.

Grammar 7. Path, Value, Path or Value
path ::= Step
| <Self />
| <Path>
<first>step</first>
<next>path</next>
</Path>
Step ::= <Property rdf:about="uri"/>
| <Relation rdf:about="uri"/>
value ::= string
| instance
| <Apply operation="uri">pov*</Apply>
pov ::= path
| value

Restrictions are used to specified conditions. The property (attribute or relation) on which the restriction applies is indicated with a path. The value to which the property value will be compared is then indicated. There is actually no standard definition of comparators to be used. We recommend to use Xquery and SWRL ones. Grammar 8 gives the syntax for restrictions.

Grammar 8. Restriction
restriction ::= <Restriction>
<onProperty>path</onProperty>
<comparator>uri</comparator>
<value>pov</value>
</Restriction>

Example 5 shows an attribute value condition using a restriction. The RDF graph of this example is available as a png file.

Example 5. Correspondence using a condition
<map><Cell>
<rdf:Description rdf:about="MappingRule_3">
<entity1><Class rdf:about="Bordeaux"/></entity1>
<entity2>
<Class rdf:about="http://ontology.deri.org/vin#Vin">
<attributeValueCondition rdf:parseType="Resource">
<Restriction rdf:parseType="Resource">
<onProperty>
<Path>
<first><Relation rdf:about="hasTerroir"/></first>
<next>Relation rdf:about="LocatedIn"/></next>
</Path>
</onProperty>
<comparator rdf:resource="equal"/>
<value>loc:Aquitaine</value>
</Restriction>
</attributeValueCondition>
</Class>
</entity2>
<measure rdf:datatype='float'>1.</measure>
<relation>subsumption</relation>
</Cell></map>

Copyright © 2008 STI®, All Rights Reserved. STI liability, trademark, document use, and software licensing rules apply.