There are two types of IRIs.

  • Native element IRI:
    The IRI of an element in which its namespace is the same as the namespace of the containing ontology or «Model». For example, http://example.com/onto1/element is native to http://example.com/onto1/.

  • Foreign element IRI:
    The IRI of an element in which its namespace differs from the namespace of the containing ontology or «Model». For example, http://example.com/onto1/element is foreign to http://example.com/onto2/.


Each IRI element can have a relative or an absolute form.

  • Relative IRI:
    A shortened IRI name after a hash (#) or the last slash (/).

  • Absolute IRI:
    A full IRI, which is the namespace plus a relative IRI separated by a hash (#) or slash (/).

Class, data type, and enumeration movement and OWL import behavior

When moving elements between «Models», the IRI namespace of any given moved element will update, and the IRI tagged value will become either relative or absolute based on the namespace of the owning «Model».

Element namespace relative to old «Model» packages

Result after moving

Native

The element namespace changes to that of the new «Model» package, and IRI becomes relative.

Foreign

The original element namespace doesn’t change, and IRI remains absolute.

A relative IRI is relative to the namespace IRI of the «Model» in which it is contained. When a «Model» is exported to OWL, every relative IRI is concatenated with that namespace IRI to create an absolute IRI.

IRIs in Various Cases

  • The class and its properties must always be in the same namespace. If the class is anonymous, it is definitely in the namespace of its owning model, thus all properties that such a class owns must be in the same namespace as the owning model.
  • A class’ namespace can be different from its package’s namespace.
  • When a property and its owning class have different namespaces, the property must be owned by an association. If you change a property’s IRI to be foreign, it will be non-navigable and owned by the association.
  • Moving an association never changes the effective IRI of its owned properties.
  • When a class is foreign to its source package, it is not changed to that of its destination package. If the namespaces are the same, the IRI will become relative.
  • Updating a package IRI does not make its owning elements’ IRIs foreign.

Property movement behavior

  • When a restriction property is moved, nothing happens to the IRI.
  • When moving a property that is not a restriction property, and it either has or doesn’t have an IRI tagged value, the following conditions apply.
    • When moving the property from anything to a normal class, e.g., one that is not stereotyped as «Anything» or anonymous, the property IRI will change to the new class’ namespace.
      • When the IRI of a new owning class is in a different IRI namespace than that of its owning «Model», a warning is logged, e.g., WARN: property IRI ‘{}’ updated to that of the owning class to remain valid.  If this is not desired, please copy and paste the original IRI into the tagged IRI value: ‘{}’.
      • When the target class has no IRI, a relative IRI is used.
      • When the property’s new namespace matches the owning class’ namespace and the «Model» namespace, a relative IRI is used.
      • When the property’s new namespace does not match the owning class’ package namespace, e.g., property namespace is the same as the property’s owning class’ namespace but different from the owning «Model» namespace, an absolute IRI is used.
    • When moving the property from anything to an association, the following conditions apply.
      • When the property’s namespace matches the owning «Model» namespace, a relative IRI is used.
      • When the property’s namespace does not match the owning «Model» namespace, an absolute IRI is used.
    • When moving the property from anything to the «Anything» class or an anonymous class, the property IRI will change to the new owning class’ package namespace, and a relative IRI is used.


Elements with Blank IRIs

  • When an element that has a blank IRI tagged value is moved to another «Model», the blank IRI is removed and the user is warned.
  • When creating a new IRI tagged value, instead of setting it to blank (MagicDraw default), its value is set to a relative IRI value.
  • When updating a existing IRI tagged value, if the value is set to empty string, the tagged value will be removed.


Property OWL import behavior

  • When an element has the same namespace as its «Model», a relative IRI is used.

Other elements’ movement behavior

  • When moving the «Anything» class or anonymous class, an IRI value is not created or updated.


Anonymous Class

The anonymous class refers to both Union and the Restriction class.

Moving elements with Annotations

When moving an element between models, comments that annotate that element are moved together with the element they annotate.