opencaesar / oml

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

[BUG] - Scalar property requires domain/range #105

Closed mprather closed 1 year ago

mprather commented 1 year ago

Description

Documentation states that scalar property can have zero or one domain/range+functional set.

http://www.opencaesar.io/oml/#ScalarProperty-LR

scalar property ID (:> [ScalarProperty|IRI] (, [ScalarProperty|IRI])*)? ([
  domain [Classifier|IRI]
  range [Scalar|IRI]
  functional?                // each instance can have a maximum of 1 value for this property
])?

Steps to Reproduce

Define a scalar property without the axiom.

  scalar property MyProperty 

Result:

        The required feature 'domain' of 'ScalarProperty test:MyProperty' must be set
        The required feature 'range' of 'ScalarProperty test:MyProperty' must be set
        The required feature 'domain' of 'ScalarProperty test:MyProperty' must be set
        The required feature 'range' of 'ScalarProperty test:MyProperty' must be set

Expected Behavior

Either the docs needs to be updated or there is a bug in the parsing code.

melaasar commented 1 year ago

The docs says that only the functional flag is optional (notated with ? in BNF) for a scalar property. Both domain and range do not have ? which means they are required.

mprather commented 1 year ago

The entire section is wrapped by an optional ?

([ domain [Classifier|IRI] range [Scalar|IRI] functional? // each instance can have a maximum of 1 value for this property ])?

This is the point of this issue. The documentation is different than the behavior observed.

melaasar commented 1 year ago

Ah, sorry I missed that. You're right. I will fix this in the next patch release soon.

melaasar commented 1 year ago

I fixed the spec with the correct syntax. Please double check: http://www.opencaesar.io/om

mprather commented 1 year ago

Thanks. Closing.