Orion Context Broker Exercises (Part 1)

T
Orion Context Broker Exercises
(PART I)
Contact twitter
@marivibriz
Contact email
mariavirtudes.brizruiz@telefonica.com
Outline
• CB-1. Create entities using standard ops
• CB-2. Query entities using standard ops
• CB-3. Update entity using standard ops
• CB-4. Create entities using conv ops
• CB-5. Query entities using conv ops
• CB-6. Update entity using conv ops
• CB-7. Browsing entity types
• CB-8. Basic subscription/notifications
2
CB-1. Create entities using standard ops
• Steps
– Create the following entities in your Orion
instance
• See table in next slide
• Hints
– Orion User Manual section 3.3.1.1
(UpdateContext & APPEND)
Easy
CB-1 . Create entities using standard ops Easy
Entity Entity Type
Bedroom1 Room
Bedroom2 Room
Kitchen Room
Frontdoor Door
Backdoor Door
Entity Type Attr. Name Attr. Type Example value
Room Temperature float 27.8
Presence boolean true
Status string OK
Door Locked boolean false
Closed boolean false
CB-2. Query entities using standard ops
• Prerequisites
– Exercise CB-1
• Steps
– Write a program (or web/mobile application) that does
the following queries and prints the result
• Obtain all attributes of Bedroom1 entity
• Obtain only the Temperature attribute of Kitchen entity
• Obtain all attributes of Kitchen and Bedroom2 entities in one
query
• Obtain all attributes of entities that match the pattern
Bedroom.*
• Find out whether the doors are closed using the pattern
.*door and the Closed attribute
– Run and test your program/application
• Hints
– Orion User Manual section 3.3.1.2
(queryContext)
Easy
CB-3. Update entity using standard ops
• Prerequisites
– Exercise CB-2
• Steps
– Write a program (or web/mobile application)
that
• Asks for user input (one value)
• Updates Looked attribute of Frontdoor entity using
that input
• Queries the entity and check the result
– Run and test your program/application
• Hints
– Orion User Manual section 3.3.1.2 and 3.3.1.3
(updateContext & UPDATE)
Easy
CB-4. Create entities using conv ops
• Prerequisites
– Exercise CB-3
• Steps
– Create the following entities in your Orion
instance
• See table in next slide
• Hints
– Similar to exercise CB-2 in the standard ops
set
– Orion User Manual section 3.3.2.1
(contextEntities/entityID)
Easy
CB-4. Create entities using conv ops Easy
Entity Entity Type
Garage Room
Bathroom Room
Light1 Light
Light2 Light
Light3 Light
Entity Type Attr. Name Attr. Type Example value
Room Temperature float 27.8
Presence boolean true
Status string OK
Light Intensity Percent 0.25
CB-5. Query entities using conv ops
• Prerequisites
– Exercise CB-4
• Steps
– Write a program (or web/mobile application) that does the
following queries using convenience operations and print the
result
• Obtain all attributes of the Garage entity
• Find out whether there is anyone in the Bathroom entity
• Obtain all entities created so far
• Obtain all entities of type Room
• Obtain the temperature attribute of all entities of type Room
– Run and test your program/application
• Hints
– Similar to exercise CB-2 in the standard ops set
– To get all entities of a given type, you can use the
“contextEntityType” resource
– Orion User Manual section 3.3.2.2
(contextEntities/entityID and contextEntities/type/XX/id/XX)
Easy
CB-6. Update entity using conv ops
• Prerequisites
– Exercise CB-5
• Steps
– Write a program (or web/mobile application) that
• Asks for user input (one value)
• Updates Intensity attribute of Light1 entity using that
input using a convenience operation
• Queries the entity and check the result
– Run and test your program/application
• Hints
– Similar to exercise CB-3 in the std ops set
– Orion User Manual section 3.3.2.2 and 3.3.2.3
(contextEntities/entityID and
contextEntities/type/XX/id/XX)
Easy
CB-7. Browsing entity types
• Prerequisites
– Exercise CB-6
• Steps
– Write a program (or web/mobile application)
that
• Lists all entity types
• Provides detailed information of type Door
– Run and test your program/application
• Hints
– Orion User Manual section 3.5.6
(contextTypes)
Easy
CB-8. Basic subscription/notifications
• Prerequisites
– Exercise CB-7
• Steps
– Write a program that
• Starts a REST server to receive notifications from Orion
• Prints the value of the Temperature attribute of Bedroom1
entity each time a notification is received
– Subscribe your program to changes in the
Temperature attribute of Bedroom1 entity
– Update the Temperature attribute of Bedroom1 entity
and check that your program prints the updated value
• Hints
– Orion User Manual section 3.3.1.4 (specially subsection
on ONCHANGE, i.e. 3.3.1.4.2)
– Your program has to run in a VM to which your Orion
instance may send notifications (e.g. the same VM in
which Orion is running)
Medium
Orion Context Broker Exercises
(PART II)
Contact twitter
@marivibriz
Contact email
mariavirtudes.brizruiz@telefonica.com
Outline
• CB-1. Pagination
• CB-2. Geolocation (factory)
• CB-3. Compound attributes
• CB-4. Query entities with compound attributes
• CB-5. Update entities with compound attributes
• CB-6. Custom metadata
14
CB-1. Pagination
• Prerequisites
– Access to Orion instance running in
workshop.tidnode.cl port 1026
• Steps
– Check how many entities of type Sensor are
stored in that Orion instance
– Write a program (or web/mobile application) that
• Asks for a limit and a page number
• Returns the name IDs the entities of type Sensor in the
corresponding page
– Run and test your program/application
• Hints
– Orion User Manual section 3.5.1
(queryContext?limit=100&details=on)
Medium
CB-2. Geolocation (factory)
• Prerequisites
– Access to Orion instance running in
workshop.tidnode.cl port 1026
• Steps
– Write a program (or web/mobile
application) that
• Gets all existing types
• Gets all entities of each type in areas Red,
Green and Blue (see next slide), printing entity
IDs and their attributes which their values
– Run and test your program/application
• Hints
– Orion User Manual section 3.5.20
Medium
17
-33.596620, -70.666825
-33.607682, -70.670730
-33.6100089, -70.643231
-33.599194, -70.640200
CB-2. Geolocation (factory) Medium
18
-33.596620, -70.666825
-33.607682, -70.670730
-33.6100089, -70.643231
-33.599194, -70.640200
-33.603458,
-70.652788
-33.606123,
-70.653790
-33.604231,
-70.646032
-33.607108,
-70.646781
-33.602391,
-70.661781
x
200m
CB-2. Geolocation (factory) Medium
CB-3. Compound attributes
• Prerequisites
– Exercise CB-1
• Steps
– Create the following entities in your Orion
instance
• See table in next slide
• Hints
– Orion User Manual section 3.5.19
Medium
CB-3. Compound attributes
Entity Type Attr. Name Attr. Type Example value
Character Name string Fooy
Hitpoints integer 110
Class string Barbarian
Abilities compound {
"STR": "2",
"DEX": "4",
"CON": "3",
"INT": "1",
"WIS": "1",
"CHA": "2"
}
Inventory compound {
"weapons": [ "sword", "dagger" ],
"potions": { "life": "1", "mana": "0" },
"other": ["shield"]
}
Entity name Entity Type
Gandalf Character
Aragorn Character
Frodo Character
Medium
CB-4. Query entities with compound attributes
• Prerequisites
– Exercise CB-1
• Steps
– Write a program (or web/mobile
application) that does the following queries
and print the result
• Obtain all attributes of Aragorn entity
• Obtain only the Abilities attribute of Frodo
entity
– Run and test your program/application
• Hints
– Orion User Manual section 3.5.19
Medium
CB-5. Update entities with compound attributes
• Prerequisites
– Exercise CB-1
• Steps
– Write a program (or web/mobile application)
that
• Asks for an object name (e.g. “staff”, “hat”, etc.)
• Updates Gandalf's Inventory attribute to reflect
that he now has a that object test your program
– Run and test your program/application
• Query the Gandalf's Inventory after that, in order
to check that the object has been successfully added
• Hints
– Orion User Manual section 3.5.19
Medium
CB-6. Custom metadata Medium
• Prerequisites
– Exercise CB-1
• Steps
– Update the Gandalf entity so that the
inventory attribute has two new metadatas:
• name="Weight", type="float", value="1.2"
• name="MaxWeight", type="float", value="20"
– Query Gandalf again to see the new metadata
atached to the corresponding attribute
• Hints
– Orion User Manual section 3.5.7
Thanks!Thanks!
(Number to manuals sections in this presentation are valid at time of writing this –March 9th 2015-, but they may
change along time)
1 von 24

