Search code examples
propertiessubclassowlontologyschema.org

Relationship between range and enumerations in ontologies


So I'm currently working on an ontology which has an EnumerationClass set up in a similar manner to how Enumeration is set up in Schema.org (https://schema.org/Enumeration).

It has subclasses which I'll call ProgramTypeEnumeration and SubstanceTypeEnumeration. Both of these have defined instances. Let's say ProgramTypeEnumeration has instances BasicProgram and AdvancedProgram.

Then there is a property called hasProgramType which relates an AcademicClass class to a program type in the ProgramTypeEnumeration. My assumption is that domain would be AcademicClass and range would be ProgramTypeEnumeration.

That being said, my understanding is that an enumeration is effectively a list. Is it correct to say that BasicProgram is an instance of ProgramTypeEnumeration when BasicProgram is not a list? As well, I'm not saying that hasProgramType has a range of instances of lists of programs, but a range of instances of programs. Would it be better to have a class ProgramType which is a part_of a ProgramTypeEnumeration and then have ProgramType be the range of hasProgramType?

As well, more broadly, is every finite class with a set number of instances technically a subclass of enumeration? e.g. would a class "U.S. State" be a subclass of enumeration if it has exactly 50 instances? Would "ZIP Code" be a subclass of enumeration since it technically also has an exactly number of instances? How do I define whether a class is or isn't an enumeration?

EDIT 1: Attempting to provide a more clear example here.

So Schema.org has an Enumeration subclass which is "MedicalSpecialty" (https://schema.org/MedicalSpecialty). "MedicalSpecialty" has instances which are medical specialties (anesthesia, cardiovascular, etc.).

In Schema.org, the property "medicalSpecialty" (https://schema.org/medicalSpecialty) has rangeIncludes "MedicalSpecialty" (the Enumeration subclass).

Two fundamental questions: (1) Is there a benefit to having "MedicalSpecialty" as an Enumeration subclass and not a subclass outside of an enumeration? (2) Is an Enumeration a class which contains lists, and if so, wouldn't an instance of an Enumeration also be a list, instead of a single option? (i.e. wouldn't an instance of the "MedicalSpecialty" enumeration itself be an enumeration?)


Solution

  • The main advantage of an Enumeration is that it makes clear to everyone that uses your ontology that a class consists of a finite list of named individuals. As for the example you mention of MedicalSpecialty, you will see that Schema.org has a list of "Enumeration Members" that are the named individuals MedicalSpecialty consists of.

    An Enumeration and a plain class are indeed very similar. Both an Enumeration and a class consists of individuals (also called instances). The difference is that for a class all the individuals it may consist of is usually not known, but for an Enumeration it is known. Furthermore, a class may have a finite or an infinite number of individuals, whereas an Enumeration has a finite number of known individuals.

    If you have a list of named individuals, then it is a good idea to use Enumeration.

    Answers to your questions:

    (1) The value of using Enumeration is to make clear to users the expected values to use for properties as for example with the medicalSpeciality property. If a reasoner or rules engine is used, these will be able to pick up errors when example the medicalSpeciality property is used incorrectly.

    (2) An Enumeration is not a class that contains lists. Rather an Enumeration is a class that consists of named individuals. Thus, an instance of an Enumeration is an individual just like an instance of a class is an individual. An instance of an Enumeration is not an Enumeration, it is an individual.

    If this may be helpful, I have written about Schema.org and OWL on my blog.