Align
aligns maps your types and fields onto shared vocabularies like schema.org and Wikidata, so a field means the same thing across recipes and authors.
Syntax
aligns <ontology>/<term> attaches an ontology correspondence to a type or a field. Type-level alignments sit between the type name and the {; field-level alignments follow the field's optional ?:
share type Company
aligns wikidata/Q4830453
{
id: String
name: String aligns schema.org/name
wikidataId: String aligns wikidata/identifier
}Alignments stack: a type or a field can align to several ontologies at once.
Index data, not translation
Alignments are index data. The runtime carries them through to the snapshot, the hub indexes recipes and types by them, and JSON-LD output renders them as @context / @type. The runtime never synthesizes values across an alignment; it records the correspondence, it does not translate.
On the hub
Because types carry their alignments, the hub indexes recipes by the vocabularies they speak, not just by name. A consumer can find every recipe that emits a schema.org/Product, regardless of who authored it or what they named their type. Alignment is what makes records from different authors interoperable. See Hub.
See also
- Compose for combining and reconciling records.
- Syntax reference for the full
alignsgrammar. - Hub: publish & import.