Class Dtmi
Digital Twin Modeling Identifier.
Inherited Members
Namespace: DTDLParser
Assembly: DTDLParser.dll
Syntax
public class Dtmi : Uri, ISpanFormattable, IFormattable, ISerializable, IComparable<Dtmi>
Constructors
| Edit this page View SourceDtmi(string, bool)
Initializes a new instance of the Dtmi class from a string.
Declaration
public Dtmi(string value, bool skipValidation = false)
Parameters
Type | Name | Description |
---|---|---|
string | value | String value of the DTMI. |
bool | skipValidation | Skips the validation check. |
Dtmi(Uri, bool)
Initializes a new instance of the Dtmi class from a Uri instance.
Declaration
public Dtmi(Uri uri, bool skipValidation = false)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | The URI to copy from. |
bool | skipValidation | Skips the validation check. |
Properties
| Edit this page View SourceCompleteVersion
Gets the major and minor version of the DTMI as a double. The major version is in the integral portion and the minor version is in the fractional portion. The minor version is left-zero-padded so that sort order is maintained. Ex: version 2.22 is returned as 2.000022.
Declaration
public double CompleteVersion { get; }
Property Value
Type | Description |
---|---|
double |
Fragmentless
Gets the identifier with any fragment removed.
Declaration
public Dtmi Fragmentless { get; }
Property Value
Type | Description |
---|---|
Dtmi |
IsReserved
Gets a value indicating whether the DTMI is reserved for auto-generation.
Declaration
public bool IsReserved { get; }
Property Value
Type | Description |
---|---|
bool |
Labels
Gets the sequence of labels in the path portion of the DTMI.
Declaration
public string[] Labels { get; }
Property Value
Type | Description |
---|---|
string[] |
MajorVersion
Gets the major version of the DTMI as an integer.
Declaration
public int MajorVersion { get; }
Property Value
Type | Description |
---|---|
int |
MinorVersion
Gets the minor version of the DTMI as an integer.
Declaration
public int MinorVersion { get; }
Property Value
Type | Description |
---|---|
int |
Tail
Gets the name of the identifier's tail, which is the empty string if there is no fragment.
Declaration
public string Tail { get; }
Property Value
Type | Description |
---|---|
string |
Remarks
The tail is the same as the fragment without the leading #. The case of no fragment and the case of an empty fragment both yield an empty string for the tail.
Versionless
Gets the portion of the DTMI that preceeds the version number.
Declaration
public string Versionless { get; }
Property Value
Type | Description |
---|---|
string |
Methods
| Edit this page View SourceCompareTo(Dtmi)
Compares the current instance with another Dtmi
and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Declaration
public int CompareTo(Dtmi other)
Parameters
Type | Name | Description |
---|---|---|
Dtmi | other | The |
Returns
Type | Description |
---|---|
int | Negative if this instance precedes |
TryCreateDtmi(string, out Dtmi)
Try to create a new instance of the Dtmi class from a string.
Declaration
public static bool TryCreateDtmi(string value, out Dtmi dtmi)
Parameters
Type | Name | Description |
---|---|---|
string | value | String value of the DTMI. |
Dtmi | dtmi | Out parameter to receive the newly created Dtmi. |
Returns
Type | Description |
---|---|
bool | True if the string represents a valid DTMI; false if it does not. |