-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated notebooks to make them more "general" (#15660)
* Updated notebooks to make them more "general" * updated gitignore, added models, updated path * reverted gitignore * reverting gitignore * Renamed some files, changed model id to be more generic
- Loading branch information
Showing
9 changed files
with
4,335 additions
and
0 deletions.
There are no files selected for viewing
605 changes: 605 additions & 0 deletions
605
sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/01_Patrons.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
1,695 changes: 1,695 additions & 0 deletions
1,695
sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/02_Purchasing_Tickets.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
649 changes: 649 additions & 0 deletions
649
...ins/azure-digitaltwins-core/samples/notebooks/03_Adding_a_bunch of_other_components.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
1,197 changes: 1,197 additions & 0 deletions
1,197
sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/04_Lots_on_Queries.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/Patron.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"@id": "dtmi:mymodels:patron;1", | ||
"@type": "Interface", | ||
"displayName": "Patron", | ||
"contents": [ | ||
{ | ||
"@type": "Command", | ||
"name": "order", | ||
"request": { | ||
"name": "wallet", | ||
"displayName": "available money", | ||
"description": "how much the patron is willing to spend", | ||
"schema": "double" | ||
}, | ||
"response": { | ||
"name": "decision", | ||
"displayName": "consumer decision", | ||
"schema": "string" | ||
} | ||
}, | ||
{ | ||
"@type": "Property", | ||
"name": "totalWaitTime", | ||
"displayName": "Total Wait Time", | ||
"schema": "double", | ||
"comment": "time in seconds that the customer is required to wait" | ||
}, | ||
{ | ||
"@type": "Property", | ||
"name": "satisfaction", | ||
"displayName": "Customer Satisfaction", | ||
"schema": "integer", | ||
"comment": "1-10 scale of how likely to recommend to a friend (NPS)" | ||
}, | ||
{ | ||
"@type": "Relationship", | ||
"name": "locatedIn" | ||
} | ||
], | ||
"@context": "dtmi:dtdl:context;2", | ||
"comment": "This should represent one restaurant visitor.", | ||
"description": "As an example, contains all of the properties possible in the DTDL." | ||
} |
28 changes: 28 additions & 0 deletions
28
sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/area.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"@id": "dtmi:mymodels:area;1", | ||
"@type": "Interface", | ||
"displayName": "area", | ||
"contents": [ | ||
{ | ||
"@type": "Property", | ||
"name": "capacity", | ||
"displayName": "capacity", | ||
"schema": "double", | ||
"comment": "How many people can safely be in this area." | ||
}, | ||
{ | ||
"@type": "Property", | ||
"name": "status", | ||
"displayName": "status", | ||
"schema": "string", | ||
"comment": "open, closed, etc." | ||
}, | ||
{ | ||
"@type": "Relationship", | ||
"name": "occupiedBy" | ||
} | ||
], | ||
"@context": "dtmi:dtdl:context;2", | ||
"comment": "A number of people in a room", | ||
"description": "a room" | ||
} |
35 changes: 35 additions & 0 deletions
35
sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/line.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"@id": "dtmi:mymodels:line;1", | ||
"@type": "Interface", | ||
"displayName": "line", | ||
"contents": [ | ||
{ | ||
"@type": "Property", | ||
"name": "capacity", | ||
"displayName": "capacity", | ||
"schema": "double", | ||
"comment": "How many people can safely wait in this line." | ||
}, | ||
{ | ||
"@type": "Property", | ||
"name": "status", | ||
"displayName": "status", | ||
"schema": "string", | ||
"comment": "current status of the line" | ||
}, | ||
{ | ||
"@type": "Relationship", | ||
"name": "leadsTo", | ||
"properties": [ | ||
{ | ||
"@type": "Property", | ||
"name": "walk_distance", | ||
"schema": "double" | ||
} | ||
] | ||
} | ||
], | ||
"@context": "dtmi:dtdl:context;2", | ||
"comment": "lines can hold a number of people.", | ||
"description": "a group of people waiting to get into a place." | ||
} |
63 changes: 63 additions & 0 deletions
63
sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/ticket.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"@id": "dtmi:mymodels:ticket;1", | ||
"@type": "Interface", | ||
"displayName": "ticket", | ||
"contents": [ | ||
{ | ||
"@type": "Property", | ||
"name": "purchaselocation_lat", | ||
"displayName": "puchased location (latitude)", | ||
"schema": "double", | ||
"comment": "latitude of the place where the ticket was purchased" | ||
}, | ||
{ | ||
"@type": "Property", | ||
"name": "purchaselocation_long", | ||
"displayName": "puchased location", | ||
"schema": "double", | ||
"comment": "longitude of the place where the ticket was purchased" | ||
}, | ||
{ | ||
"@type": "Property", | ||
"name": "sold_to", | ||
"displayName": "sold to", | ||
"schema": "string", | ||
"comment": "UID of the purchaser from customer data" | ||
}, | ||
{ | ||
"@type": "Property", | ||
"name": "event_title", | ||
"displayName": "event name", | ||
"schema": "string", | ||
"comment": "name or id of the event" | ||
}, | ||
{ | ||
"@type": "Property", | ||
"name": "ticket_location", | ||
"displayName": "ticket location", | ||
"schema": "string", | ||
"comment": "location of the seat, for demonstration this is just a number" | ||
}, | ||
{ | ||
"@type": "Property", | ||
"name": "state", | ||
"displayName": "state", | ||
"schema": "string", | ||
"comment": "current state of the ticket" | ||
}, | ||
{ | ||
"@type": "Relationship", | ||
"name": "ownedBy", | ||
"properties": [ | ||
{ | ||
"@type": "Property", | ||
"name": "bought_online", | ||
"schema": "boolean" | ||
} | ||
] | ||
} | ||
], | ||
"@context": "dtmi:dtdl:context;2", | ||
"comment": "A number of tickets are placed into ADT before purchase with the initial state: open", | ||
"description": "an abstract ticket" | ||
} |
20 changes: 20 additions & 0 deletions
20
sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/readme.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
## Digital Twin Tutorial | ||
|
||
These notebooks will show you how to create a graph and interact with it through the Python API. It will build a venue and allow you to measure the customer satisfaction of people as the pass through the system. | ||
|
||
|
||
You will need: | ||
* A conda environment with the latest `Azure-Digital-Twin SDK` | ||
* The Azure CLI tools for authentication | ||
* The digital twin explorer | ||
* A digital twin account, where you have sufficient permission. | ||
|
||
|
||
The perspective of these notebooks is from the role of the **Analyst** not an application. The purpose is to use the graph to get insights on customers. This would allow you to query the API in real time, as events are happening. | ||
|
||
| notebook | purpose | | ||
|----------|:-------------:| | ||
| 01 | The basics of connecting, uploading models and creating twins | | ||
| 02 | More details about creating relationships, updating values and basic queries | | ||
| 03 | Some examples of arbitrary model changes that I made to shape the model | | ||
| 04 | More detail about running queries with some examples of how to get insights | |