Skip to content

obdalib_parsers_dependencies_fsyntax

Martin Rezk edited this page Nov 29, 2013 · 3 revisions

Table of Contents

Dependency Assertion

There are three types of dependency assertion supported in the API:

  1. Inclusion dependency (def?)
  2. Disjointness dependency (def?)
  3. Functional dependency (def?)

Inclusion Dependency

The syntax follows this rule:

'includedIn' ({BODY|HEAD}.mapping_id[$var {, $var...}], {BODY|HEAD}.mapping_id[$var {, $var ...}])

An inclusion dependency uses the keyword "includedIn" followed by exacltly two parameters separated by a comma (,) and each parameter indicates the mapping identifier and the variables. The syntax for a parameter begins with an either "Head" or "Body" string followed by a dot (.), the mapping_id and one or more variables inside square brackets.

Note: The mapping_id must already exist in the mapping axioms, or otherwise the dependency will not be accepted.

For example:

includedIn(Body.mapping-offers[$id], Body.mapping-brokers[$id])

includedIn(Body.mapping-brokers[$name, $surname], Body.mapping-clients[$name, $surname])

The first example means that the id in mapping-offers is included in the id in mapping-brokers

Disjointedness Dependency

The syntax follows this rule:

'disjoint' ({BODY|HEAD}.mapping_id[$var {, $var...}], {BODY|HEAD}.mapping_id[$var {, $var ...}])

An inclusion dependency uses the keyword "disjoint". The description about the rest of the syntax is the same as the previous.

For example:

disjoint(Body.mapping-offers[$id], Body.mapping-brokers[$id])

disjoint(Body.mapping-brokers[$name, $surname], Body.mapping-clients[$name, $surname])

The first example means that both id in mapping-offers and mapping-brokers are disjoined.

Functional Dependency

The syntax follows this rule:

'functionOf' ({BODY|HEAD}.mapping_id[$var {, $var...}], {BODY|HEAD}.mapping_id[$var {, $var ...}])

A functional dependency uses the keyword "functionOf". The description about the rest of the syntax is the same as the previous.

For example:

functionOf(Body.mapping-offers[$id],Body.mapping-brokers[$id])

The example means that the id in mapping-offers determines the id in mapping-brokers.

Creating a dependency assertion

For creating a dependency assertion there are basically possibilities. The first is to insert it the appropriate text pane. The inserted text is parsed a parser and if the syntax is correct the dependency assertion is added. The second possibility is by selecting two mappings, right click on them, insert all necessary variables in the appearing dialog and press "create". The system than automatically creates an assertion using the selected mappings and the inserted variables.

Once a dependency is inserted there is the possibility to modify them. By double clicking on the the tree item one can update the assertion. Here again it is important that the modification respects the syntax and valid mapping ids are used, otherwise the modifications are ignored.







              
Clone this wiki locally