Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated notebooks to make them more "general" #15660

Merged
merged 5 commits into from
Sep 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

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."
}
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"
}
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."
}
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"
}
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 |