www.altova.com
Previous  Top  Next

Instances as Class Enumerations


For the two classes, Languages and OutputFormats, we wish to enumerate their instances, specifically English (EN) and German (DE) for Languages, and HTML and  PDF for OutputFormats. The way to do this is to first create instances for the classes (for example, EN and DE for Languages), and then specifying, for each class, that one of a list of enumerated instances is allowed as the instance of that class.

 

 

Creating instances

Start by creating instances for the Languages class. As follows:

 

1.In the Instances Overview, click the Add New button to create an entry for the new instance. Name the instance doc:EN.
2.Repeat this step twice to create two more instances: doc:DE and doc:FR. The Instances Overview should now look like this:

 

ss_tut_odl_instances_oview1

 

3.Click the Detail View button of the EN instance.
4.In the Detail View of the EN instance, expand the rdf:type predicate box, and double-click in the Resource Object box to pop up a down arrow on the right of the Resource Object box (screenshot below).

 

ss_tut_odl_en

 

5.Click the down arrow to pop up a list containing available classes (screenshot below).

 

ss_tut_odl_en_2

 

6.Select doc:Languages. This creates EN as an instance of the class Languages.

 

ss_tut_odl_en_3

 

7.Define DE and FR as instances of the class Languages in exactly the same way you made EN an instance of Languages.

 

When you are done, you will have defined EN, DE, and FR as three instances of the class Languages.

 

Note:An alternative way of creating instances of a class is to go to the Detail View of that class, then right-click the class and select Add New Instance. The new instance is created and displayed in the Instances tab of Detail View. Name the instance as required.

 

 

Making instances the enumerations of a class

Now we wish to specify that the class Languages may have either the instance EN or DE as its value, but not FR. Do this as follows:

 

1.Click the Classes tab to go to Classes Overview, and there click the Detail View button of the Languages entry.
2.In the Detail View of Languages, right-click the Languages box, and select Add oneOf (which is not an OWL Lite feature but is an OWL DL feature).
3.Right-click the oneOf connector box and select Add Instance.
4.In the newly added instance box, click the down arrow, and, from the dropdown list, select doc:EN.
5.Right-click the oneOf connector box again, add another instance, and select doc:DE.

 

The Detail View of Languages should now look like this:

 

ss_tut_odl_instances_languages

 

This indicates that the class Languages may be instantiated by one of the instances EN or DE.

 

Since doc:FR may not be an instance of of the Languages class, change its type to the general owl:Thing class (by double-clicking the Languages Resource Object box of doc:FR, and then clicking the down arrow and selecting owl:Thing from the dropdown list that appears).

 

 

Creating more enumerated classes

Now, using the same method as described above, create the instances HTML and PDF as enumerations of the class OutputFormats. Do this as follows:

 

1.Create two new instances and name them doc:HTML and doc:PDF (in Instances Overview).
2.Define doc:HTML and doc:PDF as being instances of the OutputFormats class (in the Detail View of each instance separately).
3.Define the OutputFormats class to have HTML and PDF as its enumerated instances (in the Detail View of the OutputFormats class, and by using the oneOf connector).

 

Check the semantics of the ontology to ensure partial consistency.

 


Previous  Top  Next

© 2008 Altova