opencaesar / oml

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

Support for Enumerated Classes (Enumerations of entities) #45

Open JWT007 opened 4 years ago

JWT007 commented 4 years ago

User Story

Currently OML supports literal-based enumerations.

I would like additionally to be able to define enumerations of entities in OML to match the support in OWL (Enumerated Classes).

Detailed Description

OWL supports enumerations of complex types (non-scalar values).

From the specification: https://www.w3.org/TR/2004/REC-owl-guide-20040210/#EnumeratedClasses [Section: 5.2]

OWL provides the means to specify a class via a direct enumeration of its members. This is done using the oneOf construct. Notably, this definition completely specifies the class extension, so that no other individuals can be declared to belong to the class.

The following defines a class WineColor whose members are the individuals White, Rose, and Red.

<owl:Class rdf:ID="WineColor">
  <rdfs:subClassOf rdf:resource="#WineDescriptor"/>
  <owl:oneOf rdf:parseType="Collection">
    <owl:Thing rdf:about="#White"/>
    <owl:Thing rdf:about="#Rose"/>
    <owl:Thing rdf:about="#Red"/>
  </owl:oneOf>
</owl:Class>
The first thing to understand here is that no other individuals can be a valid WineColor since the class has been defined by enumeration.

Each element of the oneOf construct must be a validly declared individual. An individual has to belong to some class. In the above example, each individual was referenced by name. We used owl:Thing as a simple cliché to introduce the reference. Alternatively, we could have referenced the elements of the set according to their specific type, WineColor, by:

<owl:Class rdf:ID="WineColor">
  <rdfs:subClassOf rdf:resource="#WineDescriptor"/>
  <owl:oneOf rdf:parseType="Collection">
    <WineColor rdf:about="#White" />
    <WineColor rdf:about="#Rose" />
    <WineColor rdf:about="#Red" />
  </owl:oneOf>
</owl:Class>
Other, more complex descriptions of individuals are also valid elements of the oneOf construct, for example:

<WineColor rdf:about="#White">
  <rdfs:label>White</rdfs:label>
</WineColor>