Skip to content

Commit 3eb0af9

Browse files
authored
Updated notebooks to make them more "general" (Azure#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
1 parent 69be40d commit 3eb0af9

File tree

9 files changed

+4335
-0
lines changed

9 files changed

+4335
-0
lines changed

sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/01_Patrons.ipynb

Lines changed: 605 additions & 0 deletions
Large diffs are not rendered by default.

sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/02_Purchasing_Tickets.ipynb

Lines changed: 1695 additions & 0 deletions
Large diffs are not rendered by default.

sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/03_Adding_a_bunch of_other_components.ipynb

Lines changed: 649 additions & 0 deletions
Large diffs are not rendered by default.

sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/04_Lots_on_Queries.ipynb

Lines changed: 1197 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"@id": "dtmi:mymodels:patron;1",
3+
"@type": "Interface",
4+
"displayName": "Patron",
5+
"contents": [
6+
{
7+
"@type": "Command",
8+
"name": "order",
9+
"request": {
10+
"name": "wallet",
11+
"displayName": "available money",
12+
"description": "how much the patron is willing to spend",
13+
"schema": "double"
14+
},
15+
"response": {
16+
"name": "decision",
17+
"displayName": "consumer decision",
18+
"schema": "string"
19+
}
20+
},
21+
{
22+
"@type": "Property",
23+
"name": "totalWaitTime",
24+
"displayName": "Total Wait Time",
25+
"schema": "double",
26+
"comment": "time in seconds that the customer is required to wait"
27+
},
28+
{
29+
"@type": "Property",
30+
"name": "satisfaction",
31+
"displayName": "Customer Satisfaction",
32+
"schema": "integer",
33+
"comment": "1-10 scale of how likely to recommend to a friend (NPS)"
34+
},
35+
{
36+
"@type": "Relationship",
37+
"name": "locatedIn"
38+
}
39+
],
40+
"@context": "dtmi:dtdl:context;2",
41+
"comment": "This should represent one restaurant visitor.",
42+
"description": "As an example, contains all of the properties possible in the DTDL."
43+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"@id": "dtmi:mymodels:area;1",
3+
"@type": "Interface",
4+
"displayName": "area",
5+
"contents": [
6+
{
7+
"@type": "Property",
8+
"name": "capacity",
9+
"displayName": "capacity",
10+
"schema": "double",
11+
"comment": "How many people can safely be in this area."
12+
},
13+
{
14+
"@type": "Property",
15+
"name": "status",
16+
"displayName": "status",
17+
"schema": "string",
18+
"comment": "open, closed, etc."
19+
},
20+
{
21+
"@type": "Relationship",
22+
"name": "occupiedBy"
23+
}
24+
],
25+
"@context": "dtmi:dtdl:context;2",
26+
"comment": "A number of people in a room",
27+
"description": "a room"
28+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"@id": "dtmi:mymodels:line;1",
3+
"@type": "Interface",
4+
"displayName": "line",
5+
"contents": [
6+
{
7+
"@type": "Property",
8+
"name": "capacity",
9+
"displayName": "capacity",
10+
"schema": "double",
11+
"comment": "How many people can safely wait in this line."
12+
},
13+
{
14+
"@type": "Property",
15+
"name": "status",
16+
"displayName": "status",
17+
"schema": "string",
18+
"comment": "current status of the line"
19+
},
20+
{
21+
"@type": "Relationship",
22+
"name": "leadsTo",
23+
"properties": [
24+
{
25+
"@type": "Property",
26+
"name": "walk_distance",
27+
"schema": "double"
28+
}
29+
]
30+
}
31+
],
32+
"@context": "dtmi:dtdl:context;2",
33+
"comment": "lines can hold a number of people.",
34+
"description": "a group of people waiting to get into a place."
35+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"@id": "dtmi:mymodels:ticket;1",
3+
"@type": "Interface",
4+
"displayName": "ticket",
5+
"contents": [
6+
{
7+
"@type": "Property",
8+
"name": "purchaselocation_lat",
9+
"displayName": "puchased location (latitude)",
10+
"schema": "double",
11+
"comment": "latitude of the place where the ticket was purchased"
12+
},
13+
{
14+
"@type": "Property",
15+
"name": "purchaselocation_long",
16+
"displayName": "puchased location",
17+
"schema": "double",
18+
"comment": "longitude of the place where the ticket was purchased"
19+
},
20+
{
21+
"@type": "Property",
22+
"name": "sold_to",
23+
"displayName": "sold to",
24+
"schema": "string",
25+
"comment": "UID of the purchaser from customer data"
26+
},
27+
{
28+
"@type": "Property",
29+
"name": "event_title",
30+
"displayName": "event name",
31+
"schema": "string",
32+
"comment": "name or id of the event"
33+
},
34+
{
35+
"@type": "Property",
36+
"name": "ticket_location",
37+
"displayName": "ticket location",
38+
"schema": "string",
39+
"comment": "location of the seat, for demonstration this is just a number"
40+
},
41+
{
42+
"@type": "Property",
43+
"name": "state",
44+
"displayName": "state",
45+
"schema": "string",
46+
"comment": "current state of the ticket"
47+
},
48+
{
49+
"@type": "Relationship",
50+
"name": "ownedBy",
51+
"properties": [
52+
{
53+
"@type": "Property",
54+
"name": "bought_online",
55+
"schema": "boolean"
56+
}
57+
]
58+
}
59+
],
60+
"@context": "dtmi:dtdl:context;2",
61+
"comment": "A number of tickets are placed into ADT before purchase with the initial state: open",
62+
"description": "an abstract ticket"
63+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## Digital Twin Tutorial
2+
3+
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.
4+
5+
6+
You will need:
7+
* A conda environment with the latest `Azure-Digital-Twin SDK`
8+
* The Azure CLI tools for authentication
9+
* The digital twin explorer
10+
* A digital twin account, where you have sufficient permission.
11+
12+
13+
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.
14+
15+
| notebook | purpose |
16+
|----------|:-------------:|
17+
| 01 | The basics of connecting, uploading models and creating twins |
18+
| 02 | More details about creating relationships, updating values and basic queries |
19+
| 03 | Some examples of arbitrary model changes that I made to shape the model |
20+
| 04 | More detail about running queries with some examples of how to get insights |

0 commit comments

Comments
 (0)