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>
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.
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 |
||
|
A-Road |
||
|
B-Road |
||
|
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).
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.
OWL Attribute Type |
1Integrate Attribute Type |
---|---|
Integer Types |
|
"int" |
INTEGER |
"positiveInteger" |
INTEGER |
"negativeInteger" |
INTEGER |
"nonPositiveInteger" |
INTEGER |
"nonNegativeInteger" |
INTEGER |
"long" |
INTEGER64 |
"integer" |
INTEGER |
"short" |
INTEGER |
"byte" |
INTEGER |
"unsignedLong" |
INTEGER64 |
"unsignedInt" |
INTEGER |
"unsignedShort" |
INTEGER |
"unsignedByte" |
INTEGER |
Boolean Types |
|
"boolean" |
BOOLEAN |
String Types |
|
"string" |
STRING |
"anyURL" |
STRING |
"duration" |
STRING |
"gDay" |
STRING |
"gMonth" |
STRING |
"gMonthDay" |
STRING |
"gYear" |
STRING |
"gYearMonth" |
STRING |
"time" |
STRING |
"normalizedString" |
STRING |
"token" |
STRING |
"language" |
STRING |
"Name" |
STRING |
"NCName" |
STRING |
"NMToken" |
STRING |
"ID" |
STRING |
"IDREF" |
STRING |
"Entity" |
STRING |
"XMLLiteral" |
STRING |
Real Types |
|
"float" |
REAL |
"decimal" |
REAL |
"double" |
REAL |
Timestamp Types |
|
"date" |
TIMESTAMP |
"dateTime" |
TIMESTAMP |
Class Hierarchy |
Class name |
Defined Class Attributes |
Available Class Attributes |
|||
---|---|---|---|---|---|---|
Superclass |
|
|
|
|||
|
|
|
|
|||
|
|
|
|
-
A Rule authored against
Roadway
will run on allRoadways
,A-Roads
andCountry_Lane
but onlyLength
will appear in the attribute menu. -
A Rule authored against
A-Road
will run on allA-Roads
andCountry_Lane
;Length
andNumber_of_Lanes
will appear in the attribute menu. -
A Rule authored against
Country_Lane
will run only onCountry_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.
How to upload OWL files and map to Ontology
The Ontology Fixed Schema option is available when configuring a Read and Commit Data Store.
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.
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.
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.
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.