### JSON-LD with Schema.org Context Source: https://w3c.github.io/json-ld-bp Demonstrates how to add a '@context' to a JSON object to enable interpretation as JSON-LD. This example uses the schema.org vocabulary to provide semantic meaning to the keys. ```json { "@context": "http://schema.org", "name": "Barack Obama", "givenName": "Barack", "familyName": "Obama", "jobTitle": "44th President of the United States" } ``` -------------------------------- ### Basic Person Entity in JSON-LD Source: https://w3c.github.io/json-ld-bp Demonstrates a simple JSON-LD structure for representing a person with basic properties like name and job title. This serves as a foundational example for entity representation. ```json { "@context": "http://schema.org", "@id": "http://www.wikidata.org/entity/Q76", "@type": "Person", "name": "Barack Obama", "givenName": "Barack", "familyName": "Obama", "jobTitle": "44th President of the United States" } ``` -------------------------------- ### Basic JSON Data Structure Source: https://w3c.github.io/json-ld-bp An example of a simple JSON object representing data. This format is easily parsed by developers and natively supported across most programming languages. ```json { "name": "Barack Obama", "givenName": "Barack", "familyName": "Obama", "jobTitle": "44th President of the United States" } ``` -------------------------------- ### JSON Data for a Github Commit Source: https://w3c.github.io/json-ld-bp An example of a JSON response typically received from an API endpoint, in this case, for retrieving information about a Github Commit. The type of data is inferred from the endpoint. ```json { "sha": "7638417db6d59f3c431d3e1f261cc637155684cd", "url": "https://api.github.com/repos/octocat/Hello-World/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd", "author": { "date": "2014-11-07T22:01:45Z", "name": "Scott Chacon", "email": "schacon@gmail.com" }, "committer": { "date": "2014-11-07T22:01:45Z", "name": "Scott Chacon", "email": "schacon@gmail.com" }, "message": "added readme, because im a good github citizen\n", "tree": { "url": "https://api.github.com/repos/octocat/Hello-World/git/trees/691272480426f78a0138979dd3ce63b77f706feb", "sha": "691272480426f78a0138979dd3ce63b77f706feb" }, "parents": [ { "url": "https://api.github.com/repos/octocat/Hello-World/git/commits/1acc419d4d6a9ce985db7be48c6349a0475975b5", "sha": "1acc419d4d6a9ce985db7be48c6349a0475975b5" } ] } ``` -------------------------------- ### Nested JSON-LD for Related Entities Source: https://w3c.github.io/json-ld-bp Shows how to nest related entity descriptions within a single JSON-LD message. This example demonstrates a bi-directional 'spouse' relationship between two Person entities, improving data coherence. ```json { "@context": "http://schema.org", "@id": "http://www.wikidata.org/entity/Q76", "@type": "Person", "name": "Barack Obama", "givenName": "Barack", "familyName": "Obama", "jobTitle": "44th President of the United States", "spouse": { "@id": "http://www.wikidata.org/entity/Q13133", "@type": "Person", "name": "Michelle Obama", "spouse": "http://www.wikidata.org/entity/Q76" } } ``` -------------------------------- ### JSON-LD with Type and Schema.org Source: https://w3c.github.io/json-ld-bp An example of a JSON-LD object that includes a 'type' property, specifying the nature of the data (e.g., 'Person'). This adheres to Linked Data principles by making messages self-describing. ```json { "@context": "http://schema.org", "id": "http://www.wikidata.org/entity/Q76", "type": "Person", "name": "Barack Obama", "givenName": "Barack", "familyName": "Obama", "jobTitle": "44th President of the United States" } ``` -------------------------------- ### JSON-LD: Overriding Context Entries with Array Ordering Source: https://w3c.github.io/json-ld-bp Illustrates how the order of elements in a JSON-LD context array affects the processing of terms, specifically demonstrating how a later definition of 'name' overrides an earlier one. ```json { "@context": [ { "id": "@id", "name": "http://schema.org/name" }, { "name": "http://xmlns.com/foaf/0.1/name" } ], "@id": "http://www.wikidata.org/entity/Q76", "name": "Barack Obama" } ``` -------------------------------- ### JSON-LD: Handling Protected Terms with Array Ordering Source: https://w3c.github.io/json-ld-bp Demonstrates how array ordering in JSON-LD contexts prevents redefinition errors for protected terms, ensuring that a protected term is not unintentionally overridden. ```json { "@context": [ { "@version": 1.1, "name": { "@id": "http://schema.org/name", "@protected": true } }, { "name": "http://xmlns.com/foaf/0.1/name" } ], "@id": "http://www.wikidata.org/entity/Q76", "name": "Barack Obama" } ``` -------------------------------- ### JSON-LD: Avoiding Protected Term Redefinition Errors Source: https://w3c.github.io/json-ld-bp Shows a correct way to structure JSON-LD contexts when dealing with protected terms, ensuring that a protected term is defined before other terms that might conflict with it. ```json { "@context": [ { "name": "http://xmlns.com/foaf/0.1/name" }, { "@version": 1.1, "Person": "http://schema.org/Person", "knows": "http://schema.org/knows", "name": { "@id": "http://schema.org/name", "@protected": true } } ], "@id": "http://www.wikidata.org/entity/Q76", "name": "Barack Obama" } ``` -------------------------------- ### JSON-LD: Typing External References with Schema.org Context Source: https://w3c.github.io/json-ld-bp Demonstrates how to use a schema.org context to define a property like 'image' as an identifier (@id) rather than a string literal, ensuring it's interpreted as a reference to another entity. ```json { "@context": "http://schema.org", "id": "http://www.wikidata.org/entity/Q76", "type": "Person", "name": "Barack Obama", "givenName": "Barack", "familyName": "Obama", "jobTitle": "44th President of the United States", "image": "https://commons.wikimedia.org/wiki/File:President_Barack_Obama.jpg" } ``` -------------------------------- ### JSON-LD with Vocabulary for Gender Source: https://w3c.github.io/json-ld-bp Illustrates how to use a JSON-LD context to define a term for a specific attribute, like 'gender', allowing it to be represented as a string but linked to a vocabulary. This avoids ambiguity and ensures consistent interpretation. ```json { "@context": [ "http://schema.org", { "gender": {"@id": "schema:gender", "@type": "@vocab"} } ], "@id": "http://www.wikidata.org/entity/Q76", "@type": "Person", "name": "Barack Obama", "givenName": "Barack", "familyName": "Obama", "jobTitle": "44th President of the United States", "gender": "Male" } ``` -------------------------------- ### JSON-LD: Defining Schema.org Image as @id in Local Context Source: https://w3c.github.io/json-ld-bp Shows how to define the 'image' property as an identifier (@id) within a local JSON-LD context, overriding or supplementing remote contexts. ```json { "@context": [ "http://schema.org", { "image": { "@id": "schema:image", "@type": "@id"} } ], "id": "http://www.wikidata.org/entity/Q76", "type": "Person", "name": "Barack Obama", "givenName": "Barack", "familyName": "Obama", "jobTitle": "44th President of the United States", "image": "https://commons.wikimedia.org/wiki/File:President_Barack_Obama.jpg" } ``` -------------------------------- ### JSON-LD with Unique Identifier (ID) Source: https://w3c.github.io/json-ld-bp Illustrates the use of the 'id' property (an alias for '@id') in JSON-LD to provide a unique identifier for an entity. This is crucial for referencing the same entity from different locations. ```json { "@context": "http://schema.org", "id": "http://www.wikidata.org/entity/Q76", "type": "Person", "name": "Barack Obama" } ``` -------------------------------- ### Expanded JSON-LD Representation Source: https://w3c.github.io/json-ld-bp Shows the expanded form of a JSON-LD object after processing. In this form, terms are replaced with their full URIs, making the data unambiguous for algorithmic transformations and validation. ```json [ { "http://schema.org/familyName": [{"@value": "Obama"}], "http://schema.org/givenName": [{"@value": "Barack"}], "http://schema.org/jobTitle": [{"@value": "44th President of the United States"}], "http://schema.org/name": [{"@value": "Barack Obama"}] } ] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.