5

I'm working on an ontology and I need to tell protege that one class x can only have the values y and z.

I want something like:

Vegetable rdf:type owl:Class;
   owl:oneOf (carrot corn).

Must I edit the file directly or is there a way to do it via Protege?

trooper
  • 4,444
  • 5
  • 32
  • 32
MusicAndCode
  • 870
  • 8
  • 22
  • Think I found it. Using the Object Restriction Creator you can add "only" – MusicAndCode Jan 17 '15 at 22:29
  • 4
    **only** is for Universal Restictions. The class **[eats only Vegetable]** is the class of individuals x such that for any y where eats(x,y), y must be a Vegetable. That is, the class of things that *eats only Vegetables*. What you're looking for, as pointed out [in an answer](http://stackoverflow.com/a/28012832/1281433) is an enumerated class (with one of) and an equivalent class axiom. – Joshua Taylor Jan 19 '15 at 19:11

1 Answers1

7

In the Class Description you should choose "Equivalent To" option and in Class Expression editor write the comma-separated list of the individuals in curly brackets. In your example:

Vegetable equivalentTo {carrot,corn}
Dmitry Tsarkov
  • 768
  • 4
  • 11