Recomendados

The Beatles monument in Rostov-on-Don project von
The Beatles monument in Rostov-on-Don projectThe Beatles monument in Rostov-on-Don project
The Beatles monument in Rostov-on-Don projectЕвгений Золотухин
1.4K views13 Folien
Good practices to build good software von
Good practices to build good softwareGood practices to build good software
Good practices to build good softwareTIDChile
1K views69 Folien
CURRICULUM VITAE von
CURRICULUM VITAECURRICULUM VITAE
CURRICULUM VITAEStephen Landolt
497 views11 Folien
MUHAMMAD IQBAL von
MUHAMMAD IQBALMUHAMMAD IQBAL
MUHAMMAD IQBALmuhammad iqbal hussa hussain
148 views5 Folien
Valeria 22 3 von
Valeria 22 3 Valeria 22 3
Valeria 22 3 Valeria Viarengo
384 views21 Folien
แรง von
แรงแรง
แรงArisa Khuntong
2.7K views22 Folien

Más contenido relacionado

Destacado

شركه بورتو البحر الميت للتنمية السياحية Powe point von
شركه بورتو البحر الميت للتنمية السياحية Powe pointشركه بورتو البحر الميت للتنمية السياحية Powe point
شركه بورتو البحر الميت للتنمية السياحية Powe pointhadeel ameen
415 views7 Folien
Materi 220115 von
Materi 220115Materi 220115
Materi 220115Anita Hutahaean
499 views6 Folien
Energy von
EnergyEnergy
Energyquintomat
274 views10 Folien
Curriculum vita Ibrahim Ammar von
Curriculum vita Ibrahim AmmarCurriculum vita Ibrahim Ammar
Curriculum vita Ibrahim AmmarIbrahim Ammar
1.2K views4 Folien
цдг космонавт коледна работилница von
цдг космонавт коледна работилницацдг космонавт коледна работилница
цдг космонавт коледна работилницаmegikatq
462 views14 Folien
OCWM Thank You von
OCWM Thank YouOCWM Thank You
OCWM Thank YouZac Norenberg
490 views18 Folien

