Uh oh! We couldn’t find any match.

Please try other search keywords.

Bixby Developer Center

Guides

Bixby Language Keys

Models are written in the Bixby Language, a simple declarative language.in *.bxb files. It is a structured data format like XML or JSON, with an emphasis on:

  • Readability: Quotation marks, commas, and other needless punctuation is minimized.
  • Author-friendly: A format that is suitable for both manual and automated creation, such as declarative domain-specific languages.
  • Simplicity: The data model is even simpler than JSON. All data values are strings.
  • Schema support: Data model simplicity makes schema specification simpler.

In addition to data definition, modeling for Bixby supports conditionals and simple programming directives, as seen in the RollDice action above. Conditionals are defined in Expression Language.

Bixby Language Conventions

In general, for all files in the *.bxb format, use the following conventions:

  • Keys are lowercase-dash-separated
  • Values are enclosed in parentheses
  • Indent 2 spaces

In addition, for modeling, use the following conventions:

  • Concept and action names are of the form module.UpperCamelCaseName
  • Property and input names are lowerCamelCase
  • Constant values (such as cardinality, features, etc.): UpperCamelCase

Here is an example illustrating all these conventions:

indexed-structure (FlightReservation) {
description (A flight reservation with a specific itinerary.)
feature (Archived)
property (reservationId) {
type (FlightReservationId)
}
property (itinerary) {
type (FlightSolution)
}
property (passengers) {
type (FlightPassenger)
max (Many)
}
index (byOrigin) {
key (itinerary.trips.origin)
}
index (byDestination) {
key (itinerary.trips.destination)
}
}

Strings

Strings can be in one of two forms: quote delimited and unquoted literal.

  • Quoted string values are delimited by the double quote mark ("). The following characters can be escaped in a string with a backslash (\):

    • \0: null character
    • \t: tab
    • \b: backspace
    • \n: newline
    • \f: form feed
    • \r: carriage return
    • \": double quote mark
    • \': single quote mark
    • \\: (unescaped) backslash

      In many contexts, quoted strings can contain Expression Language functions. This is a valid string with embedded EL:

      expression ("The next #{value(moonName)} is on #{value(date)}")
  • Unquoted string values are delimited only by their enclosing parentheses:

    description (A flight reservation with a specific itinerary.)
    

    Unquoted strings are literal values. You cannot embed EL, and the backslash character will not escape the next character.

Note

Single quote marks (') are not string delimiters. Writing key ('String') will yield the actual string 'String', with quote marks included. This also means that while key ("") will yield an empty string, key ('') will yield a string of two single quote marks!

Other Requirements

  • Documents must be UTF-8 encoded. Null bytes (0x00) are not permitted.

  • Tokens may be separated by one or more whitespace characters: space (0x20), tab (0x09), newline (0x0A), or carriage return (0x0D).

  • All characters are valid for key names except whitespace characters and the following:
    ( ) { } " ' \

  • All characters are valid for values except whitespace characters and the following:
    ( ) { } " \