![]() |
| Previous Top Next |
Defining Properties |
Properties are created at a global level and then related to different classes. In our ontology, we require two properties:
| • | hasEdition to carry information about the edition of a product. The edition can be Enterprise, Professional, or Home. We will create this property as an object property. Doing this enables us to relate one resource to another. In this case we wish to relate instances of the XMLSpy class to instances of the Edition class via the hasEdition property. The class (or classes) that the property applies to is called the property's domain, while the set of values the property can take is called the property's range. |
| • | version, which is a literal value indicating the year in which a product is released. We will create this property as a datatype property. It relates instances of the XMLSpy class to a positive integer (which is the year of release and gives the version of the product). |
Creating properties
Properties are created in the same way that classes are created, by clicking the Add New button and then specifying the name of the property to be created. To create a property, do the following:
| 1. | In the Properties tab of RDF/OWL View, click the Add New button, and select owl:ObjectProperty. |

| 2. | This creates a line for the newly created object property. In this line, enter prod:hasEdition as the name of the new object property. |
| 3. | Now add a datatype property by: (i) clicking the Add New button and selecting owl:DatatypeProperty, and (ii) entering prod:version as the name of the datatype property. |
You have now created two properties: (i) an object property called hasEdition, and (ii) a datatype property called version. The Properties tab should now look like this:

You are now ready to define the properties in Detail View.
Defining properties
The first thing you should note when working with OWL properties in SemanticWorks is that object properties and datatype properties are indicated with slightly different symbols in Detail View. Double-click the Detail View icon
to see the Detail View symbol for each property:
| |
Object properties are indicated with an O icon in the top-left corner, datatype properties are indicated with a DT icon. The icons to the right of these two icons are actually toggle switches for specifying the cardinality constraints and characteristics of properties. They are toggles for, from left to right, setting the property to be a functional property; an inverse-functional property; a transitive property; and a symmetric property. Note that a datatype property is only allowed the functional property relationship.
Defining an object property
You will now define the relationships and characteristics of the two properties you have created. Do this as follows:
| 1. | Double-click the Detail View icon |
| 2. | Right-click the prod:hasEdition box, and, from the context menu that appears, select Add Domain (screenshot below). |

The Domain connector box is inserted.
| 3. | Right-click the Domain connector box, and select Add Class (screenshot below). |

A Class box is inserted.
| 4. | Click the down arrow in the Class box, to drop down a list of available classes, and select prod:XMLSpy (screenshot below). |

The class prod:XMLSpy is set as the domain of the property prod:hasEdition. This relationship states that the hasEdition property is applicable to the class XMLSpy.
| 5. | In the same way that you set the domain of the property, now set the range of the property: (i) right-click the hasEdition property box; (ii) select Add Range; (iii) right-click the Range connector box; (iv) select Add Class; (v) from the dropdown list in the Class box, select the class prod:Edition. The Detail View of the hasEdition property should look like this: |

The range of the property is now set to be instances of the class Edition.
Defining the cardinality constraint of a property
We wish to specify that the property hasEdition can take only one instance of the Edition class as its value. This is done by specifying that the hasEdition property is functional. To make the property functional, click the f icon (functional property icon) in the hasEdition property box. The Detail View of the hasEdition property should look like this:

Notice that the f icon in the hasEdition property box is highlighted, indicating it is toggled on.
Defining a datatype property
For the datatype property prod:version, you will define a domain similarly as defined above for the object property has:Edition. Set the domain to the class XMLSpy. For the range, we wish to define the XML Schema datatype xsd:positiveInteger. Do this as follows:
| 1. | Add the Range connector box, by right-clicking the version property box and selecting Add Range. |
| 2. | Right-click the Range connector box, and select Add XML Schema Datatype. A Datatype box is added. |
| 3. | From the dropdown list in the Datatype box, select xsd:positiveInteger (screenshot below). |

| 4. | Set the cardinality of the version property by toggling on the functional property specification. |
The version property is now a functional property. It is applicable to instance of the class XMLSpy (its domain) and can take values that are of the XML Schema datatype xsd:positiveInteger (its range). The Detail View of the version property should look like this:

Domain listing in Properties Overview
When you switch to the Properties Overview (that is, the Properties tab in the Ontology Overview), notice that the domains of the selected property are displayed in the subsidiary window (screenshot below).

Click the Detail View button of a domain class to go directly to the Detail View of that class.
Class properties in Classes Overview
You can see the properties of a selected class in the subsidiary Class Properties window of the Classes Overview (Classes tab in the Ontology Overview). See screenshot below.

Click the Detail View button of a property to go directly to the Detail View of that property.
Checking the syntax and semantics of the ontology
At this stage, check the syntax (RDF/OWL | Syntax Check) and the semantics (RDF/OWL | Semantics Check) of your ontology, making sure that the OWL Lite level is selected. Your OWL Lite ontology till this point should be both well-formed and at least partially consistent.
Checking the relationships between properties and classes
Both properties (hasEdition and version) were set to have the class XMLSpy as its domain, meaning that both properties are applicable to the XMLSpy class. Now check the effect of these definitions on the XMLSpy class. Do this as follows:
| 1. | Go to the Document Overview (by clicking the Overview icon |
| 2. | Select the Classes tab. |
| 3. | Go to the Detail View of the class XMLSpy (by clicking the Detail View icon next to the class entry). The Detail View of the XMLSpy class should look something like this: |

Here we see that the class XMLSpy is a subclass of the class Product, and has two properties: the object property hasEdition and the datatype property version.
|