Destacado(10)

شركه بورتو البحر الميت للتنمية السياحية Powe point von hadeel ameen
شركه بورتو البحر الميت للتنمية السياحية Powe pointشركه بورتو البحر الميت للتنمية السياحية Powe point
شركه بورتو البحر الميت للتنمية السياحية Powe point
hadeel ameen415 views
Curriculum vita Ibrahim Ammar von Ibrahim Ammar
Curriculum vita Ibrahim AmmarCurriculum vita Ibrahim Ammar
Curriculum vita Ibrahim Ammar
Ibrahim Ammar1.2K views
цдг космонавт коледна работилница von megikatq
цдг космонавт коледна работилницацдг космонавт коледна работилница
цдг космонавт коледна работилница
megikatq462 views
Definitions of unit 2 von quintomat
Definitions of unit 2Definitions of unit 2
Definitions of unit 2
quintomat193 views
Портфолио воспитателя von vasko253
Портфолио воспитателяПортфолио воспитателя
Портфолио воспитателя
vasko253238 views
3° Fiware Overview-Chile- Track von TIDChile
3° Fiware Overview-Chile- Track3° Fiware Overview-Chile- Track
3° Fiware Overview-Chile- Track
TIDChile618 views

Similar a Orion Context Broker Exercises (Part 1)

