Uh oh! We couldn’t find any match.

Please try other search keywords.

Bixby Developer Center

Guides

Property Projections

There are times that your capsule's code or training needs to refer to a property of a concept rather than the concept as a whole. For example, a user might be asking just for a temperature in a location, rather than the whole weather forecast: "What will the high be in San Francisco tomorrow?" Or, for another example, your capsule's dialog might need to match on a concept that's a property of a structure, such as the range of open hours for a business. You can accomplish this through property projections.

Training on Properties

Take the previous example of asking for the high temperature in San Francisco. Bixby needs to get San Francisco's weather report, but the dialog should return only the high temperature:

Temperature

For Bixby to properly understand this utterance, it needs to be trained with a property as a goal, not a concept. To refer to a property, append the property name to its concept's name separated by a hash (#):

viv.weather.Weather#highTemperature

By setting that as a training goal, you tell Bixby that this utterance's intent and goal is the highTemperature property of the viv.weather.Weather concept.

Matching on Properties

The from-property key lets you specify a property within a structure concept to match against. For instance, a dialog for a ride sharing service might want to match against price ranges:

dialog (Concept) {
match: PriceRange (this) {
from-property: RideShare(rideShare)
}
switch (plural (this)) {
case (One) {
template ("price for #{concept (rideShare)}")
}
default {
template ("prices for #{concept (rideShare)}")
}
}
}

The match key matches against the PriceRange concept; from-property specifies that the matched PriceRange must be a property of a RideShare concept. RideShare is a structure concept which includes a priceRange property:

structure (RideShare) {
description (a ride-share service)

property (priceRange) {
type (PriceRange)
}
...
}

You can also match on the _ wildcard for greater flexibility. For example, this dialog matches against any ReviewCount concept that's used as a property of any other structure concept:

dialog (Concept) {
match {
ReviewCount (this) {
from-property: _
}
}
switch (this) {
case(1.0) {
template ("review")
}
default{
template ("reviews")
}
}
}

Property Visibility

To use a property in a property projection, it must be "visibile" to the planner. By default, properties are only visible at the goal, so they cannot be used as inputs for actions.

The visibility of properties is controlled with the visibility key. This can be set to one of three values:

  • Public properties are fully exposed to the planner, allowing property projections to occur at any point in plan execution.
  • Private properties are hidden from the planner, and are only available in action implementation, dialog, and layouts.
  • Default visibility exposes a property to the planner only at the goal, allowing for property projections and sorts at the goal.

In this example, the property named type (the type of shoe) is made public, so it can be used for property projections or as an input for other actions:

structure (Shoe) {
property (name) {
type (Name)
min (Required)
}
property (type) {
type (Type)
min (Required)
// make property visible for projections and action input
visibility (Public)
}
}