You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-develop/concepts-model-repository.md
+37-12Lines changed: 37 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Understand concepts of the device models repository | Microsoft Docs
3
3
description: As a solution developer or an IT professional, learn about the basic concepts of the device models repository.
4
4
author: rido-min
5
5
ms.author: rmpablos
6
-
ms.date: 11/17/2020
6
+
ms.date: 11/12/2021
7
7
ms.topic: conceptual
8
8
ms.service: iot-develop
9
9
services: iot-develop
@@ -13,7 +13,15 @@ services: iot-develop
13
13
14
14
The device models repository (DMR) enables device builders to manage and share IoT Plug and Play device models. The device models are JSON LD documents defined using the [Digital Twins Modeling Language (DTDL)](https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md).
15
15
16
-
The DMR defines a pattern to store DTDL interfaces in a folder structure based on the device twin model identifier (DTMI). You can locate an interface in the DMR by converting the DTMI to a relative path. For example, the `dtmi:com:example:Thermostat;1` DTMI translates to `/dtmi/com/example/thermostat-1.json`.
16
+
The DMR defines a pattern to store DTDL interfaces in a folder structure based on the device twin model identifier (DTMI). You can locate an interface in the DMR by converting the DTMI to a relative path. For example, the `dtmi:com:example:Thermostat;1` DTMI translates to `/dtmi/com/example/thermostat-1.json` and can be obtained from the public base URL `devicemodels.azure.com` at the URL [https://devicemodels.azure.com/dtmi/com/example/thermostat-1.json](https://devicemodels.azure.com/dtmi/com/example/thermostat-1.json).
17
+
18
+
## Index, expanded and metadata
19
+
20
+
The DMR conventions include additional artifacts for simplifying consumption of hosted models. These features are _optional_ for custom or private repositories.
21
+
22
+
-_Index_. All available DTMIs are exposed through an *index* composed by a sequence of json files, for example: [https://devicemodels.azure.com/index.page.2.json](https://devicemodels.azure.com/index.page.2.json)
23
+
-_Expanded_. A file with all the dependencies is available for each interface, for example: [https://devicemodels.azure.com/dtmi/com/example/temperaturecontroller-1.expanded.json](https://devicemodels.azure.com/dtmi/com/example/temperaturecontroller-1.expanded.json)
24
+
-_Metadata_. This file exposes key attributes of a repository and is refreshed periodically with the latest published models snapshot. It includes features that a repository implements such as whether the model index or expanded model files are available. You can access the DMR metadata at [https://devicemodels.azure.com/metadata.json](https://devicemodels.azure.com/metadata.json)
17
25
18
26
## Public device models repository
19
27
@@ -66,7 +74,6 @@ The `ModelsRepositoryClient` can be configured to query a custom model repositor
66
74
67
75
- Disabled. Returns the specified interface only, without any dependency.
68
76
- Enabled. Returns all the interfaces in the dependency chain
69
-
- TryFromExpanded. Use the `.expanded.json` file to retrieve the pre-calculated dependencies
70
77
71
78
> [!Tip]
72
79
> Custom repositories might not expose the `.expanded.json` file, when not available the client will fallback to process each dependency locally.
@@ -77,12 +84,13 @@ The next sample code shows how to initialize the `ModelsRepositoryClient` by usi
There are more samples available within the source code in the Azure SDK GitHub repository: [Azure.Iot.ModelsRepository/samples](https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/modelsrepository/Azure.IoT.ModelsRepository/samples)
@@ -114,11 +122,7 @@ The tools used to validate the models during the PR checks can also be used to a
The DMR can include an *index* with a list of all the DTMIs available at the time of publishing. This file can be split in to multiple files as described in the [DMR Tools Wiki](https://github.com/Azure/iot-plugandplay-models-tools/wiki/Model-Index).
179
+
180
+
To generate the index in a custom or private DMR, use the index command:
181
+
182
+
```bash
183
+
dmr-client index -r . -o index.json
184
+
```
185
+
186
+
> [!NOTE]
187
+
> The public DMR is configured to provide an updated index available at: https://devicemodels.azure.com/index.json
188
+
189
+
### Create *expanded* files
190
+
191
+
Expanded files can be generated using the command:
192
+
193
+
```bash
194
+
dmr-client expand -r .
195
+
```
196
+
172
197
## Next steps
173
198
174
199
The suggested next step is to review the [IoT Plug and Play architecture](concepts-architecture.md).
0 commit comments