Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to the namespace explanations to provided accurate namespace … #180

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/core-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,22 @@ Design artifacts are the outputs of **CIMTool**. There are many different types
- Microsoft Word documents for reference documentation

## Namespaces
In the CIM UML, each class name, such as ACLineSegment, is qualified by a namespace, such as `http://iec.ch/TC57/2007/CIM-schema-cim12#`. The combination of the namespace and class name forms a globally unique term. Having a globally unique term to identify a class is helpful for many reasons including version control, ownership, and validation of an instance against a schema.
In the CIM UML, each class name, such as ACLineSegment, is qualified by a namespace, such as `http://cim.ucaiug.io/CIM-schema-cim16#`. The combination of the namespace and class name forms a globally unique term. Having a globally unique term to identify a class is helpful for many reasons including version control, ownership, and validation of an instance against a schema.

!!! note

By convention, namespaces beginning with `http://iec.ch/TC57/` signifies that IEC [Technical Committee 57](https://www.iec.ch/dyn/www/f?p=103:7:0::::FSP_ORG_ID,FSP_LANG_ID:1273,25) is the issuing authority of whatever class representation follows. In practical applications, CIM standards published by IEC TC57 are often used alongside project and vendor-specific extensions. Each of these may have an independent author. Separate namespaces are used to prevent name conflicts between them.
By convention, namespaces most commonly signify who the issuing authority of whatever class representation follows. The CIM UML model itself is open source and is made available under the Apache 2.0 open source license. Standards Development Organizations (SDOs) such as the [International Electrotechnical Commission](https://en.wikipedia.org/wiki/International_Electrotechnical_Commission) (IEC) or the [European Network of Transmission System Operators for Electricity](https://www.entsoe.eu/) (ENTSO-E) may freely utilize the CIM under its licensing terms. The IEC, for instance, utilized the CIM as the foundation for the development of International Standards to support Transmission and Distribution operations and various backoffice functions. In practical applications, CIM standards published by the IEC are often used alongside project and vendor-specific extensions. Each of these may have an independent author. Separate namespaces are used to prevent name conflicts between them.

Namespaces don't carry much information in themselves. A namespace can be any string but it is common and recommended to use an HTTP URI (e.g. `http://authority/...`) because it translates well to conventions followed in generated schemas (e.g. XML Schema) and it identifies the issuing authority. This is the convention IEC TC57 follows. For example, someone can easily find more information on the issuing authoriy by using something like [whois](https://www.whois.com/whois).
Namespaces don't carry much information in themselves. A namespace can be any string but it is common and recommended to use an HTTP URI (e.g. `http://authority/...`) because it translates well to conventions followed in generated schemas (e.g. XML Schema) and it identifies the issuing authority. This is the convention commonly followed by many SDOs. For example, someone can easily find more information on the issuing authoriy by using something like [whois](https://www.whois.com/whois).

The namespace is also useful when generating schemas in other domains. For example, the namespace easily translates to derived XML schemas because an XML schema has a target namespace, declared in its header, that qualifies names defined in the body of the schema.

Namespaces don't garauntee inheritance. For example, `http:/x/y/` is not necessarily a superset of `http://x/y/z/`. You also can't necessarily obtain a document from a namespace via HTTP protocol either. For example, an HTTP GET request to `http://iec.ch/TC57/2007/CIM-schema-cim12#` isn't garuanteed to return anything.
Namespaces don't guarantee inheritance. For example, `http:/x/y/` is not necessarily a superset of `http://x/y/z/`. This also meant that historically you couldn't necessarily obtain a document from a namespace via HTTP protocol either. For example, an HTTP GET request to `http://cim.ucaiug.io/CIM-schema-cim16#` historically wasn't garuanteed to return anything. Note that this is changing starting with CIM18 and standards being developed starting in that version. This is being done to allow for fully machine readable processing of models.

In the end, a namespace is just an identifier with the recommendation that it be an HTTP URI allocated by the [IANA](https://www.iana.org/) and its delegates.

### Version Control and Namespaces
Namespaces prevent name conflicts between authors of classes. They are also used to prevent conflicts between different versions of a class's definition. For example, `http://iec.ch/TC57/2007/CIM-schema-cim12#ACLineSegment` might be a different ACLineSegment representation than `http://vendor/v1/CIM#ACLineSegment` or `http://iec.ch/TC57/2007/CIM-schema-cim12#ACLineSegment` might be succeeded by `http://iec.ch/TC57/2008/CIM-schema-cim13#ACLineSegment` with a slightly different ACLineSegment representation.
Namespaces prevent name conflicts between authors of classes. They are also used to prevent conflicts between different versions of a class's definition. For example, `http://cim.ucaiug.io/CIM-schema-cim17#ACLineSegment` might be a different ACLineSegment representation than `http://vendor/v1/CIM#ACLineSegment` or `http://entsoe.eu/2021/CIM-schema-cim17#ACLineSegment` and might be succeeded by `http://cim.ucaiug.io/CIM-schema-cim18#ACLineSegment` with a slightly different ACLineSegment representation as the class evolves in the model.

The multiple versions of a class might be in use within the same context (e.g. same XML document). The potential conflict of the base name (ACLineSegment in this example) can be detected because the different versions have different namespaces. Resolving a version conflict would be the resposbility of any consuming application or system component.

Expand Down
18 changes: 9 additions & 9 deletions docs/how-to/cimtool-support-for-extension-namespaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ The default namespace is used as follows:

### UML Tag: baseuri

**CIMTool** recognises a UML Tag with name ```baseuri``` which is expected to have a namespace URI as its value. The ```baseuri``` tag can be attached to any **package**, **class**, **association** or **attribute** using the UML editor.
**CIMTool** recognises a UML Tag with name `baseuri` which is expected to have a namespace URI as its value. The `baseuri` tag can be attached to any **package**, **class**, **association** or **attribute** using the UML editor.

- When attached to a class, association or attribute, ```baseuri``` specifies the namespace of the resulting OWL class or properties.
- When attached to a class, association or attribute, `baseuri` specifies the namespace of the resulting OWL class or properties.

- When attached to a package, ```baseuri``` specifies the namespace of all OWL classes and properties resulting from that package or its sub-packages recursively except where a sub-package, class, association or attribute has a ```baseuri``` tag.
- When attached to a package, `baseuri` specifies the namespace of all OWL classes and properties resulting from that package or its sub-packages recursively except where a sub-package, class, association or attribute has a `baseuri` tag.

Generally, it is sufficient to tag the top level packages in a UML model to obtain the correct namespaces throughout.

Expand All @@ -32,7 +32,7 @@ An example of a Tag on a Class:

### Annotation File

**CIMTool** can obtain namespace information from a file accompanying the XMI file, called an annotation file. There is no editor or other GUI for managing namespace information in the annotation file. It is a stopgap intended for situations where the user does not control the XMI file and that file lacks ```baseuri``` tags.
**CIMTool** can obtain namespace information from a file accompanying the XMI file, called an annotation file. There is no editor or other GUI for managing namespace information in the annotation file. It is a stopgap intended for situations where the user does not control the XMI file and that file lacks `baseuri` tags.

The annotation file should be placed in the project's Schema folder where the XMI file is located. It must have the same base name as the XMI file and extension .annotation instead of .xmi.

Expand All @@ -42,22 +42,22 @@ An example file that can be used as a template can be found here:

[example.annotation.txt](example.annotation.txt)

The file contains ```baseuri``` statements in the RDF TURTLE language. For example, the line:
The file contains `baseuri` statements in the RDF TURTLE language. For example, the line:

```
package:Extensions uml:baseuri "http://www.ucaiug.org/CIM100/2024/extension#"
```

Has the same effect as attaching a ```baseuri``` tag to the Extensions package with the given URI as its value.
Has the same effect as attaching a `baseuri` tag to the Extensions package with the given URI as its value.


!!! note

The ```baseuri``` statements are merged with any ```baseuri``` tags in the xmi file.
The `baseuri` statements are merged with any `baseuri` tags in the xmi file.

The effect of assigning two different ```baseuri``` values to the same package is undefined.
The effect of assigning two different `baseuri` values to the same package is undefined.

Only packages can be given ```baseuri``` values via the annotation file.
Only packages can be given `baseuri` values via the annotation file.



Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/example.annotation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Note the underscore (_) after the #Package portion of the prefix...
#
@prefix uml: <http://langdale.com.au/2005/UML#> .
@prefix package: <http://iec.ch/TC57/CIM100#Package_> .
@prefix package: <http://cim.ucaiug.io/2020/CIM100#Package_> .

#
# Each line below is read:
Expand Down
4 changes: 2 additions & 2 deletions docs/how-to/namespaces-in-cimtool.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ See also: [CIMTool Support for Extension Namespaces](cimtool-support-for-extensi

## Background

In CIM/XML, each name, such as ACLineSegment, is qualified by a namespace, such as http://iec.ch/TC57/2013/CIM-schema-cim16#. The combination forms a globally unique term. By convention, only the IEC TC57 would define a term beginning with http://iec.ch/TC57/....
In CIM/XML, each name, such as ACLineSegment, is qualified by a namespace, such as `http://cim.ucaiug.io/CIM-schema-cim16#`. The combination forms a globally unique term. By convention, only the authority designated by the namespace URI would define a term beginning with `http://cim.ucaiug.io/CIM-schema-cim16#...`

The same applies in XML schema's derived from the CIM. An XML schema has a target namespace, declared in its header, that qualifies names defined in the body of the schema.

In practical applications of the CIM it is combined with project and vendor-specific extensions. Each of these may have an independent author. Separate namespaces are used to prevent name conflicts between them.

### Version Control and Namespaces

Namespaces prevent name conflicts between authors of terms. They are also used to prevent conflicts between different versions of a term's definition. For example, http://iec.ch/TC57/2013/CIM-schema-cim16#ACLineSegment might be succeeded by http://iec.ch/TC57/CIM100#ACLineSegment with a slightly different definition.
Namespaces prevent name conflicts between authors of terms. They are also used to prevent conflicts between different versions of a term's definition. For example, `http://cim.ucaiug.io/CIM-schema-cim17##ACLineSegment` might be succeeded by `http://cim.ucaiug.io/CIM-schema-cim18##ACLineSegment` with a slightly different definition.

Both versions of the term might be in use at the same time. The potential conflict can be detected because the different versions have different namespaces. Resolving a version conflict is another matter, however.

Expand Down
Loading