opencaesar / oml

Ontological Modeling Language (OML)
http://www.opencaesar.io/oml/
Apache License 2.0
25 stars 4 forks source link

[BUG] - missing support for key axioms involving object properties #89

Open NicolasRouquette opened 2 years ago

NicolasRouquette commented 2 years ago

In OWL2-DL, key axioms can involve a combination of object and data properties.

OML 1.0.6 is currently limited to OML scalar properties.

https://github.com/opencaesar/oml/blob/master/io.opencaesar.oml.dsl/src/io/opencaesar/oml/dsl/Oml.xtext#L421

KeyAxiom:
    'key' properties+=[ScalarProperty|Ref] (',' properties+=[ScalarProperty|Ref])*;

https://github.com/opencaesar/oml/blob/master/io.opencaesar.oml/src/io/opencaesar/oml/Oml.xcore#L1397:L1416

/*
 * KeyAxiom is an axiom that states that a set of scalar properties form a unique key for an entity. This means that all 
 * instances of that entity must have unique values for those keys. Scalar properties do not need to be specified as
 * functional to be used as keys. 
 */
@Bikeshed(heading="Axioms")
class KeyAxiom extends Axiom {
    /*
     * The set of scalar properties specified by this axiom as a key
     */
    refers ScalarProperty[] properties
    /*
     * The entity that owns this axiom
     */
    container Entity owningEntity opposite ownedKeys
    /*
     * The reference to an entity that owns this axiom
     */
    container EntityReference owningReference opposite ownedKeys
}

The OML abstract and concrete syntaxes should be expanded to support referring to an OML relation entity (forward or inverse) in a key axiom.

This issue is related to https://github.com/opencaesar/oml/issues/88 since there is also a need to include a relation entity source/target (or their inverses) in a key axiom.