Usage of Asset Modeling Schemas
Rational
The Industrial Asset Hub (IAH) is expected to be extensible in such a way that adding support for still unsupported asset types is not too difficult and can be accomplished without modifying neither the IAH components, nor other common components like the Asset Gateway.
In order to accomplish this, the mentioned components are said to be asset type agnostic. This means that the specificities of any asset types not supported natively by IAH remain part of either the Asset Links or any extensions built upon IAH northbound APIs.
Solution
Asset Modeling Schemas
A specification is needed to define the schema to be followed by the created asset models.
Defining an asset modeling schema that also reaches the goals mentioned in the the Rational section would require such a generic modeling schema that it would be difficult to use by modelers and hard to add support for.
Instead a different and well-known approach has been used: a generic "base" schema and whatever is needed by the IAH being natively supported with support for derived schemas (AKA schema extensions). The most prominent example of this approach is the LDAP specification.
Derived Schemas
As mentioned above, IAH natively supports whatever is defined in the "base" schema. But it is possible to create so-called derived schemas to either provide a domain-specific vocabulary or even provide new concepts that will be supported off-band (provided by an Asset Link and consumed only by an IAH Application).
Modeling Language: LinkML
In order to specify the asset modeling schemas the modeling language LinkML has been chosen.
LinkML is a well specified and documented modeling language. But not only that, it also provides a lot of tools and documentation that ease its use in software projects.
Technical Details
As of now IAH does not provide any specific tool support for dealing neither with the schema, nor with the asset models. But the tools natively provided by LinkML can be useful for this purpose.
The following sections provide use-case oriented information about how to use those tools to handle schemas and models.
Programmatically Extracting Schema Information
LinkML provides the SchemaView
Python class to help you analyze the schema
programmatically.
Programmatically Extracting Model Information
LinkML can generate Python classes to access the asset model information programmatically.
Validating the Asset Models
As of now asset models have to be provided as JSON documents. Thanks to LinkML tools JSON Schemas are being generated for each asset modeling schema (check the schema documentation). This way validating the format of the asset models can be done relying on standard tooling.
On top of that LinkML provides the tool linkml-validate
to validate asset
models against the schema.
This validation includes the above mentioned JSON Schema.