Schemas / common
Open Coffee common definitions v0.1.0
Building blocks shared by every Open Coffee dataset (coffee places now; roasters, beans and gear later). Reference them by absolute $id plus a JSON pointer.
- $id
https://schema.roastbook.coffee/common/common.schema.v0.1.0.json
Identifier
Permanent, opaque identifier. Never reused, never derived from a name, never deleted.
idtextPermanent, opaque identifier. Never reused, never derived from a name, never deleted.
Defined in
common.schema.v0.1.0.json#/$defs/id
Date
Calendar date, YYYY-MM-DD.
datedateCalendar date, YYYY-MM-DD.
Defined in
common.schema.v0.1.0.json#/$defs/date
Timestamp
RFC 3339 timestamp with time zone, for example 2026-11-05T14:00:00Z.
datetimetimestampRFC 3339 timestamp with time zone, for example 2026-11-05T14:00:00Z.
Defined in
common.schema.v0.1.0.json#/$defs/datetime
URL
Absolute http or https URL.
urlURLAbsolute http or https URL.
Defined in
common.schema.v0.1.0.json#/$defs/url
Country code
ISO 3166-1 alpha-2 code in upper case.
country_codetextISO 3166-1 alpha-2 code in upper case.
Defined in
common.schema.v0.1.0.json#/$defs/country_code
Currency
ISO 4217 currency code.
currencytextISO 4217 currency code.
Defined in
common.schema.v0.1.0.json#/$defs/currency
Postal address
Street and house number.
Postal code as used locally, for example 80331.
City or town.
State or region.
ISO 3166-1 alpha-2 code in upper case.
Defined in
common.schema.v0.1.0.json#/$defs/country_code
Coordinates
WGS 84 coordinates of the entrance or building.
Latitude in decimal degrees (WGS 84); positive is north of the equator, for example 48.1371.
Longitude in decimal degrees (WGS 84); positive is east of Greenwich, for example 11.5754.
Image
An openly licensed image. Each image carries its own licence, author and source.
Where the file is served from (our assets folder or the original host).
Defined in
common.schema.v0.1.0.json#/$defs/urlSPDX identifier, for example CC-BY-4.0, CC-BY-SA-4.0 or CC0-1.0.
Name of the photographer or creator, as the licence requires it to be credited.
Page describing the original file and its licence.
Defined in
common.schema.v0.1.0.json#/$defs/urlShort caption describing what the image shows.
Width of the image file in pixels.
Height of the image file in pixels.
External reference
A pointer to a record in another service. Never stores the other service's values.
Short name of the other service, for example tripadvisor or untappd. Lowercase letters, digits, dots, dashes and underscores.
The record's identifier in the other service.
Absolute http or https URL.
Defined in
common.schema.v0.1.0.json#/$defs/url
Dataset metadata
File-level facts that are not records. The schema version is the $schema URL; the data version is the release tag.
Licence of the file: MIT, with the copyright notice “Roastbook Open Coffee contributors”.
Raw JSON
Show common.schema.v0.1.0.json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schema.roastbook.coffee/common/common.schema.v0.1.0.json",
"title": "Open Coffee common definitions",
"description": "Building blocks shared by every Open Coffee dataset (coffee places now; roasters, beans and gear later). Reference them by absolute $id plus a JSON pointer.",
"$defs": {
"id": {
"title": "Identifier",
"description": "Permanent, opaque identifier. Never reused, never derived from a name, never deleted.",
"type": "string",
"pattern": "^[a-z0-9_.-]+$",
"minLength": 3,
"maxLength": 64,
"examples": [
"cp-7k2m9x4qvd"
]
},
"date": {
"title": "Date",
"description": "Calendar date, YYYY-MM-DD.",
"type": "string",
"format": "date"
},
"datetime": {
"title": "Timestamp",
"description": "RFC 3339 timestamp with time zone, for example 2026-11-05T14:00:00Z.",
"type": "string",
"format": "date-time"
},
"url": {
"title": "URL",
"description": "Absolute http or https URL.",
"type": "string",
"format": "uri",
"pattern": "^https?://"
},
"country_code": {
"title": "Country code",
"description": "ISO 3166-1 alpha-2 code in upper case.",
"type": "string",
"pattern": "^[A-Z]{2}$"
},
"currency": {
"title": "Currency",
"description": "ISO 4217 currency code.",
"type": "string",
"pattern": "^[A-Z]{3}$"
},
"address": {
"title": "Postal address",
"type": "object",
"required": [
"country_code"
],
"additionalProperties": false,
"properties": {
"street_address": {
"type": "string",
"minLength": 1,
"description": "Street and house number."
},
"postal_code": {
"type": "string",
"minLength": 1,
"description": "Postal code as used locally, for example 80331."
},
"locality": {
"type": "string",
"minLength": 1,
"description": "City or town."
},
"region": {
"type": "string",
"minLength": 1,
"description": "State or region."
},
"country_code": {
"$ref": "#/$defs/country_code"
}
}
},
"location": {
"title": "Coordinates",
"description": "WGS 84 coordinates of the entrance or building.",
"type": "object",
"required": [
"lat",
"lon"
],
"additionalProperties": false,
"properties": {
"lat": {
"type": "number",
"minimum": -90,
"maximum": 90,
"description": "Latitude in decimal degrees (WGS 84); positive is north of the equator, for example 48.1371."
},
"lon": {
"type": "number",
"minimum": -180,
"maximum": 180,
"description": "Longitude in decimal degrees (WGS 84); positive is east of Greenwich, for example 11.5754."
}
}
},
"image": {
"title": "Image",
"description": "An openly licensed image. Each image carries its own licence, author and source.",
"type": "object",
"required": [
"url",
"licence",
"author",
"source_url"
],
"additionalProperties": false,
"properties": {
"url": {
"$ref": "#/$defs/url",
"description": "Where the file is served from (our assets folder or the original host)."
},
"licence": {
"type": "string",
"minLength": 2,
"description": "SPDX identifier, for example CC-BY-4.0, CC-BY-SA-4.0 or CC0-1.0."
},
"author": {
"type": "string",
"minLength": 1,
"description": "Name of the photographer or creator, as the licence requires it to be credited."
},
"source_url": {
"$ref": "#/$defs/url",
"description": "Page describing the original file and its licence."
},
"title": {
"type": "string",
"description": "Short caption describing what the image shows."
},
"width": {
"type": "integer",
"minimum": 1,
"description": "Width of the image file in pixels."
},
"height": {
"type": "integer",
"minimum": 1,
"description": "Height of the image file in pixels."
}
}
},
"external_ref": {
"title": "External reference",
"description": "A pointer to a record in another service. Never stores the other service's values.",
"type": "object",
"required": [
"source",
"id"
],
"additionalProperties": false,
"properties": {
"source": {
"type": "string",
"pattern": "^[a-z0-9_.-]+$",
"description": "Short name of the other service, for example tripadvisor or untappd. Lowercase letters, digits, dots, dashes and underscores."
},
"id": {
"type": "string",
"minLength": 1,
"description": "The record's identifier in the other service."
},
"url": {
"$ref": "#/$defs/url"
}
}
},
"dataset_meta": {
"title": "Dataset metadata",
"type": "object",
"required": [
"licence"
],
"properties": {
"licence": {
"const": "MIT",
"description": "Licence of the file: MIT, with the copyright notice “Roastbook Open Coffee contributors”."
}
},
"description": "File-level facts that are not records. The schema version is the $schema URL; the data version is the release tag."
}
}
}