JSON-LD, or JavaScript Object Notation for Linked Data, is an extension of JSON designed to create machine-readable linked data. It provides a way to add semantic context to JSON documents, making them more meaningful and interconnected.
JSON-LD serves several key purposes:
A JSON-LD document typically includes a context and data:
{
"@context": "https://schema.org",
"@type": "Person",
"name": "John Doe",
"jobTitle": "Software Engineer",
"url": "https://example.com/johndoe"
}
JSON-LD offers several advanced features for complex data representation:
Here's an example of how JSON-LD can be used to describe a product:
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Executive Leather Office Chair",
"description": "Ergonomic high-back chair with genuine leather upholstery",
"brand": {
"@type": "Brand",
"name": "LuxeSeating"
},
"offers": {
"@type": "Offer",
"price": "299.99",
"priceCurrency": "USD",
"availability": "https://schema.org/InStock"
}
}
<script>
tag with type "application/ld+json"To further explore JSON and related technologies, consider learning about:
By leveraging JSON-LD, developers can create more meaningful and interconnected data structures, enhancing the semantic richness of web content and improving machine readability.