Class Reference
Reference to either a model element of the same or another AAS or to an external entity.
Inheritance
Inherited Members
Namespace: AasCore.Aas3_0
Assembly: AasCore.Aas3_0.dll
Syntax
public class Reference : IReference, IClass
Remarks
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.
An external reference is a reference to an external entity.
Constraints:
- Constraint AASd-121: For Reference's the value of Type of the first key of " Keys shall be one of GloballyIdentifiables.
- Constraint AASd-122: For external references, i.e. Reference's with Type = ExternalReference, the value of Type of the first key of Keys shall be one of GenericGloballyIdentifiables.
- Constraint AASd-123: For model references, i.e. Reference's with Type = ModelReference, the value of Type of the first key of Keys shall be one of AasIdentifiables.
- Constraint AASd-124: For external references, i.e. Reference's with Type = ExternalReference, the last key of Keys shall be either one of GenericGloballyIdentifiables or one of GenericFragmentKeys.
-
Constraint AASd-125: For model references, i.e. Reference's with Type = ModelReference, 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 FragmentKeys.
Constraint AASd-125 ensures that the shortest path is used.
- Constraint AASd-126: For model references, i.e. Reference's with Type = ModelReference, with more than one key in Keys the value of 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 Type = ModelReference, with more than one key in Keys a key with Type FragmentReference shall be preceded by a key with Type File or 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 Type = ModelReference, the Value of a Key preceded by a Key with Type = SubmodelElementList is an integer number denoting the position in the array of the submodel element list.
Constructors
| Improve this Doc View SourceReference(ReferenceTypes, List<IKey>, IReference)
Declaration
public Reference(ReferenceTypes type, List<IKey> keys, IReference referredSemanticId = null)
Parameters
Type | Name | Description |
---|---|---|
ReferenceTypes | type | |
System.Collections.Generic.List<IKey> | keys | |
IReference | referredSemanticId |
Properties
| Improve this Doc View SourceKeys
Unique references in their name space.
Declaration
public List<IKey> Keys { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<IKey> |
ReferredSemanticId
SemanticId of the referenced model element (Type = ModelReference).
Declaration
public IReference ReferredSemanticId { get; set; }
Property Value
Type | Description |
---|---|
IReference |
Remarks
For external references there typically is no semantic ID.
It is recommended to use a external reference.
Type
Type of the reference.
Declaration
public ReferenceTypes Type { get; set; }
Property Value
Type | Description |
---|---|
ReferenceTypes |
Remarks
Denotes, whether reference is an external reference or a model reference.
Methods
| Improve this Doc View SourceAccept(Visitation.IVisitor)
Accept the visitor
to visit this instance
for double dispatch.
Declaration
public void Accept(Visitation.IVisitor visitor)
Parameters
Type | Name | Description |
---|---|---|
Visitation.IVisitor | visitor |
Accept<TContext>(Visitation.IVisitorWithContext<TContext>, TContext)
Accept the visitor to visit this instance for double dispatch
with the context
.
Declaration
public void Accept<TContext>(Visitation.IVisitorWithContext<TContext> visitor, TContext context)
Parameters
Type | Name | Description |
---|---|---|
Visitation.IVisitorWithContext<TContext> | visitor | |
TContext | context |
Type Parameters
Name | Description |
---|---|
TContext |
Descend()
Iterate recursively over all the class instances referenced from this instance.
Declaration
public IEnumerable<IClass> Descend()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IClass> |
DescendOnce()
Iterate over all the class instances referenced from this instance without further recursion.
Declaration
public IEnumerable<IClass> DescendOnce()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IClass> |
Transform<T>(Visitation.ITransformer<T>)
Accept the transformer
to transform this instance
for double dispatch.
Declaration
public T Transform<T>(Visitation.ITransformer<T> transformer)
Parameters
Type | Name | Description |
---|---|---|
Visitation.ITransformer<T> | transformer |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Transform<TContext, T>(Visitation.ITransformerWithContext<TContext, T>, TContext)
Accept the transformer
to visit this instance
for double dispatch with the context
.
Declaration
public T Transform<TContext, T>(Visitation.ITransformerWithContext<TContext, T> transformer, TContext context)
Parameters
Type | Name | Description |
---|---|---|
Visitation.ITransformerWithContext<TContext, T> | transformer | |
TContext | context |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
TContext | |
T |