opencaesar / oml

Ontological Modeling Language (OML)
https://opencaesar.github.io/oml/
Apache License 2.0
24 stars 4 forks source link

[BUG] - missing support for swrl predicates involving scalar properties. #90

Open NicolasRouquette opened 2 years ago

NicolasRouquette commented 2 years ago

Description

A clear and concise description of what the bug is.

https://www.w3.org/Submission/SWRL/

SWRL supports using a data valued property as an atom:

atom ::= description '(' i-object ')'
     | dataRange '(' d-object ')'
     | individualvaluedPropertyID '(' i-object i-object ')'
     | datavaluedPropertyID '(' i-object d-object ')'
     | sameAs '(' i-object i-object ')'
     | differentFrom '(' i-object i-object ')'
     | builtIn '(' builtinID { d-object } ')'

In OML this would correspond to a scalar property.

Unfortunately, OML 1.0.6 does not support using a scalar property as a predicate. This should also include adding support for binding the value of the scalar property either to a SWRL variable or to a constant.

Steps to Reproduce

Steps to reproduce the behavior:

Expected Behavior

A clear and concise description of what should be the expected behavior.

Additional Context

Enter any other details such as dependencies, environment, examples, etc.

Relevant screenshots

If applicable, add screenshots to help illustrate the issue.

melaasar commented 2 years ago

OML 1.0.6 already supports specifying scalar properties in a predicate since it inherits from Feature and there is support for FeaturePredicate: https://github.com/opencaesar/oml/blob/3276945fb3e17fc888130720a837abd202982bd1/io.opencaesar.oml.dsl/src/io/opencaesar/oml/dsl/Oml.xtext#L462

At least where the value is specified as a variable.

Are you sure this is not working for you? Can you give an example that does not work?

NicolasRouquette commented 2 years ago

See: https://github.com/NicolasRouquette/metrology-vocabularies

In vim4.oml, there is a rule that is commented out:

  // See https://github.com/opencaesar/oml/issues/90
//  rule incoherent-derived-unit-implies-incoherent-system-of-units [
//    systemHasDerivedUnit(su, dq) ^ isCoherent(dq, "false"^^xsd:boolean) ->
//    isCoherent(su, "false"^^xsd:boolean)
//  ]