Page Summary
-
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
.structuredto the parameter name in thedeviceExecutionsection 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
$SchemaOrg_Date:my_date
on sms pro$SchemaOrg_Number:number
times$SchemaOrg_Time:my_time
on sms pro$SchemaOrg_DateTime:my_time
on sms pro$SchemaOrg_DayOfWeek:day_of_week
$SchemaOrg_priceCurrency:cur
on currency app$SchemaOrg_Distance:dist
$SchemaOrg_Number:num
degrees $SchemaOrg_Temperature:temp
$SchemaOrg_Organization:organization
highlights$SchemaOrg_Organization:organization
$SchemaOrg_Person:person
$SchemaOrg_TVSeries:tv_series
$SchemaOrg_servesCuisine:my_cuisine
restaurants$SchemaOrg_MusicRecording:song
to my favorites.$SchemaOrg_YesNo:yesno
$SchemaOrg_URL:url
$SchemaOrg_Email:email
$SchemaOrg_PhoneNumber:phonenumber
$SchemaOrg_Text:text
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
}
}


