6) Working with Protege

    If you are not acquainted with Protege, this tutorial will provide you with all the knowledge that you need to use the DAML+OIL Plug-in, however more information is available at the Protege site.  See Section 7 for information on current restrictions.

The Protege GUI utilizes the following buttons. 

Their meanings are as follows:

    Classes

        New Class

            New classes in DAML+OIL should be subclasses of daml_oil:Thing, since everything is a "Thing" in DAML+OIL.  Follow the instructions for subclassing below, and subclass off of daml_oil:Thing to create all of your basic classes.

        Subclasses

    Multiple inheritance

    Properties (Slots)

           DAML+OIL Properties are mapped to Slots in Protege.  This tutorial will use Property to refer to the daml_oil:Property and Slot to refer to the Protege representation.

        New Properties

        Range

In order to specify a specific range for the property follow the steps below.

        Domain

        Subproperties

        Object & Datatype Properties

Properties that have been created using the steps described under New Properties, will be serialized into daml_oil:Property.

        Additional Property information

Important things to remember:

    Instances(NEW)

To create view or edit instance click on the Instances tab

First select the class of which you would like to create an instance

Then click the button above the Direct Instances field.

You now have an instance of a class.

You should rename it, since any instance that begins with "KB_" will not get an rdf:ID upon serialization.  If you do not rename it, you may lose your work upon serialization.  Rename your instance by editing the ":NAME" field.

You can add values to the slots of an instance by clicking on the create , or add buttons on the respective field.  (Note:  If your property is not showing up in your instance, then you have not specified its domain properly.  Remember properties with no specified domain should be added to the daml_oil:Thing as mentioned above.)  When you press you are creating a new instance of the type that is specified by the range of the property.  When you press you are adding an existing instance of that type.

        Important notes regarding XML

    When you create instances of XML types, they are actual instances of that type.  For example, the property MyPropertyB has the range XMLSchema:integer.  Supposing that I want to add the value 42 to my instance.  I press the button (unless I alredy have an instance of 42) and select the correct type.

    Then I enter the value that I desire into the :NAME slot of the new instance that appears on the screen.

    Now the value will appear in the field for the property.

    If I had already created the XMLSchema:integer value of 42 previous to this time, I would not be able to create another instance of it (There is only one 42 in the universe and for everything that has the value 42, it is the same 42).

    Instead I would add the value to my property field using the button.

    It will be a Direct Instance of XMLSchema:integer, so I can select it from this dialog.

    IMPORTANT:  Do not edit the value of the instance of an XML datatype!

    Do not view and change the value of 42.  These slots are filled with references to instances.  Since this is a reference to the actual instance of 42, changing its value has the same effect as changing the value of 42 everywhere in the ontology.  If one were to view and change 42, to 43, the value of 42 is actually changed to 43, and all references to 42 will continue to point to the same instance which now has the value of 43. 

    Instead of doing that, remove the value from the property using the button, and create a NEW instance of an integer to take it's place.  Removing the instance does not delete it.  It only removes it from the slot.  It can still be referenced elsewhere in the ontology, and those slots will remain unchanged.

 

    Restrictions

Restrictions are created from the Classes tab.  In the DAML+OIL plug-in there is a field in each class for Restrictions.  In that field you can specify a Restriction, and on serialization the Class will be a subclass of all the Restrictions listed there.

        Qualified Restrictions

    Boolean Combinations (Logical Definitions)

The boolean combinations unionOf, intersectionOf, and complementOf, and further class elements such as disjointUnionOf, oneOf, and disjointWith, can be added to a class from the Logical Definition field in a similar manner to the way Restrictions worked.

    Miscellaneous

As you have probably guessed SameClassAs and EquivalentTo map to their respective DAML+OIL tags.  You can add or create classes for those slots using the buttons above the fields.

The daml:Ontology can be accessed from the Ontology Class under the Classes tab

 

Back

Home

Next