Class DTEntityInfo
Class DTEntityInfo
corresponds to an element of type Entity in a DTDL model.
Inheritance
Implements
Inherited Members
Namespace: DTDLParser.Models
Assembly: DTDLParser.dll
Syntax
public abstract class DTEntityInfo : IEquatable<DTEntityInfo>
Remarks
This is the base class for all classes that correspond to elements in DTDL models.
Properties
| Edit this page View SourceChildOf
Gets the identifier of the parent DTDL element in which this element is defined.
Declaration
public Dtmi ChildOf { get; }
Property Value
Type | Description |
---|---|
Dtmi | Identifier of the parent DTDL element. |
ClassId
Get the DTMI that identifies type Entity in the version of DTDL used to define this element.
Declaration
public virtual Dtmi ClassId { get; }
Property Value
Type | Description |
---|---|
Dtmi | The DTMI for the DTDL type Entity. |
Comment
Gets the value of the 'comment' property of the DTDL element that corresponds to this object.
Declaration
public string Comment { get; }
Property Value
Type | Description |
---|---|
string | The 'comment' property of the DTDL element. |
DefinedIn
Gets the identifier of the partition DTDL element in which this element is defined.
Declaration
public Dtmi DefinedIn { get; }
Property Value
Type | Description |
---|---|
Dtmi | Identifier of the partition DTDL element. |
Description
Gets the values of the 'description' property of the DTDL element that corresponds to this object.
Declaration
public IReadOnlyDictionary<string, string> Description { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<string, string> | The 'description' property of the DTDL element. |
DisplayName
Gets the values of the 'displayName' property of the DTDL element that corresponds to this object.
Declaration
public IReadOnlyDictionary<string, string> DisplayName { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<string, string> | The 'displayName' property of the DTDL element. |
EntityKind
Gets the kind of Entity, meaning the concrete DTDL type assigned to the corresponding element in the model.
Declaration
public DTEntityKind EntityKind { get; }
Property Value
Type | Description |
---|---|
DTEntityKind | The kind of Entity. |
Id
Gets the identifier of the DTDL element that corresponds to this object.
Declaration
public Dtmi Id { get; }
Property Value
Type | Description |
---|---|
Dtmi | Identifier of the DTDL element. |
LanguageMajorVersion
Gets the value of the 'languageMajorVersion' property of the DTDL element that corresponds to this object.
Declaration
public int LanguageMajorVersion { get; }
Property Value
Type | Description |
---|---|
int | The 'languageMajorVersion' property of the DTDL element. |
SupplementalProperties
Gets the supplemantal properties of the DTDL element that corresponds to this object.
Declaration
public virtual IDictionary<string, object> SupplementalProperties { get; }
Property Value
Type | Description |
---|---|
IDictionary<string, object> | A dictionary that maps each string-valued property name to an object that holds the value of the property with the given name. |
Remarks
If the property is a literal in the DTDL model, the object holds a literal value. If the property is another DTDL element in the model, the object is the C# object that corresponds to this element.
SupplementalTypes
Gets a collection of identifiers, each of which is a Dtmi
that indicates a supplemental type that applies to the DTDL element that corresponds to this object.
Declaration
public virtual IReadOnlyCollection<Dtmi> SupplementalTypes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<Dtmi> | A collection of DTMIs indicating the supplemental types that apply to the DTDL element. |
UndefinedProperties
Gets any undefined properties of the DTDL element that corresponds to this object.
Declaration
public IDictionary<string, JsonElement> UndefinedProperties { get; }
Property Value
Type | Description |
---|---|
IDictionary<string, JsonElement> | A dictionary that maps each string-valued property name to an object that holds the value of the property with the given name. |
Remarks
An undefined property is any JSON-LD term used as a property name that is not defined in the DTDL language and not defined by any DTDL extension included via the "@context" property.
UndefinedTypes
Gets a collection of strings, each of which is an undefined type that applies to the DTDL element that corresponds to this object.
Declaration
public IReadOnlyCollection<string> UndefinedTypes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<string> | A collection of undefined type strings. |
Remarks
An undefined type is any JSON-LD term used as a value of "@type" that is not defined in the DTDL language and not defined by any DTDL extension included via the "@context" property. The DTDL language permits undefined types to be co-typed on any DTDL element regardless of its primary type. The DTDL language permits undefined propertyes to be added to any DTDL element that has an undefined co-type.
Methods
| Edit this page View SourceDeepEquals(DTEntityInfo)
Compares to another DTEntityInfo
object, recursing through the entire subtree of object properties.
Declaration
public virtual bool DeepEquals(DTEntityInfo other)
Parameters
Type | Name | Description |
---|---|---|
DTEntityInfo | other | The other |
Returns
Type | Description |
---|---|
bool | True if equal. |
Equals(DTEntityInfo)
Compares to another DTEntityInfo
object.
Declaration
public virtual bool Equals(DTEntityInfo other)
Parameters
Type | Name | Description |
---|---|---|
DTEntityInfo | other | The other |
Returns
Type | Description |
---|---|
bool | True if equal. |
ValidateInstance(string)
Validate JSON text to determine whether it conforms to the definition in the DTDL language (for primitive schema types) or to the specific element defined in the model (for complex schema types).
Declaration
public IReadOnlyCollection<string> ValidateInstance(string instanceText)
Parameters
Type | Name | Description |
---|---|---|
string | instanceText | The JSON text to validate. |
Returns
Type | Description |
---|---|
IReadOnlyCollection<string> | A list of strings that each indicate a validation failure; the list is empty if the text is valid JSON and conforms. |
Remarks
Most subclasses will throw a ValidationException
if this method is called, because they have no instance validator defined.
Conformance is meaningfull only for schema types, so only these classes can validate an instance.
ValidateInstance(JsonElement)
Validate a JsonElement
to determine whether it conforms to the definition in the DTDL language (for primitive schema types) or to the specific element defined in the model (for complex schema types).
Declaration
public virtual IReadOnlyCollection<string> ValidateInstance(JsonElement instanceElt)
Parameters
Type | Name | Description |
---|---|---|
JsonElement | instanceElt | The |
Returns
Type | Description |
---|---|
IReadOnlyCollection<string> | A list of strings that each indicate a validation failure; the list is empty if the |
Remarks
This method will throw a ValidationException
for subclasses that have no instance validator defined.
Conformance is meaningfull only for schema types, so only these classes can validate an instance.
Operators
| Edit this page View Sourceoperator ==(DTEntityInfo, DTEntityInfo)
Determines whether two DTEntityInfo
objects are equal.
Declaration
public static bool operator ==(DTEntityInfo x, DTEntityInfo y)
Parameters
Type | Name | Description |
---|---|---|
DTEntityInfo | x | One |
DTEntityInfo | y | Another |
Returns
Type | Description |
---|---|
bool | True if equal. |
operator !=(DTEntityInfo, DTEntityInfo)
Determines whether two DTEntityInfo
objects are not equal.
Declaration
public static bool operator !=(DTEntityInfo x, DTEntityInfo y)
Parameters
Type | Name | Description |
---|---|---|
DTEntityInfo | x | One |
DTEntityInfo | y | Another |
Returns
Type | Description |
---|---|
bool | True if not equal. |