Structured Data and Action Block 5 Part of
Structured Data and Action Block 5 Part of the course “VU Booking and Yield Management” SS 2018 25. 05. 2018 / 29. 05. 2018
Agenda No. Date Group-0 Group-1 1 Tue, 2018 -04 -10 SR 2 SR 3 2 Fri, 2018 -04 -13 3 Tue, 2018 -04 -17 4 Tue, 2018 -04 -24 5 Fri, 2018 -05 -04 6 Tue, 2018 -05 -08 7 Tue, 2018 -05 -15 8 Fri, 2018 -05 -18 9 Tue, 2018 -05 -22 10 Fri, 2018 -05 -25 11 Tue, 2018 -05 -29 Group-2 SR 2 SR 3 SR 2 SR 3 SR 2 Page 2
Where we are? Topic Distribution per Block / Day 1. Introduction, History and Theory of Revenue Management 2. Estimation, Forecasting and Overbooking Theory, foundations 3. Empirical Booking and Yield Management 4. Hotel Online Distribution 5. Structured Data and Action Practice, state of the art Page 3
References ● Introduction to Structured Data, https: //developers. google. com/search/docs/guides/intro-structureddata ● A voice and text-based conversational interface, https: //dialogflow. com/ ● Schema. org Actions, http: //schema. org/Action ● E-mail Markup, https: //developers. google. com/gmail/markup/ Seite 4
Topics 1. Structured Data 2. Schema. org Action 3. Schema. org Action for Email Seite 5
1. Structured Data 6
Motivation (1) ● Why do we need to learn about structured data? ● What is the relationship between structured data and our course? ● We would like to hand over our tasks to computer. Therefore computer needs to be more intelligent, should be able to: ○ Book a hotel room based on our preferences automatically ○ Find the cheapest accommodation from multiple booking channels ○ Combine multiple offers into one package, dynamically and automatically Seite 7
Motivation (2) Seite 8
A Use Case (1) “I would like to spend my 3 days holiday in Vienna next week” ● Computer should understand what you want: ○ Vienna is a City, located in Austria, with geo-location at (48. 210033, 16. 363449) ○ Next week is a Date, one week from Today ○ 3 days is a Number for duration Seite 9
A Use Case (2) ● Computer needs to think: ○ Your current location is not in Vienna (e. g. Innsbruck), the distance is about 470 km ○ Today is 10. 03, so next week is 17. 03 ● Computer needs to make decisions: ○ To go to Vienna, you need to buy a ticket for flight or train or bus ○ Which area of the city is the best to stay for next week ○ Events that will be interesting for you Seite 10
A Use Case (3) “I am going to Landeck for teaching but my car is broken on the highway” ● Computer should understand what you want ● Computer needs to think ● Computer needs to make decisions: ○ Send e-mail to students, inform that the lecture will start a bit late ○ Contact the nearest auto-repair shop and request for help ○ Contact your insurance company and report the case Seite 11
Structured Data - Introduction (1) ● Unstructured data ○ does not have a pre-defined data model or is not organized in a predefined manner ○ typically text-heavy, but may contain data such as dates, numbers, and facts as well ○ produces irregularities and ambiguities ● A data model ○ an abstract model that organizes elements of data ○ standardizes how elements relate to one another and to properties of the real world entities Seite 12
Structured Data - Introduction (2) How does structured data contribute to making computer become more intelligent? 1. When information is highly structured and predictable, search engines can more easily organize and display it in creative ways 2. When information is highly structured and predictable, artificial intelligence assistants can be more engaging with users Seite 13
Search Result Enhancements (1) ● Carousel - display your rich results in a sequential list or gallery Seite 14
Search Result Enhancements (2) ● Logo, corporate contact, social profiles infromation are displayed on Google Knowledge panels Seite 15
Search Result Enhancements (3) ● Business details displayed prominently in the Knowledge Graph card. Seite 16
Search Result Enhancements (4) ● An organized event, such as a concert or art festival, that people may attend at a particular time and place. Seite 17
Creating Structured Data (1) “George Bush, the 41 st President of the United States is the father of George W. Bush, the 43 rd President of the United States” { } "@context": "http: //schema. org", "@type": "Person", "name": "George Bush", "disambiguating. Description": "41 st President of the US", "children": { "@type": "Person", "name": "George W. Bush", "disambiguating. Description": "43 rd President of the US" } Seite 18
Creating Structured Data (2) “A restaurant named ‘Fondue for Fun and Fantasy’ is fantastic and fun for all your cheesy occasions. It is open from 11: 30 to 23: 00 every day. Its menu is available online on http: //fondueforfun. com/menu, and can be ordered by calling the telephone number +43 (512) 123 -45678” { } "@context": "http: //schema. org", "@type": "Restaurant", "name": "Fondue for Fun and Fantasy", "description": "Fantastic and fun for all your cheesy occasions", "opening. Hours": "Mo, Tu, We, Th, Fr, Sa, Su 11: 30 -23: 00", "telephone": "+43 (512) 123 -45678", "menu": "http: //fondueforfun. com/menu" Seite 19
Creating Structured Data (3) “Ghostbusters was produced by Black Rhino in the United States” { "@context": "http: //schema. org/", "@type": "Movie", "name": "Ghostbusters", "production. Company": { "@type": "Organization", "name": "Black Rhino" }, "country. Of. Origin": { "@type": "Country", "name": "USA" } } Seite 20
Creating Structured Data (4) Seite 21
Creating Structured Data (5) Seite 22
Creating Structured Data (6) Seite 23
Creating Structured Data (7) Seite 24
Creating Structured Data (8) Seite 25
● A tool to create, publish and validate structured data Semantify. it (1) Seite 26
● A tool to create, publish and validate structured data Semantify. it (2) Seite 27
Summary ● Adding structured data to a website could increase online visibility of the website ● Personal digital assistants and chatbots would consume structured data to make intelligent decisions ● Creating structured data is a challenging task, tools are required to make sure created structured data are valid ● Semantify. it is a tool to create, publish and validate structured data Seite 28
2. Schema. org Action 29
What was missing? We know how to represent a hotel room Seite 30
What was missing? How can we represent these? Reserve a Hotel Room Buy an Offer Review a Movie Check-in to a Flight Seite 31
What was missing? How can we represent these? Reserve a Hotel Room Buy an Offer Review a Movie Check-in to a Flight Schema. org Actions Seite 32
What are Schema. org Actions? ● Released in April 2014 ● “. . . our main focus was on providing vocabularies for describing entities --- people, places, movies, restaurants, . . . But the Web is not just about static descriptions of entities. It is about taking action on these entities --- from making a reservation to watching a movie to commenting on a post. ” (*) http: //blog. schema. org/2014/04/announcing-schemaorg-actions. html Seite 33
What are Schema. org Actions? An example: Elias cooked a Speckknödel recipe. schema: Person schema: Cook. Action schema: Recipe Seite 34
What are Schema. org Actions? ● Schema. org currently offers 110 actions ● All actions are subclass of class Action ● Action status: Potential. Action, Active. Action, Completed. Action ● Everything can have potential action(s) ○ A book can have read or write action ○ A movie can have watch or review action Seite 35
What are Schema. org Actions? Seite 36
Why should we use them? ● “Headless web” - Everything is powered by the web, but you never see a browser (*) ● Describe operations alongside the data to enable automated agents ○ Virtual assistants can perform a search and bring results without redirecting the user to a webpage ○ E-Mail clients might provide actions extracted from e-mails (e. g. Flight check-in) ○ Chatbots may complete actions like reserving a table from a restaurant without heavy API integrations (*) https: //paul. kinlan. me/the-headless-web/ Seite 37
How: Reserve a Hotel Room Seite 38
Hotel Room Annotation: How: Reserve a Hotel Room { "@context": "http: //schema. org/", "@id": "http: //examplehotel. com/rooms/123", "@type": ["Hotel. Room", "Product"] "url": "http: //examplehotel. com/rooms/123", "potential. Action": { "@type": "Reserve. Action", "target": { "@type": "Entry. Point", "url. Template": "https: //examplehotel. com/rooms/123/reserve", "encoding. Type": "application/ld+json", "content. Type": "application/ld+json" }, "result": { "@type": "Lodging. Reservation", "checkin. Time-output": "required", "lodging. Unit. Type-output": "required", "num. Adults-input": "required", "num. Children-input: "required" } } } Seite 39
How: Reserve a Hotel Room Request: POST https: //examplehotel. com/rooms/123/reserve Response : { "@context": "http: //schema. org/", "@type": "Reserve. Action", "action. Status": "Completed. Action. Status", "object": " http: //examplehotel. com/rooms/123", "result": { "@type": "Lodging. Reservation", "checkin. Time": "12: 00", "lodging. Unit. Type": "Suite" } } } Seite 40
Buy. Action Annotation: { "@context": "http: //schema. org/", "@type": "Buy. Action", "agent": { "@type": "Person", "given. Name-input": "required", "family. Name-input": "required", "email-input": "required" }, "object": { "@type": "Offer", "name": "Beautiful room for two", "item. Offered": "http: //examplehotel. com/rooms/123", "url-input": "required", "price. Specification": { "@type": "Price. Specification", "price": "90", "price. Currency": "EUR" }}, "result": { "@type": "Order", "is. Gift-input": "required", "order. Date-output": "required" }, "target": { "@type": "Entry. Point", "url. Template": "http: //examplehotel. com/offer/buy ", "http. Method" : "POST" } How: Buy an Offer } Seite 41
Request: POST https: //examplehotel. com/offer/buy { "@context": "http: //schema. org/", "@type": "Buy. Action", "agent": { "@type": "Person", "given. Name": "Frank", "family. Name": "Sinatra", "email": "frank. sinatra@kingofjazz. com " }, "object": { "@type": "Offer", "name": "Beautiful room for two", "item. Offered": "http: //examplehotel. com/rooms/123", "@id": "http: //examplehotel. com/offers/345" , "price. Specification": { "@type": "Price. Specification", "price": "90", "price. Currency": "EUR" }}, "result": { "@type": "Order", "is. Gift": "False" }} How: Buy an Offer Response: { "@context": "http: //schema. org/", "@type": "Buy. Action", "action. Status": "Completed. Action. Status", "result": { "@type": "Order", "order. Date": "11. 10. 2016" }} Seite 42
How: Describing the Search Functionality <script type="application/ld+json"> { "@context": "http: //schema. org", "@type": "Web. Site", "url": "https: //www. example. com/ ", "potential. Action": [{ "@type": "Search. Action", "target": "https: //query. example. com/search? q={search_term_string }", "query-input": "required name=search_term_string" }, { "@type": "Search. Action", "target": "androidapp: //com. example/https/query. example. com/search/? q={search_term_string}", "query-input": "required name=search_term_string" }] } </script> Seite 43 https: //developers. google. com/search/docs/data-types/sitelinks-searchbox
Summary ● Schema. org Actions are used for representing actions that can be taken on entities ● Already being consumed by many applications ● An important development for enabling automated agents Seite 44
3. Schema. org Action for Email 45
Introduction (1) E-Mail markup benefits: ● Highlights in Inbox - Highlight your emails with important information and actions in Inbox by Gmail ● Add Actions to Emails - Increase your users' engagement with interactive buttons in your emails ● Answers in Search - Emails with markup appear in Google Search results when users search for tickets, flights and events ● Confirmation Cards - Present cards to the user in the right place and at the right time Seite 46
Introduction (2) Supported actions in Gmail Markup: 1. RSVP Action for events 2. Review Action for restaurants, movies, products and services 3. One-click Action for just about anything that can be performed with a single click 4. Go-to Action for more complex interactions 5. Flight interactive cards (*) https: //developers. google. com/gmail/markup/ Seite 47
View Action <script type="application/ld+json"> { "@context": "http: //schema. org", "@type": "Email. Message", "potential. Action": { "@type": "View. Action", "target": "https: //www. youtube. com/watch? v=r. Tb 2 q. WSo. Vso "name": "Watch movie" }, "description": "Watch the 'Avengers' movie online" } </script> Seite 48
RSVP Action (1) <script type="application/ld+json"> { "@context": "http: //schema. org", "@type": "Event", "name": "Taco Night", "start. Date": "2027 -04 -18 T 15: 30: 00 Z", "end. Date": "2027 -04 -18 T 16: 30: 00 Z", "location": { "@type": "Place", "address": { "@type": "Postal. Address", "name": "Google", "street. Address": "24 Willie Mays Plaza", "address. Locality": "San Francisco", "address. Region": "CA", "postal. Code": "94107", "address. Country": "USA" } }, "potential. Action": [. . . ] } </script> Seite 49
RSVP Action (2) <script type="application/ld+json"> {. . . "potential. Action": [ { "@type": "Rsvp. Action", "rsvp. Response": "yes", "handler": { "@type": "Http. Action. Handler", "url": "http: //mysite. com/rsvp? event. Id=123&value=yes" }, "attendance": "http: //schema. org/Rsvp. Attendance/Yes" }, { "@type": "Rsvp. Action", "rsvp. Response": "no", "handler": { "@type": "Http. Action. Handler", "url": "http: //mysite. com/rsvp? event. Id=123&value=no" }, "attendance": "http: //schema. org/Rsvp. Attendance/No" }, { "@type": "Rsvp. Action", "rsvp. Response": "maybe", "handler": { "@type": "Http. Action. Handler", "url": "http: //mysite. com/rsvp? event. Id=123&value=maybe" }, "attendance": "http: //schema. org/Rsvp. Attendance/Maybe" } ] } </script> Seite 50
Flight Reservations 1. Basic flight confirmation 2. Boarding pass 3. Check-in button 4. Updates a flight 5. Cancel a flight 6. Multiple flight segments Seite 51
Flight Reservation (1) Seite 52
Flight Reservation (2) <script type="application/ld+json"> { "@context": "http: //schema. org", "@type": "Flight. Reservation", "reservation. Number": "RXJ 34 P", "reservation. Status": "http: //schema. org/Confirmed", "under. Name": { "@type": "Person", "name": "Eva Green" }, "reservation. For": { "@type": "Flight", "flight. Number": "110", "airline": { "@type": "Airline", "name": "United", "iata. Code": "UA" }, "departure. Airport": { "@type": "Airport", "name": "San Francisco Airport", "iata. Code": "SFO" }, "departure. Time": "2027 -03 -04 T 20: 15: 00 -08: 00", "arrival. Airport": { "@type": "Airport", "name": "John F. Kennedy International Airport", "iata. Code": "JFK" }, "arrival. Time": "2027 -03 -05 T 06: 30: 00 -05: 00" }, "checkin. Url": "http: //united. com/onlinecheckin. html", "modified. Time": "2027 -03 -01 T 08: 30: 00 -08: 00", "modify. Reservation. Url": "http: //united. com/modifyreservation. html" } </script> Seite 53
Hotel Reservations <script type="application/ld+json"> { "@context": "http: //schema. org", "@type": "Lodging. Reservation", "reservation. Number": "abc 456", "reservation. Status": "http: //schema. org/Confirmed", "under. Name": { "@type": "Person", "name": "John Smith" }, "reservation. For": { "@type": "Lodging. Business", "name": "Hilton San Francisco Union Square", "address": { "@type": "Postal. Address", "street. Address": "333 O'Farrell St", "address. Locality": "San Francisco", "address. Region": "CA", "postal. Code": "94102", "address. Country": "US" }, "telephone": "415 -771 -1400" }, "checkin. Date": "2027 -04 -11 T 16: 00 -08: 00", "checkout. Date": "2027 -04 -13 T 11: 00 -08: 00" } </script> Seite 54
Update Reservations <script type="application/ld+json"> { "@context": "http: //schema. org", "@type": "Lodging. Reservation", "reservation. Number": "abc 456", "reservation. Status": "http: //schema. org/Confirmed", "under. Name": { "@type": "Person", "name": "John Smith" }, "reservation. For": { "@type": "Lodging. Business", "name": "Hilton San Francisco Union Square", "address": { "@type": "Postal. Address", "street. Address": "333 O'Farrell St", "address. Locality": "San Francisco", "address. Region": "CA", "postal. Code": "94102", "address. Country": "US" }, "telephone": "415 -771 -1400" }, "checkout. Date": "2027 -04 -13 T 11: 00 -08: 00", "checkin. Date": "2027 -04 -10 T 16: 00 -08: 00", "modified. Time": "2027 -05 -01 T 08: 00 -08: 00", "modify. Reservation. Url": "http: //united. com/modifyreservation. html" } </script> Seite 55
Cancel Reservations <script type="application/ld+json"> { "@context": "http: //schema. org", "@type": "Lodging. Reservation", "reservation. Number": "abc 456", "reservation. Status": "http: //schema. org/Confirmed", "under. Name": { "@type": "Person", "name": "John Smith" }, "reservation. For": { "@type": "Lodging. Business", "name": "Hilton San Francisco Union Square", "address": { "@type": "Postal. Address", "street. Address": "333 O'Farrell St", "address. Locality": "San Francisco", "address. Region": "CA", "postal. Code": "94102", "address. Country": "US" }, "telephone": "415 -771 -1400" }, "checkout. Date": "2027 -04 -13 T 11: 00 -08: 00", "checkin. Date": "2027 -04 -10 T 16: 00 -08: 00", "modified. Time": "2027 -05 -01 T 08: 00 -08: 00", "cancel. Reservation. Url": "http: //united. com/modifyreservation. html" } </script> Seite 56
How: View Action <script type="application/ld+json"> { "@context": "http: //schema. org", "@type": "Email. Message", "description": "Watch the University of UMIT", "potential. Action": { "@type": "View. Action", "target": "https: //www. youtube. com/watch? v=r. Tb 2 q. WSo. Vso", "name": "Watch This Very Cool Video" } } </script> Seite 57
How: RSVP <script type="application/ld+json"> { "@context": "http: //schema. org", "@type": "Event", "name": "Booking and Yield Management", "start. Date": "2018 -05 -25 T 09: 00 Z", "end. Date": "2018 -05 -25 T 14: 15: 00 Z", "location": { "@type": "Place", "address": { "@type": "Postal. Address", "name": "UMIT Landeck", "street. Address": "Eduard-Wallnöfer-Zentrum 1", "address. Locality": "Hall in Tirol", "address. Region": "Tyrol", "postal. Code": "6060", "address. Country": "AT" }}, "potential. Action": [ { "@type": "Rsvp. Action", "rsvp. Response": "yes", "handler": {"@type": "Http. Action. Handler", "url": "http: //mysite. com/rsvp? event. Id=123&value=yes"}, "attendance": "http: //schema. org/Rsvp. Attendance/Yes" }, { "@type": "Rsvp. Action", "rsvp. Response": "no", "handler": {"@type": "Http. Action. Handler", "url": "http: //mysite. com/rsvp? event. Id=123&value=no"}, "attendance": "http: //schema. org/Rsvp. Attendance/No" }, { "@type": "Rsvp. Action", "rsvp. Response": "maybe", "handler": {"@type": "Http. Action. Handler", "url": "http: //mysite. com/rsvp? event. Id=123&value=maybe"}, "attendance": "http: //schema. org/Rsvp. Attendance/Maybe" }] } </script> Seite 58
{ How: Flight Reservation } "@context": "http: //schema. org", "@type": "Flight. Reservation", "reservation. Number": "RXJ 34 P", "reservation. Status": "http: //schema. org/Confirmed", "under. Name": { "@type": "Person", "name": "John Smith" }, "reservation. For": { "@type": "Flight", "flight. Number": "110", "airline": { "@type": "Airline", "name": "Austrian", "iata. Code": "AUA" }, "departure. Airport": { "@type": "Airport", "name": "Innsbruck Airport", "iata. Code": "INN" }, "departure. Time": "2018 -05 -25 T 08: 15: 00 Z", "arrival. Airport": { "@type": "Airport", "name": "Landeck Airport", "iata. Code": "LDK" }, "arrival. Time": "2018 -05 -25 T 09: 00 Z" }, "checkin. Url": "http: //austrian. com/onlinecheckin. html" Seite 59
Summary ● Adding structured data and actions in emails would increase user engagement, such as: ○ Interactive buttons ○ Confirmation cards ● As an example, Gmail has been using schema. org markup to accelerate user actions and to highlight the most important information users need from an email. Seite 60
Structured Data and Action Hands-on Exercise
Task To create structured data with action for email: 1. Go-To Action - View Action 2. Rsvp Action - Yes/Maybe/No 3. Flight Reservation - Basic flight information and a check-in button Tools: 1. Semantify. it, https: //semantify. it/ 2. Email Markup Tester Tool: https: //www. google. com/webmasters/markup-tester/ Seite 62
semantify. it - Login Seite 63
semantify. it – Annotation Template Seite 64
semantify. it – New annotation Seite 65
semantify. it - Email Message - View Action Seite 66
semantify. it - Event + Rsvp Action • Use the correct format (e. g. 2027 -04 -18 T 15: 30: 00 Z), see http: //schema. org/Date. Time Seite 67
semantify. it - Event + Rsvp Action • Use the following URLs for the property “attendance”: http: //schema. org/Rsvp. Attendance/No, http: //schema. org/Rsvp. Attendance/Yes, http: //schema. org/Rsvp. Attendance/Maybe. Seite 68
semantify. it - Flight Reservation + Check. In Action • Use the correct format (e. g. 2027 -04 -18 T 15: 30: 00 Z), http: //schema. org/Date. Time Seite 69
Google Apps Script • Login with your Google account Seite 70
Google Apps Script • Visit script. google. com. • Use Google Apps Script tutorial: https: //developers. google. com/gmail/markup /apps-script-tutorial • Create a new project. • Replace the code in Code. gs with the following and save it: Seite 71
Google Apps Script • Select File > New > Html file • Add html tags <script type="application/ld+json"> and </script> and insert your annotation from semantify. it Seite 72
Google Apps Script Seite 73
Google Apps Script • Change the parameter mail_template to match the name of your Html file. • Run the function to get the email Seite 74
Evaluation • Go to link https: //www. surveymonkey. com/r/JTL 8 KXT and submit the evaluation form Seite 75
- Slides: 75