What is a .jsonld file?
application/ld+json
JSON-LD (JSON for Linking Data) is a W3C-standard way of writing linked data as ordinary JSON. A document carries an @context that maps its plain keys onto a shared vocabulary, and an @type that says what the thing is, so a consumer can read a Menu, a Product or an Event without agreeing on field names in advance. The media type is application/ld+json, and on the web it is usually embedded in a page inside a script tag rather than served as a file.
How to use a .jsonld file
Use an example JSON-LD file to test structured-data extraction and validation, context expansion and compaction, and the consumers that read schema.org markup. A file with the right shape but the wrong value types, such as a price written as a string where a number is required, is the case worth testing: it parses as JSON and still fails the vocabulary.
Download example .jsonld files
- Alder Table Bistro: Menu as schema.org JSON-LDMenu as schema.org JSON-LD for Alder Table Bistro. A schema.org Menu document with 7 MenuSection nodes, 5 of them top level, and 27 MenuItem nodes carrying 27 Offer nodes, each with price as a JSON number and priceCurrency CAD. Modifiers are menuAddOn MenuItems and every declared allergen travels as an additionalProperty PropertyValue. This is the structured data shape a search engine reads, and it is rare as a downloadable fixture.
- Alder Table Bistro: Menu JSON-LD with string pricesMenu JSON-LD with string prices for Alder Table Bistro. Intentionally invalid. All 27 Offer nodes carry price as a JSON string with a currency symbol, the first being "$11.50", where menu.jsonld carries the same 27 prices as JSON numbers. Nothing else differs, so a consumer that accepts text prices reports the file as fine and then fails on the arithmetic.
- Juniper Corner Cafe: Menu as schema.org JSON-LDMenu as schema.org JSON-LD for Juniper Corner Cafe. A schema.org Menu document with 6 MenuSection nodes, 4 of them top level, and 27 MenuItem nodes carrying 27 Offer nodes, each with price as a JSON number and priceCurrency CAD. Modifiers are menuAddOn MenuItems and every declared allergen travels as an additionalProperty PropertyValue. This is the structured data shape a search engine reads, and it is rare as a downloadable fixture.
- Juniper Corner Cafe: Menu JSON-LD with string pricesMenu JSON-LD with string prices for Juniper Corner Cafe. Intentionally invalid. All 27 Offer nodes carry price as a JSON string with a currency symbol, the first being "$4.75", where menu.jsonld carries the same 27 prices as JSON numbers. Nothing else differs, so a consumer that accepts text prices reports the file as fine and then fails on the arithmetic.
- Copper Oven Bakery: Menu as schema.org JSON-LDMenu as schema.org JSON-LD for Copper Oven Bakery. A schema.org Menu document with 6 MenuSection nodes, 4 of them top level, and 30 MenuItem nodes carrying 30 Offer nodes, each with price as a JSON number and priceCurrency CAD. Modifiers are menuAddOn MenuItems and every declared allergen travels as an additionalProperty PropertyValue. This is the structured data shape a search engine reads, and it is rare as a downloadable fixture.
- Copper Oven Bakery: Menu JSON-LD with string pricesMenu JSON-LD with string prices for Copper Oven Bakery. Intentionally invalid. All 30 Offer nodes carry price as a JSON string with a currency symbol, the first being "$7.50", where menu.jsonld carries the same 30 prices as JSON numbers. Nothing else differs, so a consumer that accepts text prices reports the file as fine and then fails on the arithmetic.
- Ember Lane Pizza: Menu as schema.org JSON-LDMenu as schema.org JSON-LD for Ember Lane Pizza. A schema.org Menu document with 6 MenuSection nodes, 4 of them top level, and 27 MenuItem nodes carrying 27 Offer nodes, each with price as a JSON number and priceCurrency CAD. Modifiers are menuAddOn MenuItems and every declared allergen travels as an additionalProperty PropertyValue. This is the structured data shape a search engine reads, and it is rare as a downloadable fixture.
- Ember Lane Pizza: Menu JSON-LD with string pricesMenu JSON-LD with string prices for Ember Lane Pizza. Intentionally invalid. All 27 Offer nodes carry price as a JSON string with a currency symbol, the first being "$17.00", where menu.jsonld carries the same 27 prices as JSON numbers. Nothing else differs, so a consumer that accepts text prices reports the file as fine and then fails on the arithmetic.
and 6 more in the library.