Properly Create Enums Part 2 - Follow on

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Properly Create Enums Part 2 - Follow on

MartyStache
Thank you Jiba,

The rest of my other post got cut off because I accidentally put HTML comment code in my post at the end lol.

Can someone please review and let me know (DataType or not) if this is the correct approach for handling enumerations with OWLReady? And if.I were not to do individuals, how else would I approach?

Here is what I am currently doing and know that it is likely the incorrect approach:

class Currency(Thing): <— I'd really like to say DataType here???
  pass
Currency.comment = ["Monetary currencies"]

class AUD(Thing or DataProperty?): <—-Thing or DataProperty?? (which would would have domain/range)
  pass
AUD.comment = ["Australian dollar."]

class CHF(Thing or DataProperty?):
  pass
CHF.comment = ["Swiss franc."]

Currency.is_a.append(OneOf([AUD,CHF]))

# the class who's property 'unit' is of type 'Currency' (an enum)
class CostPerVolume(Thing):
  pass
CostPerVolume.comment = ["Cost per unit volume."]

class has_unit(ObjectProperty): <— This just feels to me it should be DataType
  domain = [CostPerVolume]
  range = [Currency]
has_unit.comment = ["The currency used to calculate unit of cost per volume"]