Ontology

There are two key reasons you may want to define an ontology in 1Integrate:

  • To easily apply rules to a number of classes from your schema by defining a class hierarchy
  • To pre-define your target model, enabling you to easily re-use existing rules.

1Integrate uses a small subset of the concepts that can be expressed using the Web Ontology Language (OWL), represented in an .OWL file you provide. For more information about the Web Ontology Language, please refer to www.w3.org/OWL/.

The Class Hierarchy

An OWL document will allow you to define a class hierarchy, including superclasses, under which sub-classes are aggregated, thus permitting a rule to be applied across all of the classes.

The class hierarchy is assembled in the OWL file from subClassOf elements, e.g.

<owl:Class rdf:ID="A-Road">

<rdfs:subClassOf>

<owl:Class rdf:ID="Roadway"/>

</rdfs:subClassOf>

</owl:Class>

ClosedExample

You could have classes that include A-Roads, B-Roads and Motorways. You may want to apply a rule across these classes, but it would be time consuming to apply a rule on a class by class basis.

An example demonstrating the application of rules using Ontology to road features split into A-road, B-road and Motorways

A rule applied to three classes independently

In the case of this example, defining a class hierarchy would make it easier to apply a rule across A-Roads, B-Roads and Motorways:

Class Hierarchy Class name
Superclass Roadway
  Subclass
A-Road
  Subclass
B-Road
  Subclass
Motorway

A Class Hierarchy such as this would allow you to consolidate your rules once attributes have been defined (Attributes are covered in the next section).

A rule applied to the Roadway superclass which contains a-roads, b-roads and motorways.

The rule applied to a Roadway superclass under which Motorway, B-Road and A-Road are aggregated

By defining the superclass you can begin to apply rules across the sub-classes once attributes have also been defined.

Attributes

For attributes in ontology classes to appear in the drop down menus after a schema has been selected for context, they must be defined in the OWL file you provide, referencing a selected class or one of its superclasses. This will enable you to run rules against them with your defined ontology.

Note: A class inherits attributes from its superclasses. For further information, please refer to the Example below.

Attributes are specified from DatatypeProperty elements in the OWL file, e.g.

<owl:DatatypeProperty rdf:ID="Length">

<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#float"/>

<rdfs:domain rdf:resource="#Roadway"/>

</owl:DatatypeProperty>

  • rdf:ID specifies the attribute name.
  • rdfs:range specifies the attribute type using an XML Schema type. For supported types see the OWL Attribute Types
  • rdfs:domain specifies the class within which the attribute is defined.

ClosedOWL Attribute Types

ClosedExample

Class Hierarchy Class name Defined Class Attributes Available Class Attributes
Superclass Roadway Length Length
  Subclass
A-Road Number_of_Lanes Length, Number_of_Lanes
    Subclass
Country_Lane Road_name Length, Number_of_Lanes, Road_name
  • A rule authored against Roadway will run on all Roadways, A-Roads and Country_Lane but only Length will appear in the attribute menu.
  • A rule authored against A-Road will run on all A-Roads and Country_Lane; Length and Number_of_Lanes will appear in the attribute menu.
  • A rule authored against Country_Lane will run only on Country_Lane (assuming it has no further sub-classes) and all three attributes will appear in the menu.

Note: If you are accessing a feature primarily by an attribute defined on a parent class in the ontology then, for performance reasons, ensure that the child classes all have indexes set on that attribute. If fewer than half of the child classes have that attribute indexed then the attribute index won't be used at all.

Uploading and Mapping an Ontology

You must upload your OWL file and select the ontology mapping before rule writing.

ClosedHow to upload OWL files and map to Ontology

  1. The Map to ontology option is selected in the Input Mapping tab within the Data Stores window of the 1Integrate UI.

    An image showing the location of the ontology in the top right of the input connection tab.

    The Input Mapping tab, with Map to Ontology highlighted by a red box.

  2. If no ontology has previously been selected, then after the Map to ontology option is ticked the Select ontology... dialogue box will be displayed. It is also displayed when the icon is clicked.

    The dialogue box to upload an ontology to by selecting one from your file system.

    The Select ontology... dialogue box

  3. The default option is to choose a file on your local file system. The file will be uploaded and parsed to extract the class and attribute information by 1Integrate.

    Alternatively, the drop down menu can be changed from Upload File to Address (URL). A free form text field is used to enter the URL from which the ontology should be read. By selecting one of these options, the ontology will be saved with the data store.

    Note: If the ontology uploaded is not an OWL document, an error will be displayed in the Error tab. If the document is an OWL document with a syntax error, an error may be displayed.

  4. Once an ontology has been selected, you must select target mappings from the schema, defined in the ontology. It will no longer be possible to type class or attribute names or to change the type of target attributes.

    Clicking on a target class displays a class selection tool tip, initially showing only top-level classes from the ontology: 

    The top level classes Area and Line within a hierarchy.

    The class selection tool tip

  5. Clicking on the + icon to the left of the class will expand to show the immediate sub-classes, or if the node has previously been expanded, it shows the tree at the time it was collapsed. Holding down Shift whilst clicking expands all sub-classes recursively to the bottom of the class hierarchy.

    An expanded class hierarchy with Lake under Are and Rivers and Roads under Line.

    Example showing all subclasses

  6. After an ontology class has been selected, the target attribute mappings can be selected from a dropdown menu. For information about attributes, see the Attributes section. The type of the matched attribute is always the type defined in the ontology, mapped onto the appropriate 1Integrate type.

    A screengrab showing the input mapping window as a user selects a taget class.

    Selecting target attributes

    Note: Attributes that have not yet been mapped to an ontology attribute will display a warning yellow triangle on the mapping arrow . It is recommended that all classes and attributes are mapped, but it is still possible to use the data store in a session if some classes and/or attributes are not yet mapped. Unmapped attributes will use the same name and an equivalent type as the source attribute.

  7. When the mappings have been created, rules and actions can be written to apply to super classes in the ontology. These rules/actions will be applied to all sub-classes of the selected class.