Schema.org Query Pattern Types

  • The webpage lists Schema.org-defined query pattern types for Custom Device Actions, with each type name beginning with $SchemaOrg .

  • These types align with standard types defined in Schema.org and some return structured data instead of a single value.

  • Structured data is indicated in the table and requires adding .structured to the parameter name in the deviceExecution section to be received.

  • Examples are provided for implementing and receiving structured data for types like Place, Date, Time, and DateTime.

The following table lists the Schema.org-defined query pattern types for Custom Device Actions. The name of each type starts with $SchemaOrg . These types correspond to the standard types defined in Schema.org .

Some of these types return structured data rather than a single value. These types are indicated in the table. See structured data for more information.

Supported Schema.org types

Type
Example Developer Pattern
Example User Query
Supports Structured Data
read my sms from $SchemaOrg_Date:my_date on sms pro
read my sms from april 1st on sms pro
Yes
blink the flashlight $SchemaOrg_Number:number times
blink the flashlight five times
No
read my sms from $SchemaOrg_Time:my_time on sms pro
read my sms from 5 pm on sms pro
Yes
read my sms from $SchemaOrg_DateTime:my_time on sms pro
read my sms from yesterday noon on sms pro
Yes
show me my meetings on $SchemaOrg_DayOfWeek:day_of_week
show me my meetings on Tuesday
No
turn on the $SchemaOrg_Color:my_color strobe light
turn on the red strobe light
No
show conversion rate for $SchemaOrg_priceCurrency:cur on currency app
show conversion rate for yen on currency app
No
show conversion chart for $SchemaOrg_Distance:dist
show conversion chart for kilometer
No
set temperature to $SchemaOrg_Number:num degrees $SchemaOrg_Temperature:temp
set temperature to 70 degrees fahrenheit
No
watch $SchemaOrg_Organization:organization highlights
watch lakers highlights
No
show me stock price for $SchemaOrg_Organization:organization
show me stock price for Google
No
show top 10 $SchemaOrg_Person:musician songs
show top 10 bruno mars songs
No
show me news about $SchemaOrg_Person:person
show me news about bill gates
No
write review for $SchemaOrg_Place:place
write review for new york
Yes
show traffic on $SchemaOrg_Place:location
show traffic on mountain view
Yes
write review for $SchemaOrg_Product:product
write review for google glass
No
read $SchemaOrg_Book:my_book
read great expectations
No
play the $SchemaOrg_Movie:my_movie movie
review the casablanca movie
No
play next episode of $SchemaOrg_TVSeries:tv_series
play next episode of friends
No
show $SchemaOrg_servesCuisine:my_cuisine restaurants
show italian restaurants
No
add $SchemaOrg_MusicAlbum:album to my queue.
add abbey road to my queue
No
add $SchemaOrg_MusicRecording:song to my favorites.
add with or without you to my favorites.
No
$SchemaOrg_YesNo
$SchemaOrg_YesNo:yesno
Yes
No
$SchemaOrg_URL
Add $SchemaOrg_URL:url
Add google.com
No
$SchemaOrg_Email
Add $SchemaOrg_Email:email
Add john@google.com
No
$SchemaOrg_PhoneNumber
Add $SchemaOrg_PhoneNumber:phonenumber
Add (777) 777-7777
No
$SchemaOrg_Text
What's that song where they say $SchemaOrg_Text:text
What's that song where they say you are my sunshine?
No

Structured data

Some types support structured data being passed back instead of a single value. In the deviceExecution section, add .structured to the parameter name to receive structured data back for these types:

" my-param-name 
": "$ parameter-name 
 .structured 
"

where my-param-name is the user-defined name that is passed back in the params and parameter-name identifies the parameter in the query pattern.

See the following example:

Place

Query

Write review for New York

Action package

  ... 
 "intent" 
 : 
  
 { 
  
 "name" 
 : 
  
 "com.example.intents.Review" 
 , 
  
 "parameters" 
 : 
  
 [ 
  
 { 
  
 "name" 
 : 
  
 "place" 
 , 
  
 "type" 
 : 
  
 "SchemaOrg_Place" 
  
 } 
  
 ], 
  
 "trigger" 
 : 
  
 { 
  
 "queryPatterns" 
 : 
  
 [ 
  
 "write review for $SchemaOrg_Place:place" 
  
 ] 
  
 } 
 }, 
 ... 
 "deviceExecution" 
 : 
  
 { 
  
 "command" 
 : 
  
 "com.example.commands.Review" 
 , 
  
 "params" 
 : 
  
 { 
  
 "placeName" 
 : 
  
 "$place.structured" 
  
 } 
 } 
 ... 
 

Returned params

See LatLng for more information.

  "placeName" 
 : 
  
 { 
  
 "latitude" 
 : 
  
 40.7128 
 , 
  
 "longitude" 
 : 
  
 74.0060 
 } 
 

Date

See Date for more information.

Returned params:

  { 
  
 "year" 
 : 
  
 2018 
 , 
  
 "month" 
 : 
  
 12 
 , 
  
 "day" 
 : 
  
 2 
 } 
 

Time

See TimeOfDay for more information.

Returned params:

  { 
  
 "hours" 
 : 
  
 12 
 , 
  
 "minutes" 
 : 
  
 0 
 , 
  
 "seconds" 
 : 
  
 0 
 , 
  
 "nanos" 
 : 
  
 0 
 } 
 

DateTime

See DateTime for more information.

Returned params:

  { 
  
 "date" 
 : 
  
 { 
  
 "year" 
 : 
  
 2018 
 , 
  
 "month" 
 : 
  
 11 
 , 
  
 "day" 
 : 
  
 30 
  
 }, 
  
 "time" 
 : 
  
 { 
  
 "hours" 
 : 
  
 12 
 , 
  
 "minutes" 
 : 
  
 0 
 , 
  
 "seconds" 
 : 
  
 0 
 , 
  
 "nanos" 
 : 
  
 0 
  
 } 
 } 
 
Design a Mobile Site
View Site in Mobile | Classic
Share by: