Skip to content
AnswerWell geo Documentation

Research · 5 min read · Answerwell

Boolean Type in Structured Data, Web APIs, and SQL

How boolean values are defined in Schema.org, returned from Chrome extension APIs, and parsed or queried in Cloudflare metadata and SQL.

Boolean values express yes/no facts: whether content is free, whether a store allows pets, or whether two identifiers match. Documentation uses the same idea under different names—Boolean in Schema.org, lowercase boolean in Chrome extension APIs, and explicit true/false parsing rules in Cloudflare AI Search custom metadata. This page ties those definitions together so you can mark up pages, read API return types, and configure platform boolean fields without mixing formats.

Schema.org Boolean: which properties use it

Section titled “Schema.org Boolean: which properties use it”

On Schema.org, many predicates expect a value of type Boolean (capitalized in the vocabulary). Property pages state this under “Values expected to be one of these types.” Examples include free, isAccessibleForFree, directApply, contactlessPayment, publicAccess, petsAllowed (also allows Text), and dozens of similar flags such as abridged, doesNotShip, and isFamilyFriendly.

From abridged:

Values expected to be one of these types

Boolean

The same wording appears on cashBack, where Boolean is listed alongside Number—so not every “yes/no” field is boolean-only. requiresSubscription accepts Boolean or MediaSubscription. petsAllowed accepts Boolean or Text (for example when the answer is not strictly true/false).

In JSON-LD, consumers typically expect JSON literals true and false. Strings like "true" are a common authoring mistake and may fail validation or be interpreted inconsistently depending on the parser.

Use a boolean-typed property when the underlying fact is genuinely two-valued and Schema.org defines a property for it—e.g. jobImmediateStart for jobs, isAcceptingNewPatients for medical listings, or valueAddedTaxIncluded on offers. If the vocabulary only allows Boolean, do not substitute a number or free-text string unless the property explicitly permits another type.

Chrome and extension APIs: lowercase boolean returns

Section titled “Chrome and extension APIs: lowercase boolean returns”

Chrome platform documentation describes JavaScript boolean results with the lowercase type name boolean. That matches ECMAScript: methods and properties return the primitives true or false.

The chrome.extension API (Manifest V3) documents members with type boolean, as does the Manifest V2 chrome.extension reference. The same pattern appears on browser.extension (WebExtensions-style naming), chrome.publicSuffix and browser.publicSuffix (return type boolean), chrome.app.window, chrome.webviewTag, and Workbox workbox-broadcast-update.

Schema.org’s Boolean and JavaScript’s boolean describe the same logical type; the difference is documentation convention (vocabulary type label vs language type keyword). API docs do not define alternate string encodings for those return values—you work with actual booleans in code.

Cloudflare Durable Objects DurableObjectId documents an equality check whose result is explicitly boolean:

A boolean. True if equal and false otherwise.

That aligns with Chrome API semantics: a predicate returns true or false, not "yes"/"no" strings.

Cloudflare: parsing booleans in metadata and SQL

Section titled “Cloudflare: parsing booleans in metadata and SQL”

Cloudflare products treat booleans differently depending on layer: ingestion/parsing for metadata vs SQL predicates for three-valued logic.

AI Search custom metadata: accepted string forms

Section titled “AI Search custom metadata: accepted string forms”

Boolean value parsing for boolean fields in AI Search website custom metadata:

For boolean fields, the following values are accepted (case-insensitive):

True values False values true, 1, yes false, 0, no

Any other value is treated as invalid and the field is omitted.

Implications:

  • Authors can use friendly config values (yes / no, 1 / 0), not only JSON true/false.
  • Parsing is case-insensitive for those tokens.
  • Invalid values are not coerced; the field is omitted, which can silently drop filters or facets that depend on that key.

This is stricter and more forgiving at the same time than raw JSON-LD: more input shapes are allowed, but unknown strings disappear instead of becoming false.

The Basin SQL reference lists boolean tests separate from ordinary comparisons:

IS TRUE, IS FALSE, IS NOT TRUE, IS NOT FALSE IS UNKNOWN, IS NOT UNKNOWN

SQL booleans (and nullability) follow three-valued logic: a column can be true, false, or unknown (null). IS TRUE and IS FALSE express intent more clearly than = TRUE when nulls are possible. This is unrelated to Schema.org markup or Chrome API types, but it is how you query boolean columns on Cloudflare’s SQL surface.

Context Type name Typical values Invalid / missing handling
Schema.org properties Boolean JSON true / false in JSON-LD Validator-dependent; strings often wrong
Chrome APIs boolean JS true / false N/A at type level
Cloudflare AI Search metadata boolean field true, 1, yes / false, 0, no (case-insensitive) Other values → field omitted
Basin SQL SQL boolean TRUE / FALSE / NULL Use IS TRUE, IS FALSE, IS UNKNOWN
  1. Quoting booleans in JSON-LD — Using "true" instead of true for properties such as isLiveBroadcast or readonlyValue.
  2. Treating omitted Cloudflare metadata as false — Invalid tokens cause the field to be dropped, not set to false (custom metadata).
  3. Ignoring union types — Setting cashBack as only true/false when a numeric cashback amount is required in some cases.
  4. SQL equality with nulls — Using = FALSE instead of IS FALSE / IS NOT TRUE when nulls exist (SQL reference).
  1. Pick a Schema.org property that should be boolean (for example isGift or smokingAllowed) and confirm your JSON-LD uses literal true or false, matching the property’s allowed types on its Schema.org page.

  2. For a Chrome extension or app API you rely on, open the matching reference page (e.g. browser.publicSuffix or chrome.webviewTag) and verify the member you call is documented as returning boolean; log typeof in your extension code if behavior is unclear.

  3. If you use Cloudflare AI Search custom metadata, cross-check each boolean key against Boolean value parsing and confirm only true/1/yes or false/0/no are sent; fix any other strings so fields are not omitted.

  4. For Basin SQL queries over boolean columns, review predicates against Boolean checks and use IS TRUE / IS FALSE / IS UNKNOWN where nulls are possible.

  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact sentence you are asking about, and we will correct or clarify it.