Cogui - Constraints v2.0


Overview

Constraints allow to define pieces of information that are forbidden in the facts (negative constraints) or mandatory in the facts (positive constraints).

Negative constraints

A negative constraint is a simple graph expressing a condition that must not appear in checked facts. Checking a negative constraint is similar to query facts. Facts are validated if no homomorphism of the constraint graph can be found into them.

no wine is sweet and strong ?

Positive constraints

A positive constraint is a structured as a rule with a condition part and the obligation part. A fact satisfies a positive constraint if every homomorphism from the condition part to the fact can be extended to a homomorphism of the obligation part to the fact. The example below expresses the fact that "a wine is necessarily associated with a winery". Positive constraints will be triggered each time a wine appears without a Winery attached to it with hasMaker relation.

a positive constraint