Ir al contenido

Layout Query Grammar

Esta página aún no está disponible en tu idioma.

A layout query is one Boolean expression in Browse. It can read layout fields or values from saved metrics; it does not read the windows of an analysis report.

The layout list can narrow to published designs that define combos. Test origin with = and require has_chords:

origin = "published" & has_chords

Fields and their aliases are listed in layout fields and operators. Double quotes delimit text; only the saved ID in metric uses single quotes. A decimal starts with a digit, as in 0.025; signs are unary operators. Whitespace between tokens is optional. The language has no comments.

Use a Boolean feature directly, a text comparison such as name ~ "Dvorak", or a numeric comparison such as year >= 2020. The name example uses ~ to test a substring. The year example uses >= to test a lower bound. Equality is written = in a layout query. Ordered comparisons require numbers. A comparison has one operator, so combine two bounds with &.

To find variants of either Dvorak or Colemak that define combos, group two name tests joined with | before applying &:

(name ~ "Dvorak" | name ~ "Colemak") & has_chords

Without parentheses, & binds before |. A power binds before a unary minus and associates to the right.

A repeated group in braces can occur zero or more times, and square brackets mark an optional piece. Every complete filter must consume all its input and produce a Boolean value.

filter = or ;
or = and { "|" and } ;
and = comparison { "&" comparison } ;
comparison = sum [ ("=" | "!=" | "~" | "<" | "<=" | ">" | ">=") sum ] ;
sum = product { ("+" | "-") product } ;
product = unary { ("*" | "/") unary } ;
unary = ("!" | "-") unary | power ;
power = primary [ "^" unary ] ;
primary = field | text | number | "true" | "false"
| "metric" "(" metric-id ")" | "(" or ")" ;
number = digits [ "." { digit } ] ;
digits = digit { digit } ;
field = a cataloged field name or alias ;
text = double-quoted string ;
metric-id = nonempty single-quoted string ;

Layout syntax#

Layout queries are complete Boolean expressions over metadata, authored feature fields, and saved metric results. They are parsed separately from metric queries.

Precedence from lowest to highest is |, &, comparisons, + and -, * and /, unary ! and -, then right-associative ^. Parentheses override precedence. Boolean & and | short-circuit from left to right.

String = and != compare exact values; ~ tests whether the left string contains the right string. Ordered comparisons and arithmetic require numbers. Boolean fields are used directly rather than compared with =.

Layout query literals#

"text" | 1.5 | true | false

Double-quoted strings, finite decimal numbers, true, and false are literals. Strings accept escaped quotes, backslashes, newlines, carriage returns, and tabs.