Reference🔗
A reference is an ordered list of keys.
A model reference is an ordered list of keys, each key referencing an element. The complete list of keys may for example be concatenated to a path that then gives unique access to an element.
A global reference is a reference to an external entity.
- Constraint AASd-121🔗
- For Reference's the Key.type of the first key of Reference.keys shall be one of GloballyIdentifiables.
- Constraint AASd-122🔗
- For global references, i.e. Reference's with Reference.type = ReferenceTypes.GlobalReference, the type of the first key of Reference.keys shall be one of GenericGloballyIdentifiables.
- Constraint AASd-123🔗
- For model references, i.e. Reference's with Reference.type = ReferenceTypes.ModelReference, the type of the first key of Reference.keys shall be one of AasIdentifiables.
- Constraint AASd-124🔗
- For global references, i.e. Reference's with Reference.type = ReferenceTypes.GlobalReference, the last key of Reference.keys shall be either one of GenericGloballyIdentifiables or one of GenericFragmentKeys.
- Constraint AASd-125🔗
-
For model references, i.e. Reference's with Reference.type = ReferenceTypes.ModelReference, with more than one key in Reference.keys the type of the keys following the first key of Reference.keys shall be one of FragmentKeys.
AASd-125 ensures that the shortest path is used. - Constraint AASd-126🔗
- For model references, i.e. Reference's with Reference.type = ReferenceTypes.ModelReference, with more than one key in Reference.keys the type of the last key in the reference key chain may be one of GenericFragmentKeys or no key at all shall have a value out of GenericFragmentKeys.
- Constraint AASd-127🔗
-
For model references, i.e. Reference's with Reference.type = ReferenceTypes.ModelReference, with more than one key in Reference.keys a key with Key.type KeyTypes.FragmentReference shall be preceded by a key with Key.type KeyTypes.File or KeyTypes.Blob. All other AAS fragments, i.e. type values out of AasSubmodelElementsAsKeys, do not support fragments.
Which kind of fragments are supported depends on the content type and the specification of allowed fragment identifiers for the corresponding resource being referenced via the reference. - Constraint AASd-128🔗
- For model references, i.e. Reference's with Reference.type = ReferenceTypes.ModelReference, the Key.value of a Key preceded by a Key with Key.type = KeyTypes.SubmodelElementList is an integer number denoting the position in the array of the submodel element list.
Properties 🔗
- type: ReferenceTypes 🔗
-
Type of the reference.Denotes, whether reference is a global reference or a model reference.
- referredSemanticId: Optional[Reference] 🔗
-
HasSemantics.semanticId of the referenced model element (Reference.type = ReferenceTypes.ModelReference).
For global references there typically is no semantic ID.
It is recommended to use a global reference. - keys: List[Key] 🔗
-
Unique references in their name space.
Invariants 🔗
-
Keys must contain at least one item.
len(self.keys) >= 1
-
Constraint AASd-121: For References the type of the first key shall be one of Globally identifiables.
not (len(self.keys) >= 1) or (self.keys[0].type in GloballyIdentifiables)
-
Constraint AASd-122: For global references the type of the first key shall be one of Generic globally identifiables.
not ( ( self.type == ReferenceTypes.GlobalReference and len(self.keys) >= 1 ) ) or (self.keys[0].type in GenericGloballyIdentifiables)
-
Constraint AASd-123: For model references the type of the first key shall be one of AAS identifiables
not ( ( self.type == ReferenceTypes.ModelReference and len(self.keys) >= 1 ) ) or (self.keys[0].type in AasIdentifiables)
-
Constraint AASd-124: For global references the last key shall be either one of Generic globally identifiables or one of Generic fragment keys.
not ( ( self.type == ReferenceTypes.GlobalReference and len(self.keys) >= 1 ) ) or ( ( (self.keys[-1].type in GenericGloballyIdentifiables) or (self.keys[-1].type in GenericFragmentKeys) ) )
-
Constraint AASd-125: For model references with more than one key, the type of the keys following the first key shall be one of Fragment keys.
not ( ( self.type == ReferenceTypes.ModelReference and len(self.keys) > 1 ) ) or ( all( self.keys[i].type in FragmentKeys for i in range( 1, len(self.keys) ) ) )
-
Constraint AASd-126: For model references with more than one key, the type of the last key in the reference key chain may be one of Generic fragment keys or no key at all shall have a value out of Generic fragment keys.
not ( ( self.type == ReferenceTypes.ModelReference and len(self.keys) > 1 ) ) or ( all( not (self.keys[i].type in GenericFragmentKeys) for i in range( 0, len(self.keys) - 1 ) ) )
-
Constraint AASd-127: For model references with more than one key, a key with type Fragment reference shall be preceded by a key with type File or Blob.
-
Constraint AASd-128: For model references, the value of a key preceded by a key with type Submodel element list is an integer number denoting the position in the array of the submodel element list.
not ( ( self.type == ReferenceTypes.ModelReference and len(self.keys) > 2 ) ) or ( all( not (self.keys[i].type == KeyTypes.SubmodelElementList) or MatchesXsPositiveInteger( self.keys[i + 1].value ) for i in range( 0, len(self.keys) - 1 ) ) )