Ontology

Ontology is one of the Fixed Schema options available in 1Integrate and there are two key reasons you may want to define one:

  • To easily apply Rules to a number of classes from your data 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 file 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 after a class 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 Ontology Fixed Schema option is available when configuring a Read and Commit Data Store.

  2. Choose a file from your local file system. The file will be uploaded and parsed to extract the class and attribute information by 1Integrate.

         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.

  3. 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.

  4. After an ontology class has been selected, the target attribute mappings can be chosen. 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.

         Note: Attributes that have not yet been mapped to an ontology attribute will display a warning. 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.

  5. When the mappings have been created, Rules and Actions can be written to apply to superclasses in the ontology. These Rules/Actions will be applied to all sub-classes of the selected class.