Orion Context Broker Exercises von
Orion Context Broker ExercisesOrion Context Broker Exercises
Orion Context Broker ExercisesFermin Galan
4.5K views44 Folien
Java beans von
Java beansJava beans
Java beansRajkiran Mummadi
2.1K views39 Folien
React-Native Lecture 11: In App Storage von
React-Native Lecture 11: In App StorageReact-Native Lecture 11: In App Storage
React-Native Lecture 11: In App StorageKobkrit Viriyayudhakorn
16K views50 Folien
Build a bot hands on snowforce19 von
Build a bot hands on snowforce19Build a bot hands on snowforce19
Build a bot hands on snowforce19rikkehovgaard
183 views40 Folien
Easy mock von
Easy mockEasy mock
Easy mockSrikrishna k
357 views17 Folien
Fiware Developers Week Iot exercises (Advanced) von
Fiware Developers Week Iot exercises (Advanced)Fiware Developers Week Iot exercises (Advanced)
Fiware Developers Week Iot exercises (Advanced)dmoranj
1.6K views10 Folien

Similar a Orion Context Broker Exercises (Part 1)(13)

Orion Context Broker Exercises von Fermin Galan
Orion Context Broker ExercisesOrion Context Broker Exercises
Orion Context Broker Exercises
Fermin Galan4.5K views
Build a bot hands on snowforce19 von rikkehovgaard
Build a bot hands on snowforce19Build a bot hands on snowforce19
Build a bot hands on snowforce19
rikkehovgaard183 views
Fiware Developers Week Iot exercises (Advanced) von dmoranj
Fiware Developers Week Iot exercises (Advanced)Fiware Developers Week Iot exercises (Advanced)
Fiware Developers Week Iot exercises (Advanced)
dmoranj1.6K views
How to Make OpenStack Heat Better based on Our One Year Production Journey von Kaz Shinohara
How to Make OpenStack Heat Better based on Our One Year Production JourneyHow to Make OpenStack Heat Better based on Our One Year Production Journey
How to Make OpenStack Heat Better based on Our One Year Production Journey
Kaz Shinohara289 views
Remix: On-demand Live Randomization (Fine-grained live ASLR during runtime) von Yue Chen
Remix: On-demand Live Randomization (Fine-grained live ASLR during runtime)Remix: On-demand Live Randomization (Fine-grained live ASLR during runtime)
Remix: On-demand Live Randomization (Fine-grained live ASLR during runtime)
Yue Chen1K views
Introduction of Life Cycle.pptx von fake621211
Introduction of Life Cycle.pptxIntroduction of Life Cycle.pptx
Introduction of Life Cycle.pptx
fake6212118 views
[Advantech] WebOP designer Tutorial step by step von Ming-Hung Hseih
[Advantech] WebOP designer Tutorial step by step [Advantech] WebOP designer Tutorial step by step
[Advantech] WebOP designer Tutorial step by step
Ming-Hung Hseih2.4K views
Context Information Management in IoT enabled smart systems - the basics von Fernando Lopez Aguilar
Context Information Management in IoT enabled smart systems - the basicsContext Information Management in IoT enabled smart systems - the basics
Context Information Management in IoT enabled smart systems - the basics
Migrating IBM Cloud Orchestrator environment from v2.4.0.2 to v2.5.0.1 von Paulraj Pappaiah
Migrating IBM Cloud Orchestrator environment from v2.4.0.2 to v2.5.0.1Migrating IBM Cloud Orchestrator environment from v2.4.0.2 to v2.5.0.1
Migrating IBM Cloud Orchestrator environment from v2.4.0.2 to v2.5.0.1
Paulraj Pappaiah110 views

Más de TIDChile

Iot presentation JustPeople-ago2015 von
Iot presentation JustPeople-ago2015Iot presentation JustPeople-ago2015
Iot presentation JustPeople-ago2015TIDChile
554 views28 Folien
Ingeniería de Calidad de Software: Retos del siglo XXI von
Ingeniería de Calidad de Software: Retos del siglo XXIIngeniería de Calidad de Software: Retos del siglo XXI
Ingeniería de Calidad de Software: Retos del siglo XXITIDChile
1.3K views33 Folien
Fiware IoT Proposal & Community von
Fiware IoT Proposal & Community Fiware IoT Proposal & Community
Fiware IoT Proposal & Community TIDChile
604 views41 Folien
Orion Context Broker von
Orion Context Broker Orion Context Broker
Orion Context Broker TIDChile
807 views46 Folien
3° Fiware Overview-Chile von
3° Fiware Overview-Chile3° Fiware Overview-Chile
3° Fiware Overview-ChileTIDChile
471 views22 Folien
Fiware IoT- Ejercicios von
Fiware IoT- EjerciciosFiware IoT- Ejercicios
Fiware IoT- EjerciciosTIDChile
348 views7 Folien

