pyLODE icon indicating copy to clipboard operation
pyLODE copied to clipboard

Using OWL:equivalentClass to create Enum lists

Open ashleysommer opened this issue 1 year ago • 0 comments

The recommended way to create an Enum in an owl ontology is to use owl:equivalentClass with a bnode containing an owl:oneOf list like this:

cn:CausalEffectIncrease
    a owl:NamedIndividual , cn:CausalEffect ;
    rdfs:comment "The link has the effect of Increasing."@en ;
    rdfs:label "Increase"@en ;
    .

cn:CausalEffectDecrease
    a owl:NamedIndividual , cn:CausalEffect ;
    rdfs:comment "The link has the effect of Decreasing."@en ;
    rdfs:label "Decrease"@en ;

cn:CausalEffects
    a rdfs:Class, owl:Class ;
    rdfs:subClassOf cn:CausalEffect ;
    owl:equivalentClass [
        owl:oneOf ( cn:CausalEffectIncrease cn:CausalEffectDecrease ) ;
                        ] ;
    rdfs:comment "Enum of possible Casual Effects. Can be \"Increase\" or \"Decrease\"."@en ;
    .

When rendering this in pyLode I get this output:

image Notice the owl:equivalentClass

I would expect this to render a list of the named individuals like this:

  • equivalentClass: Enumeration
    • cn:CausalEffectIncrease
    • cn:CausalEffectDecrease

ashleysommer avatar Mar 07 '24 01:03 ashleysommer