opencaesar / oml

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

[Enhancement] Oml validation should complain when a literal is used in an assertion but is not consistent with the type of the scalar property #74

Open xdobry opened 4 years ago

xdobry commented 4 years ago

Description

The generated owl is inconsistent because of type mismatch of value property

Steps to Reproduce

use oml2owl to generate owl load owl into some resoner (I have used protege and pellet)

The reasoner gives the error: InconsistentOntologyException

Propellant 'has mulitplicyti' "1" expect integer

The problem seems to be this generated owl part in file /example-firesat/src/opencaesar.io/example/firesat/wp6.4/spacecraft.oml

@rdfs:label "Propellant"
ci Propellant : fse:ConsumableMass [
    fse:hasMultiplicity "1"
]

Will be translated to

1 Propellant But the 1 should be int type. After correcting it to @rdfs:label "Propellant" ci Propellant : fse:ConsumableMass [ fse:hasMultiplicity 1 ] It will be explicitly typed integer 1 Propellant this works for reasoner I am not sure if it is the problem of wrong "oml" or it is issue for oml2owl Anyway Eclipse rosetta plugin does not complain about it. Perhaps problem of rosetta Eclipse Tooling ## Expected Behavior 1) Produce consistent owl or show error during editing
melaasar commented 3 years ago

The problem here is that the OML model invalidly specified a string literal ("1") when the literal should have been of type int, which you can get when you use the literal (1) or ("1"^^xsd:int).

The problem would have been reported by the OwlReason tool (which runs the OWL reasoner) as a reasoning problem.

Whether the OML validator should have also reported this error (in the WB or any where oml-validate is run) is a different issue. I will convert this bug to an enhacement to consider supporting it. I will move it to the oml repo where such validation occurs.