Más de TIDChile(8)

Iot presentation JustPeople-ago2015 von TIDChile
Iot presentation JustPeople-ago2015Iot presentation JustPeople-ago2015
Iot presentation JustPeople-ago2015
TIDChile554 views
Ingeniería de Calidad de Software: Retos del siglo XXI von TIDChile
Ingeniería de Calidad de Software: Retos del siglo XXIIngeniería de Calidad de Software: Retos del siglo XXI
Ingeniería de Calidad de Software: Retos del siglo XXI
TIDChile1.3K views
Fiware IoT Proposal & Community von TIDChile
Fiware IoT Proposal & Community Fiware IoT Proposal & Community
Fiware IoT Proposal & Community
TIDChile604 views
Orion Context Broker von TIDChile
Orion Context Broker Orion Context Broker
Orion Context Broker
TIDChile807 views
3° Fiware Overview-Chile von TIDChile
3° Fiware Overview-Chile3° Fiware Overview-Chile
3° Fiware Overview-Chile
TIDChile471 views
Fiware IoT- Ejercicios von TIDChile
Fiware IoT- EjerciciosFiware IoT- Ejercicios
Fiware IoT- Ejercicios
TIDChile348 views
Metamorfosis hacia una empresa ágil von TIDChile
Metamorfosis hacia una empresa ágilMetamorfosis hacia una empresa ágil
Metamorfosis hacia una empresa ágil
TIDChile479 views
FI Workshop Sesión Inaugural TID Chile von TIDChile
FI Workshop Sesión Inaugural TID ChileFI Workshop Sesión Inaugural TID Chile
FI Workshop Sesión Inaugural TID Chile
TIDChile871 views

Último

PRODUCT LISTING.pptx von
PRODUCT LISTING.pptxPRODUCT LISTING.pptx
PRODUCT LISTING.pptxangelicacueva6
14 views1 Folie
Vertical User Stories von
Vertical User StoriesVertical User Stories
Vertical User StoriesMoisés Armani Ramírez
14 views16 Folien
Powerful Google developer tools for immediate impact! (2023-24) von
Powerful Google developer tools for immediate impact! (2023-24)Powerful Google developer tools for immediate impact! (2023-24)
Powerful Google developer tools for immediate impact! (2023-24)wesley chun
10 views38 Folien
Uni Systems for Power Platform.pptx von
Uni Systems for Power Platform.pptxUni Systems for Power Platform.pptx
Uni Systems for Power Platform.pptxUni Systems S.M.S.A.
56 views21 Folien
Design Driven Network Assurance von
Design Driven Network AssuranceDesign Driven Network Assurance
Design Driven Network AssuranceNetwork Automation Forum
15 views42 Folien
Piloting & Scaling Successfully With Microsoft Viva von
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft VivaRichard Harbridge
12 views160 Folien

Último(20)

Powerful Google developer tools for immediate impact! (2023-24) von wesley chun
Powerful Google developer tools for immediate impact! (2023-24)Powerful Google developer tools for immediate impact! (2023-24)
Powerful Google developer tools for immediate impact! (2023-24)
wesley chun10 views
Piloting & Scaling Successfully With Microsoft Viva von Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
Five Things You SHOULD Know About Postman von Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman36 views
Voice Logger - Telephony Integration Solution at Aegis von Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma39 views
Unit 1_Lecture 2_Physical Design of IoT.pdf von StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 views
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... von Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker40 views
STPI OctaNE CoE Brochure.pdf von madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb14 views

