1. Overview
(NOTE: The target behavior documented on this page has been available up until and including to ShapeChange version 2.1.0)
ISO/DIS 19150-2 defines rules for mapping ISO geographic information UML models to OWL ontologies. This target derives an ontology representation from an application schema in UML based upon these rules, with a number of changes.
When this target was implemented, the ISO standard was a Draft International Standard (DIS). A number of comments still had to be resolved. The final standard differs from the DIS version (for details, see Annex A of the OGC Testbed 12 ShapeChange Engineering Report, OGC 16-020). As a result, this target is considered a draft. An updated version is available since ShapeChange v2.2.0. Its implementation is different to what is described on this page and not backwards compatible. It is documented here.
1.1. Summary of the changes and extensions to ISO/DIS 19150-2 supported by this target
The table below provides a summary how additional conversion rules differ from the standard rules specified in ISO/DIS 19150-2.
Sub-clause of ISO/DIS 19150-2 | Changes, extensions, limitations | Remarks |
---|---|---|
6.2.2 Ontology Name |
change and extensions |
|
6.2.3 RDF namespace |
- |
|
6.2.4 Class name |
- |
|
6.2.5 Datatype name |
- |
|
6.2.6 Property name |
change |
|
6.2.7 Names for codelists |
extension |
|
6.3 Package |
changes |
|
6.4 Class |
changes and extension |
|
6.5 Abstract class |
- |
|
6.6 Class stereotype |
change |
|
6.7 Attribute |
changes, extensions and a limitations |
|
6.8.1 Enumeration |
changes, extensions |
|
6.8.2 Codelist |
changes, extensions |
|
6.9 Union |
limitation |
|
6.10 Multiplicity |
extensions |
|
6.11.1 Generalization |
- |
|
6.11.2 Association |
changes, extensions and a limitations |
|
6.11.3 Aggregation |
- |
|
6.12 Constraint |
extension |
|
6.13 Tagged value |
change |
|
7.2 Rules for identification |
- |
|
7.3 Rules for documentation |
changes, extensions |
|
7.4 Rules for integration |
- |
|
7.5 GF_FeatureType |
changes, extensions |
|
2. Configuration
2.1. Class
The class for the Target implementation is de.interactive_instruments.ShapeChange.Target.Ontology.OWLISO19150.
2.2. Parameters
The <targetParameters> recognized for this target include the following:
Parameter Name | Required / Optional | Type | Default Value | Explanation |
---|---|---|---|---|
outputDirectory |
Optional |
String |
<the current run directory> |
The path to which the ontology file(s) will be written. |
defaultEncodingRule |
Optional |
String |
iso19150_2014 |
The identifier of the default encoding rule governing the conversion into the ontology representation. This default value may be overridden by tagged values set on individual modeling elements. |
globalProperties |
Optional |
Comma separated list of strings |
- |
List of property names. If the name of a model property equals one of the names in this list, the according property is represented in the ontology as a global one. No domain information is declared for a global property. If the list contains the value '*', then all properties will be represented as global properties. |
language |
Optional |
String |
en |
The language code to be used for generating the ontology representation. |
ontologyName_TaggedValue_Name |
Optional |
String |
- (see explanation) |
Name of the tagged value which, if present on a package, defines the ontologyName (see 19150-2owl:ontologyName) of the package.The ontologyName is defined via the following rules, in descending priority:
|
source |
Optional |
String |
FIXME |
Parameter relevant to identify the value for the dc:source that qualifies an ontology element. That value is computed according to the following instructions, in descending order:
|
sourceTaggedValueName |
Optional |
String |
- |
Name of the tagged value relevant to identify the value for the dc:source that qualifies an ontology element. That value is computed according to the following instructions, in descending order:
|
URIbase |
Optional |
URI |
- |
Defines the global URIbase for construction of the ontologyName (see 19150-2owl:ontologyName).The ontologyName is defined via the following rules, in descending priority:
|
2.3. Encoding Rules
An <EncodingRule> element defines an encoding rule.
Example:
1
2
3
4
5
6
7
8
9
10
11
12
13
<EncodingRule extends="iso19150_2014" name="myencodingrule">
<rule name="rule-owl-all-constraints"/>
<rule name="rule-owl-cls-geosparql-features"/>
<rule name="rule-owl-cls-19150-2-features"/>
<rule name="rule-owl-prop-voidable-as-minCardinality0"/>
<rule name="rule-owl-prop-suppress-cardinality-restrictions"/>
<rule name="rule-owl-prop-suppress-allValuesFrom-restrictions"/>
<rule name="rule-owl-all-suppress-dc-source"/>
<rule name="rule-owl-pkg-singleOntologyPerSchema"/>
<rule name="rule-owl-cls-codelist-external"/>
<rule name="rule-owl-pkg-app-schema-code"/>
<rule name="rule-owl-prop-suppress-asociation-names"/>
</EncodingRule>
The name attribute of the <EncodingRule> element defines the identifier of the encoding rule to be used in the defaultEncodingRule parameter or owlEncodingRule tagged values on specific model elements.
The optional extends attribute of the <EncodingRule> element includes all rules from the referenced encoding rule in this encoding rule, too.
Each <rule> references either a conversion rule or - possibly in the future - a requirement or recommendation to be tested during the validation before the conversion process. The following rules are supported by this target:
Rule Name | Required /Optional | Explanation |
---|---|---|
rule-owl-pkg-singleOntologyPerSchema |
Optional |
If this rule is enabled, ontologies will be created for selected schema, but not for all of their child packages. |
rule-owl-pkg-pathInOntologyName |
Optional |
If this rule is enabled, ontology names will be constructed using the path of packages (usually from a leaf package to its main schema package). This rule changes ontology names only if the rule "rule-owl-pkg-singleOntologyPerSchema" is not in effect (because otherwise child packages will not be considered). |
rule-owl-all-constraints |
Optional |
If this rule is included, the target will create constraint definitions. Constraints on properties (not for union properties) and classes are supported. |
rule-owl-cls-geosparql-features |
Optional |
If this rule is included, each feature type definition gets a subClassOf declaration to the GeoSPARQL defined FeatureType class. |
rule-owl-cls-19150-2-features |
Optional |
If this rule is included, each feature type definition gets a subClassOf declaration to the ISO 19150-2 defined FeatureType class (which defines the according stereotype) as well as AnyFeature. |
rule-owl-cls-codelist-external |
Optional |
If this rule is included, code lists are not represented as part of the RDF vocabulary and where available the vocabulary or codelist tagged value is used for the rdfs:range. If not set, owl:Class is used. |
rule-owl-prop-suppress-cardinality-restrictions |
Optional |
If this rule is included, cardinality restrictions are not included in the ontology. |
rule-owl-prop-suppress-allValuesFrom-restrictions |
Optional |
If this rule is included, allValuesFrom restrictions are not included in the ontology. |
rule-owl-prop-voidable-as-minCardinality0 |
Optional |
If this rule is included, minCardinality is set to 0 for voidable properties |
rule-owl-all-suppress-dc-source |
Optional |
If this rule is included, dc:source in not included except on the ontology subject. |
rule-owl-prop-suppress-asociation-names |
Optional |
If this rule is included, association names are not included in the ontology. |
rule-owl-pkg-app-schema-code |
Optional |
NOTE: This rule only applies if rule-owl-pkg-singleOntologyPerSchema is in effect. If this rule is included, the namespace abbreviation defined for an application schema package is used for constructing the ontology name of this package as well as the filename for that ontology - instead of the package name (normalized according to 19150-2owl:ontologyName). |
2.4. Map Entries
<mapEntries> contain individual <MapEntry> elements, which represent mappings from UML types (classes) to corresponding ontology resources.
Examples:
1
2
3
4
5
6
<mapEntries>
<MapEntry type="CharacterString" rule="myencodingrule" targetType="xsd:string" param="datatype"/>
<MapEntry type="GeographicalName" rule="myencodingrule" targetType="rdfs:label" param="propertyByValueType"/>
<MapEntry type="geometry" rule="myencodingrule" targetType="geo:hasGeometry" param="property"/>
<MapEntry type="Any" rule="iso19150_2014" targetType="owl:Class" param="class"/>
</mapEntries>
A <MapEntry> element contains the following attributes:
Attribute Name | Required / Optional | Explanation |
---|---|---|
type |
Required |
In general, the UML type/class name to be mapped. For map entries with param="property", however, the value is an attribute name or a role name. |
rule |
Required |
The encoding rule to which this mapping applies. May be "*" to indicate that the mapping applies to all encoding rules. |
targetType |
Optional |
The identifier of an RDF class or property to which the type will be mapped. NOTE: The value is expected to be given as a QName, with the namespace prefix matching the namespace abbreviation of a namespace declared in the configuration (see next section). |
param |
Optional |
A parameter for the mapping. Allowed values and their interpretation are as follows:
|
The file StandardMapEntries-owl.xml defines mappings for a number of types and properties of the ISO Harmonized Model and OGC standards. It can be included in ShapeChange configuration files (via XInclude). Additional XInclude files, or individual <MapEntry> elements added to the <mapEntries> section of the configuration file, may be used to customize the map entries to support additional pre-defined conceptual UML classes, encoding rules, and existing ontologies.
2.5. Namespaces
A <Namespace> element defines a namespace and its properties.
Example:
1
2
3
<namespaces>
<Namespace nsabr="geo" ns="http://www.opengis.net/ont/geosparql#" location="http://www.opengis.net/ont/geosparql"/>
</namespaces>
The attributes for <Namespace> are as follows:
Attribute Name |
Required / Optional |
Default Value |
Explanation |
ns |
Required |
- |
The full namespace of an ontology. |
nsabr |
Required |
- |
The namespace abbreviation. |
location |
Optional |
- |
The location of the ontology document. |
The file StandardNamespaces-owl.xml contains a series of standard namespace definitions for the derivation of an ontology representation. This file can be included (via XInclude) in configuration files.
2.6. Stereotype Mappings
According to ISO 19150-2, the ontology representation of a class (from the application schema) with a specific stereotype shall include an rdfs:subClassOf declaration, referencing the identifier of the ontological definition of that stereotype. Therefore, the mapping between a stereotype used in the model and this identifier must be declared in the configuration.
Example:
1
2
3
<stereotypeMappings>
<StereotypeMapping wellknown="FeatureType" mapsTo="http://def.isotc211.org/iso19150-2/2012/base#FeatureType"/>
</stereotypeMappings>
The attributes for <StereotypeMapping> are as follows:
Attribute Name |
Required / Optional |
Default Value |
Explanation |
wellknown |
Required |
- |
Well-known stereotype (see here for further information). |
mapsTo |
Required |
- |
Identifier of the ontological defintion of the stereotype. |
The file StandardStereotypeMappings-owl.xml contains a series of standard stereotype mappings. This file can be included (via XInclude) in configuration files.
2.7. Sample Configuration
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<TargetOwl class="de.interactive_instruments.ShapeChange.Target.Ontology.OWLISO19150" mode="enabled">
<targetParameter name="outputDirectory" value="examples/rdf/inspire"/>
<targetParameter name="defaultEncodingRule" value="owltest"/>
<targetParameter name="URIbase" value="http://example.com/ont/inspire"/>
<targetParameter name="source"
value="INSPIRE application schemas, Revision 4618, derived according to ISO/DIS 19150-2 with several modification using ShapeChange."/>
<targetParameter name="globalProperties" value="*"/>
<rules>
<EncodingRule extends="iso19150_2014" name="owltest">
<rule name="rule-owl-all-constraints"/>
<rule name="rule-owl-cls-geosparql-features"/>
<rule name="rule-owl-cls-19150-2-features"/>
<rule name="rule-owl-prop-voidable-as-minCardinality0"/>
<rule name="rule-owl-prop-suppress-cardinality-restrictions"/>
<rule name="rule-owl-prop-suppress-allValuesFrom-restrictions"/>
<rule name="rule-owl-all-suppress-dc-source"/>
<rule name="rule-owl-pkg-singleOntologyPerSchema"/>
<rule name="rule-owl-cls-codelist-external"/>
<rule name="rule-owl-pkg-app-schema-code"/>
<rule name="rule-owl-prop-suppress-asociation-names"/>
</EncodingRule>
</rules>
<xi:include href="https://shapechange.net/resources/config/StandardStereotypeMappings-owl.xml"/>
<xi:include href="https://shapechange.net/resources/config/StandardNamespaces-owl.xml"/>
<xi:include href="https://shapechange.net/resources/config/StandardMapEntries-owl.xml"/>
<namespaces>
<Namespace location="http://example.com/ont/inspire/common"
ns="http://example.com/ont/inspire/common#" nsabr="common"/>
</namespaces>
<mapEntries>
<MapEntry param="datatype" rule="owltest" targetType="xsd:string"
type="LocalisedCharacterString"/>
<MapEntry param="datatype" rule="owltest" targetType="xsd:string" type="PT_FreeText"/>
<MapEntry param="datatype" rule="owltest" targetType="xsd:anyURI" type="URL"/>
</mapEntries>
<mapEntries>
<MapEntry param="propertyByValueType" rule="owltest" targetType="rdfs:label"
type="GeographicalName"/>
</mapEntries>
<mapEntries>
<MapEntry param="property" rule="owltest" targetType="" type="inspireId"/>
<MapEntry param="property" rule="owltest" targetType="prov:generatedAtTime"
type="beginLifespanVersion"/>
<MapEntry param="property" rule="owltest" targetType="prov:invalidatedAtTime"
type="endLifespanVersion"/>
<MapEntry param="property" rule="owltest" targetType="common:validFrom" type="validFrom"/>
<MapEntry param="property" rule="owltest" targetType="common:validTo" type="validTo"/>
<MapEntry param="property" rule="owltest" targetType="geo:hasGeometry" type="geometry"/>
<MapEntry param="property" rule="owltest" targetType="rdfs:label" type="label"/>
<MapEntry param="property" rule="owltest" targetType="rdfs:label" type="name"/>
<MapEntry param="property" rule="owltest" targetType="rdf:value" type="value"/>
</mapEntries>
</TargetOwl>