Reference🔗
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 gives unique access to an element.
An external reference is a reference to an external entity.
- Constraint AASd-121🔗
- For Reference's the value of Key.type of the first key of " Reference.keys shall be one of GloballyIdentifiables.
- Constraint AASd-122🔗
- For external references, i.e. Reference's with Reference.type = ReferenceTypes.ExternalReference, the value of Key.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 value of Key.type of the first key of Reference.keys shall be one of AasIdentifiables.
- Constraint AASd-124🔗
- For external references, i.e. Reference's with Reference.type = ReferenceTypes.ExternalReference, the last key of Reference.keys shall be either one of GenericGloballyIdentifiables or one of GenericFragmentKeys.
- Constraint AASd-137🔗
- For external references, i.e. Reference's with Reference.type = ReferenceTypes.ExternalReference, the value of Key.type of any key in Reference.keys shall not be one of AasReferables.
- Constraint AASd-125🔗
-
For model references, i.e. Reference's with Reference.type = ReferenceTypes.ModelReference, with more than one key in Reference.keys the value of Key.type of each 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 value of Key.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. Key.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 the reference is an external reference or a model reference.
- referredSemanticId: Optional[Reference] 🔗
-
Expected HasSemantics.semanticId of the referenced model element (Reference.type = ReferenceTypes.ModelReference); there typically is no semantic ID for the referenced object of external references (Reference.type = ReferenceTypes.ExternalReference).If Reference.referredSemanticId is defined, the HasSemantics.semanticId of the model element referenced should have a matching semantic ID. If this is not the case, a validator should raise a warning.
- 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 value of type of the first key of keys shall be one of Globally Identifiables.
not (len(self.keys) >= 1) or (self.keys[0].type in GloballyIdentifiables)
-
Constraint AASd-122: For external references the value of type of the first key of keys shall be one of Generic Globally Identifiables.
not ( ( self.type == ReferenceTypes.ExternalReference and len(self.keys) >= 1 ) ) or (self.keys[0].type in GenericGloballyIdentifiables)
-
Constraint AASd-123: For model references the value of type of the first key of keys 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-137: For external references, i.e. References with Reference/type = ExternalReference, the value of Key/type of any key in Reference/keys shall not be one of AAS referables.
not (self.type == ReferenceTypes.ExternalReference) or ( all( not (key.type in AasReferables) for key in self.keys ) )
-
Constraint AASd-124: For external references the last key of keys shall be either one of Generic Globally Identifiables or one of Generic Fragment Keys.
not ( ( self.type == ReferenceTypes.ExternalReference 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 in keys the value of type of each of the keys following the first key of keys 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 in keys the value of 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 in keys 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 MatchesXsNonNegativeInteger( self.keys[i + 1].value ) for i in range( 0, len(self.keys) - 1 ) ) )