Contexts

A context can be defined on a schema element to restrict its domain of validity to certain instances or property values. This means mapping cells defined on contexts are not generally in effect, but only on certain conditions, in a certain context.

As an example, you can use contexts to express a relation like this:

The type Product in the source schema is the same as the type Shirt in the target schema if its property type has the value 'shirt'.

This example can be realised, if a condition context is created for the type Product, with the condition type = 'shirt' , and a Retype relation is created between the defined Product context and the Shirt type. Contexts are defined using expressions and filters in Common Query language (CQL).

Source schema contexts

Types of contexts that can be defined on the source schema.

Condition context

A condition context defines a condition on a type or property, that is evaluated on the instance or property value respectively. Only if the condition is fulfilled, an associated mapping takes effect.

Index context

An index context can only be defined on properties that may occur multiple times. It specifies an index, which references a certain property value, e.g. the index zero referencing the first property value, the index one the second, etc.

A mapping associated to an index context only takes effect if an instance has a property value with the specified index.

Target schema contexts

Types of contexts that can be defined on the target schema.

Instance context

An instance context can similar to an index context only be defined on properties that may occur multiple times. It represents an additional property instance that a mapping can use as a target, e.g. if the same target property is to be populated from the source in different ways.

Example projects featuring contexts



What is a Schema?

What is an Instance?

What is an Alignment?


Defining contexts on schema elements


Schema elements