Orion Context Broker Exercises (Part 1)

  • 1. Orion Context Broker Exercises (PART I) Contact twitter @marivibriz Contact email mariavirtudes.brizruiz@telefonica.com
  • 2. Outline • CB-1. Create entities using standard ops • CB-2. Query entities using standard ops • CB-3. Update entity using standard ops • CB-4. Create entities using conv ops • CB-5. Query entities using conv ops • CB-6. Update entity using conv ops • CB-7. Browsing entity types • CB-8. Basic subscription/notifications 2
  • 3. CB-1. Create entities using standard ops • Steps – Create the following entities in your Orion instance • See table in next slide • Hints – Orion User Manual section 3.3.1.1 (UpdateContext & APPEND) Easy
  • 4. CB-1 . Create entities using standard ops Easy Entity Entity Type Bedroom1 Room Bedroom2 Room Kitchen Room Frontdoor Door Backdoor Door Entity Type Attr. Name Attr. Type Example value Room Temperature float 27.8 Presence boolean true Status string OK Door Locked boolean false Closed boolean false
  • 5. CB-2. Query entities using standard ops • Prerequisites – Exercise CB-1 • Steps – Write a program (or web/mobile application) that does the following queries and prints the result • Obtain all attributes of Bedroom1 entity • Obtain only the Temperature attribute of Kitchen entity • Obtain all attributes of Kitchen and Bedroom2 entities in one query • Obtain all attributes of entities that match the pattern Bedroom.* • Find out whether the doors are closed using the pattern .*door and the Closed attribute – Run and test your program/application • Hints – Orion User Manual section 3.3.1.2 (queryContext) Easy
  • 6. CB-3. Update entity using standard ops • Prerequisites – Exercise CB-2 • Steps – Write a program (or web/mobile application) that • Asks for user input (one value) • Updates Looked attribute of Frontdoor entity using that input • Queries the entity and check the result – Run and test your program/application • Hints – Orion User Manual section 3.3.1.2 and 3.3.1.3 (updateContext & UPDATE) Easy
  • 7. CB-4. Create entities using conv ops • Prerequisites – Exercise CB-3 • Steps – Create the following entities in your Orion instance • See table in next slide • Hints – Similar to exercise CB-2 in the standard ops set – Orion User Manual section 3.3.2.1 (contextEntities/entityID) Easy
  • 8. CB-4. Create entities using conv ops Easy Entity Entity Type Garage Room Bathroom Room Light1 Light Light2 Light Light3 Light Entity Type Attr. Name Attr. Type Example value Room Temperature float 27.8 Presence boolean true Status string OK Light Intensity Percent 0.25
  • 9. CB-5. Query entities using conv ops • Prerequisites – Exercise CB-4 • Steps – Write a program (or web/mobile application) that does the following queries using convenience operations and print the result • Obtain all attributes of the Garage entity • Find out whether there is anyone in the Bathroom entity • Obtain all entities created so far • Obtain all entities of type Room • Obtain the temperature attribute of all entities of type Room – Run and test your program/application • Hints – Similar to exercise CB-2 in the standard ops set – To get all entities of a given type, you can use the “contextEntityType” resource – Orion User Manual section 3.3.2.2 (contextEntities/entityID and contextEntities/type/XX/id/XX) Easy
  • 10. CB-6. Update entity using conv ops • Prerequisites – Exercise CB-5 • Steps – Write a program (or web/mobile application) that • Asks for user input (one value) • Updates Intensity attribute of Light1 entity using that input using a convenience operation • Queries the entity and check the result – Run and test your program/application • Hints – Similar to exercise CB-3 in the std ops set – Orion User Manual section 3.3.2.2 and 3.3.2.3 (contextEntities/entityID and contextEntities/type/XX/id/XX) Easy
  • 11. CB-7. Browsing entity types • Prerequisites – Exercise CB-6 • Steps – Write a program (or web/mobile application) that • Lists all entity types • Provides detailed information of type Door – Run and test your program/application • Hints – Orion User Manual section 3.5.6 (contextTypes) Easy
  • 12. CB-8. Basic subscription/notifications • Prerequisites – Exercise CB-7 • Steps – Write a program that • Starts a REST server to receive notifications from Orion • Prints the value of the Temperature attribute of Bedroom1 entity each time a notification is received – Subscribe your program to changes in the Temperature attribute of Bedroom1 entity – Update the Temperature attribute of Bedroom1 entity and check that your program prints the updated value • Hints – Orion User Manual section 3.3.1.4 (specially subsection on ONCHANGE, i.e. 3.3.1.4.2) – Your program has to run in a VM to which your Orion instance may send notifications (e.g. the same VM in which Orion is running) Medium
  • 13. Orion Context Broker Exercises (PART II) Contact twitter @marivibriz Contact email mariavirtudes.brizruiz@telefonica.com
  • 14. Outline • CB-1. Pagination • CB-2. Geolocation (factory) • CB-3. Compound attributes • CB-4. Query entities with compound attributes • CB-5. Update entities with compound attributes • CB-6. Custom metadata 14
  • 15. CB-1. Pagination • Prerequisites – Access to Orion instance running in workshop.tidnode.cl port 1026 • Steps – Check how many entities of type Sensor are stored in that Orion instance – Write a program (or web/mobile application) that • Asks for a limit and a page number • Returns the name IDs the entities of type Sensor in the corresponding page – Run and test your program/application • Hints – Orion User Manual section 3.5.1 (queryContext?limit=100&details=on) Medium
  • 16. CB-2. Geolocation (factory) • Prerequisites – Access to Orion instance running in workshop.tidnode.cl port 1026 • Steps – Write a program (or web/mobile application) that • Gets all existing types • Gets all entities of each type in areas Red, Green and Blue (see next slide), printing entity IDs and their attributes which their values – Run and test your program/application • Hints – Orion User Manual section 3.5.20 Medium
  • 17. 17 -33.596620, -70.666825 -33.607682, -70.670730 -33.6100089, -70.643231 -33.599194, -70.640200 CB-2. Geolocation (factory) Medium
  • 18. 18 -33.596620, -70.666825 -33.607682, -70.670730 -33.6100089, -70.643231 -33.599194, -70.640200 -33.603458, -70.652788 -33.606123, -70.653790 -33.604231, -70.646032 -33.607108, -70.646781 -33.602391, -70.661781 x 200m CB-2. Geolocation (factory) Medium
  • 19. CB-3. Compound attributes • Prerequisites – Exercise CB-1 • Steps – Create the following entities in your Orion instance • See table in next slide • Hints – Orion User Manual section 3.5.19 Medium
  • 20. CB-3. Compound attributes Entity Type Attr. Name Attr. Type Example value Character Name string Fooy Hitpoints integer 110 Class string Barbarian Abilities compound { "STR": "2", "DEX": "4", "CON": "3", "INT": "1", "WIS": "1", "CHA": "2" } Inventory compound { "weapons": [ "sword", "dagger" ], "potions": { "life": "1", "mana": "0" }, "other": ["shield"] } Entity name Entity Type Gandalf Character Aragorn Character Frodo Character Medium
  • 21. CB-4. Query entities with compound attributes • Prerequisites – Exercise CB-1 • Steps – Write a program (or web/mobile application) that does the following queries and print the result • Obtain all attributes of Aragorn entity • Obtain only the Abilities attribute of Frodo entity – Run and test your program/application • Hints – Orion User Manual section 3.5.19 Medium
  • 22. CB-5. Update entities with compound attributes • Prerequisites – Exercise CB-1 • Steps – Write a program (or web/mobile application) that • Asks for an object name (e.g. “staff”, “hat”, etc.) • Updates Gandalf's Inventory attribute to reflect that he now has a that object test your program – Run and test your program/application • Query the Gandalf's Inventory after that, in order to check that the object has been successfully added • Hints – Orion User Manual section 3.5.19 Medium
  • 23. CB-6. Custom metadata Medium • Prerequisites – Exercise CB-1 • Steps – Update the Gandalf entity so that the inventory attribute has two new metadatas: • name="Weight", type="float", value="1.2" • name="MaxWeight", type="float", value="20" – Query Gandalf again to see the new metadata atached to the corresponding attribute • Hints – Orion User Manual section 3.5.7
  • 24. Thanks!Thanks! (Number to manuals sections in this presentation are valid at time of writing this –March 9th 2015-, but they may change along time)