A description of CIMTool's representation of a profile in OWL.
What is a Profile
A profile is, roughly, a set of restrictions on a schema. In this discussion the schema is the IEC Common Information Model (CIM) with possible extensions. A profile is a restriction on this, intended for some application such as the Common Power System Model (CPSM).
Definitions
Formally, a schema is a set of constraints governing a set of relations. See: http://en.wikipedia.org/wiki/Relation_(mathematics) for a definition of relation.
A profile of a schema is a set of constraints on the schema relations that includes the schema constraints and additional constraints.
A model is a specific set of relations (ie data) that conforms to a schema or profile.
Under the foregoing definitions, if a model conforms to a profile it follows that it conforms to the associated schema.
The CIM in UML
The principal language used to express the CIM is the UML class diagram. The class diagram is interpreted as as follows:
- A class introduces a unary relation over individuals.
- An association introduces a binary relation over pairs of individuals.
- An attribute introduces a binary relation of pairs of individuals and values.
- A datatype introduces a, possibly infinite, set of values.
The schema constraints are then derived from the sub/super class definitions, cardinality definitions, and type and role definitions.
Note that we don't encounter ternary or higher order relations in this interpretation. By convention, no ternary associations are defined in the CIM. Similarly, the n attributes of a class are not interpreted as a n-ary relation because, in general, attributes are optional.
Profiles in OWL
The principal language to express CIM profiles is Web Ontology Language (OWL).
This is a pragmatic choice. OWL is a standard language that can directly express a variety of constraints on unary and binary relations.
In OWL, unary and binary relations are called classes and properties respectively and that terminology will be used in the remainder.
Steps In Profile Construction
All terms in OWL are designated by Uniform Resource Identifiers (URI's). The first step in applying OWL is to give each relation in the CIM its own URI.
By convention, these URI's are constructed from a version-dependent CIM namespace URI and the simple names of the respective UML classes, attributes and association roles.
The second step is to write the schema constraints as OWL axioms (or definitions). OWL provides suitable language for each type of constraint found in the CIM schema.
The third step is to add OWL definitions specific to the profile.
Generally these are separated from the schema definitions, since there will be more than one profile for a schema. However, the complete profile is formed from the combination of profile-specific and schema definitions.
Profile Structure
In principle, any OWL definitions could form a profile provided they narrow the schema. Roughly, this means profile classes and properties must be subclasses and sub-properties of schema classes and properties.
Pragmatically, we limit the profile to a specific structure. It consists of class definitions but no additional properties, such that:
- Each profile class is explicitly or implicitly a subclass of a schema class. More than one profile class may subclass the same schema class.
- The profile classes are connected to each other by OWL
subClassOf,allValuesFromandunionOfdefinitions to form a structure shown in the Profile Structure Diagram and in the following outline:
Global enumerated classeslist of individuals
Global structured classes. Subclass of:parent schema classoptional parent global structured classRestrictions on property cardinalityRestrictions on property valuesRange class, either:Unrestricted class, orDatatype, orUnion class ofGlobal enumerated classes (by reference)Local enumerated classeslist of individuals
Global structured classes (by reference)Local structured classes- has
same form as global structured class
- has
Profile Classes
Each profile class is both an RDFS Class and either an RDFS Datatype or an OWL Class. However each has a specific form of definition.
Global Classes
The global classes are the principal classes of the profile. Each global class is named by URI in the profile namespace and may be referenced elsewhere in the profile or in a model.
A global class is either:
- an enumerated class or
- a structured class
Structured Classes
A structured class is composed using OWL subClassOf from exactly one schema class, optionally one (other) global class, and a number of restrictions. The profile class is effectively the intersection of the schema class and the directly or indirectly inherited restrictions.
Enumerated Classes
An enumerated class is constructed by listing its instances using an OWL oneOf definition.
Restrictions
A restriction is an anonymous class for which some rule regarding a schema property holds. The restriction is implicitly a subclass of the the property domain, which by convention is always a specific class in the schema.
- A restriction using OWL
cardinality,maxCardinalityorminCardinalitylimits the number of values that the property can take. - A restriction using OWL
allValuesFromspecifies a range class to which the property values must belong.
Range Classes
A range class is an anonymous class introduced by each allValuesFrom restriction to define the type of a property. The range class implicitly inherits the range of the property declared in the schema. It will take one of three forms:
- A datatype, if the restricted property is defined as
DatatypePropertyin the schema, - A union class, or
- An unrestricted class
Union Classes
A union class is an anonymous class composed using OWL unionOf from one or more:
- global classes and/or
- local classes
As the union is used to define the range of a property in a particular context, its constituent classes should be subclasses of the property's range defined in the schema.
Local Classes
A local class is an anonymous class defining (part of) the range of a property. It may be an enumerated class or a structured class. (That is, a local class definition has the same form as a global class definition.)
Unrestricted Classes
An unrestricted class is an anonymous class with no further definition, other than annotations. The interpretation of an unrestricted class depends on whether open or closed world semantics are applied. (See below.)
Datatypes
A datatype is designated with RDFS Datatype and no further definition is provided within the profile. (This is an area for further development.) The schema defines the range of the associated DatatypeProperty using an XML Schema Part II Datatype.
Concrete Classes
A structured class may also be concrete. Concrete classes are identified by the annotation: hasStereotype concrete. The interpretation of a concrete class depends on whether open or closed world semantics are applied. (See below.)
Normally, any structured class that has no subclasses would be marked concrete.
Open and Closed World Interpretations
A profile may be interpreted with either open, semi-open or closed world semantics depending on the application.
Closed World Interpretation
In a closed world interpretation, each individual must be a member of a concrete class defined in the profile and each property instance must conform to a restriction defined in the profile. Other classes and properties must not appear in the model, whether or not they appear in the schema.
As a particular case, where an unrestricted class appears in the profile, the model may contain a reference to an individual but must not contain properties of that individual.
Note that this interpretation is intended for applications where the profile will be translated to artifacts such as XML schema, SQL DDL, or java interfaces.
Semi-open World Interpretation
In a semi-open world interpretation, each individual in a model must be implicitly or explicitly a member of at least one concrete class defined in the profile.
However, any property instance may appear in a model, whether or not the property appears in the profile or schema, provided the profile and schema constraints hold.
This interpretation is intended for certain RDF applications.
Open World Interpretation
In an open world interpretation, any class or property instances may appear in a model , provided the profile and schema constraints hold.
Profile Annotations
Any class in the profile except a restriction may carry annotations. The possible annotations are:
Labels
A label is defined with RDFS label annotation. It represents the conventional name for the class, which may have an unrelated URI or no URI.
The label is typically copied from the parent schema class or, in the case of a range class, from the schema property. However, it is permitted for a profile class to have a label different from its parent in the schema.
Labels may be used to identify profile classes in displays and should be used as the names of elements in artifacts generated from the profile.
Comments
A comment is defined with RDFS comment annotation. A comment may describe:
- the role of the class in the specific application concerned
- additional restrictions on the class that cannot be expressed in OWL
A comment in the profile need not duplicate the original comment on the parent schema class or property.
Localisation
Labels and comments may carry a language tag that allows alternative translations to appear in the profile.
Stereotypes
A stereotype is defined with a UML hasStereotype annotation. Stereotypes are intended as an extensible mechanism for influencing the form or semantics artifacts generated from the profile. The interpretation of stereotypes other concrete is not standardised.