Facts: Difference between revisions
Featherless (talk | contribs) |
Featherless (talk | contribs) m Clarifications |
||
| Line 1: | Line 1: | ||
This article and Scout's Facts concept take inspiration from [https://wiki.openstreetmap.org/wiki/Tags OpenStreetMap's Tags documentation]. | This article and Scout's Facts concept take inspiration from [https://wiki.openstreetmap.org/wiki/Tags OpenStreetMap's Tags documentation]. | ||
A '''fact''' consists of two components: a ''key'' and a ''value''. Facts describe specific attributes of locations that drivers can observe and update, such as gas prices, amenities, and services available at various establishments. Both components are free-format text fields but often represent numeric or structured data. Conventions for the meaning and use of facts are documented on this wiki | A '''fact''' consists of two components: a ''key'' and a ''value''. Facts describe specific attributes of locations that drivers can observe and update, such as gas prices, amenities, and services available at various establishments. Both components are free-format text fields but often represent numeric or structured data. Conventions for the meaning and use of facts are documented on this wiki. | ||
== Keys and values == | == Keys and values == | ||
Facts are applied to locations | Facts are applied to locations, resulting in a collection of any size. However, each collection may contain a given fact key only once per location. When a fact is absent, default values or inherited assumptions often apply. | ||
The ''key'' describes a topic, category, or type of attribute. Keys can be qualified with prefixes, infixes, or suffixes (usually separated by underscores), forming super- or sub-categories, or [[namespace|namespaces]]. Common namespaces include fuel prices and amenities. | The ''key'' describes a topic, category, or type of attribute. Keys can be qualified with prefixes, infixes, or suffixes (usually separated by underscores), forming super- or sub-categories, or [[namespace|namespaces]]. Common namespaces include fuel prices and amenities. | ||
Revision as of 14:54, 2 September 2025
This article and Scout's Facts concept take inspiration from OpenStreetMap's Tags documentation.
A fact consists of two components: a key and a value. Facts describe specific attributes of locations that drivers can observe and update, such as gas prices, amenities, and services available at various establishments. Both components are free-format text fields but often represent numeric or structured data. Conventions for the meaning and use of facts are documented on this wiki.
Keys and values
Facts are applied to locations, resulting in a collection of any size. However, each collection may contain a given fact key only once per location. When a fact is absent, default values or inherited assumptions often apply.
The key describes a topic, category, or type of attribute. Keys can be qualified with prefixes, infixes, or suffixes (usually separated by underscores), forming super- or sub-categories, or namespaces. Common namespaces include fuel prices and amenities.
The value represents the current state of the fact. Values are typically numbers (integer or decimal) or boolean (e.g., true or false). Values are required for all facts.
Here are examples used in practice:
Lua error: Internal error: The interpreter exited with status 127.– indicates that a car wash is present at this location.Lua error: Internal error: The interpreter exited with status 127.– numeric price for regular gasoline. The fact will also have a volume and currency property in this case.
Optional properties
Beyond the basic key-value structure, facts can include optional properties for additional context.
The volume property specifies units for measurable quantities (e.g., G for gas prices). It clarifies the unit of volume measurement for the value.
The currency property specifies the monetary unit for price-related facts (e.g., USD for US dollars, CAD for Canadian dollars). This ensures price facts are properly contextualized for drivers.
key=value syntax
In discussions and tools, facts are commonly referenced using key=value syntax. For facts with volume or currency properties, use the extended syntax: key=value|volume=unit|currency=code. Keys or values may be quoted to avoid confusion: key="value" or "key"="value". The quotes, equals signs, and pipe symbols are not part of the actual fact content.
On this wiki, you can refer to a fact using key=value syntax by including the Template:Tl template.