### Invalid JSON-LD Examples Source: https://github.com/w3c/json-ld-streaming/blob/main/index.html Examples that violate JSON-LD structural requirements regarding key ordering. ```json { "@id": "https://www.rubensworks.net/#me", ####// @context must come before @id#### "@context": "http://schema.org/", "name": "Ruben Taelman", "url": "https://www.rubensworks.net/", "image": "https://www.rubensworks.net/img/ruben.jpg" } ``` ```json { "http://schema.org/name": "Ruben Taelman", "@type": "http://schema.org/Person", ####// @type must come before properties#### "http://schema.org/url": {"@id": "https://www.rubensworks.net/"}, "http://schema.org/image": {"@id": "https://www.rubensworks.net/img/ruben.jpg"} } ``` -------------------------------- ### DOAP Project Description Example Source: https://github.com/w3c/json-ld-streaming/blob/main/reports/index.html Example of a DOAP (Description of a Project) description for a software project, including its name, release information, developer, homepage, and programming language. ```turtle <--your-software-identifier--> a doap:Project, earl:TestSubject, earl:Software ; doap:name "My Cool JSON-LD Parser" ; doap:release [ doap:name "--short name wih version number--"; doap:revision "--Software version number--" ; doap:created "2020-02-19"^^xsd:date; ] ; doap:developer <--your-developer-identifier--> ; doap:homepage <--your-software-homepace--> ; doap:description "--your-project-description--"@en ; doap:programming-language "--your-implementation-language--" . ``` -------------------------------- ### JSON-LD Subject and Object Grouping Example Source: https://github.com/w3c/json-ld-streaming/blob/main/index.html Demonstrates grouping by subject and object relationships in JSON-LD, illustrating how entities can be linked. ```json [ { "@id": "https://www.rubensworks.net/#me", "http://schema.org/name": "Ruben Taelman", "http://schema.org/knows": { "@id": "https://greggkellogg.net/foaf#me", "http://schema.org/name": "Gregg Kellogg" } } ] ``` -------------------------------- ### FOAF Person Description Example Source: https://github.com/w3c/json-ld-streaming/blob/main/reports/index.html Example of a FOAF (Friend of a Friend) description for a software developer, including their name and homepage. ```turtle <--your-developer-identifier--> a foaf:Person, earl:Assertor; foaf:name "--My Name--"; foaf:homepage <--my homepage--> . ``` -------------------------------- ### Valid JSON-LD Document Examples Source: https://github.com/w3c/json-ld-streaming/blob/main/index.html Standard JSON-LD structures including basic entities, blank nodes, and nested contexts. ```json { "@context": "http://schema.org/", "@id": "https://www.rubensworks.net/#me", "name": "Ruben Taelman", "url": "https://www.rubensworks.net/", "image": "https://www.rubensworks.net/img/ruben.jpg" } ``` ```json { "@context": "http://schema.org/", "@id": "_:blank_node", "name": "Ruben Taelman", "url": "https://www.rubensworks.net/", "image": "https://www.rubensworks.net/img/ruben.jpg" } ``` ```json { "@context": "http://schema.org/", "@id": "https://www.rubensworks.net/#me", "name": "Ruben Taelman", "url": "https://www.rubensworks.net/", "image": "https://www.rubensworks.net/img/ruben.jpg", "knows": { "@id": "https://greggkellogg.net/foaf#me", "name": "Gregg Kellogg" } } ``` ```json { "@context": "http://schema.org/", "@id": "https://www.rubensworks.net/#me", "name": "Ruben Taelman", "url": "https://www.rubensworks.net/", "image": "https://www.rubensworks.net/img/ruben.jpg", "knows": { "@context": { "name": "http://xmlns.com/foaf/0.1/name" }, "@id": "https://greggkellogg.net/foaf#me", "name": "Gregg Kellogg" } } ``` ```json { "@context": { "Person": { "@id": "http://schema.org/Person", "@context": "http://schema.org/" } }, "@type": "Person", "@id": "https://www.rubensworks.net/#me", "name": "Ruben Taelman", "url": "https://www.rubensworks.net/", "image": "https://www.rubensworks.net/img/ruben.jpg" } ``` -------------------------------- ### Non-recommended JSON-LD Examples Source: https://github.com/w3c/json-ld-streaming/blob/main/index.html Valid JSON-LD structures that are discouraged due to missing identifiers or lack of context. ```json { "@context": "http://schema.org/", ####// @id is missing, considered a blank node#### "name": "Ruben Taelman", "url": "https://www.rubensworks.net/", "image": "https://www.rubensworks.net/img/ruben.jpg" } ``` ```json { ####// @context is not required, but @id is recommended here#### "http://schema.org/name": "Ruben Taelman", "http://schema.org/url": {"@id": "https://www.rubensworks.net/"}, "http://schema.org/image": {"@id": "https://www.rubensworks.net/img/ruben.jpg"} } ``` -------------------------------- ### Requesting Streaming JSON-LD via HTTP Source: https://github.com/w3c/json-ld-streaming/blob/main/index.html Example of using the streaming profile URI in an HTTP Accept header. ```http GET /ordinary-json-document.json HTTP/1.1 Host: example.com Accept: application/ld+json;profile=http://www.w3.org/ns/json-ld#streaming ``` -------------------------------- ### JSON-LD Property Grouping Example Source: https://github.com/w3c/json-ld-streaming/blob/main/index.html Illustrates grouping of JSON-LD objects based on shared properties, showing how multiple values can be associated with a single property. ```json [ { "@id": "https://www.rubensworks.net/#me", "http://schema.org/name": [ "Ruben", "Ruben Taelman" ], "http://schema.org/url": [ { "@id": "https://www.rubensworks.net/" }, { "@id": "https://github.com/rubensworks/" } ] } ] ``` -------------------------------- ### EARL Assertion Example Source: https://github.com/w3c/json-ld-streaming/blob/main/reports/index.html An example of an EARL assertion for reporting test results. It includes details about the test, the subject, and the outcome. ```turtle [ a earl:Assertion; earl:assertedBy <--your-developer-identifier-->; earl:subject <--your-software-identifier-->; earl:test <--uri-of-test-from-manifest>; earl:result [ a earl:TestResult; earl:outcome earl:passed; dc:date "2016-12-26T10:18:04-08:00"^^xsd:dateTime]; earl:mode earl:automatic ] . ``` -------------------------------- ### JSON-LD @graph and @id Grouping Example Source: https://github.com/w3c/json-ld-streaming/blob/main/index.html Shows how to use @graph to group related JSON-LD objects under a main identifier, useful for organizing complex datasets. ```json [ { "@id": "http://example.org/graph1", "@graph": [ { "@id": "https://www.rubensworks.net/#me", "http://schema.org/name": "Ruben Taelman", "http://schema.org/url": { "@id": "https://www.rubensworks.net/" } } ], "name": "Graph 1" }, { "@id": "http://example.org/graph2", "@graph": [ { "@id": "https://greggkellogg.net/foaf#me", "http://schema.org/name": "Gregg Kellogg", "http://schema.org/url": { "@id": "https://greggkellogg.net/" } } ], "name": "Graph 2" } ] ``` -------------------------------- ### JSON-LD Serialization with @graph Grouping Source: https://github.com/w3c/json-ld-streaming/blob/main/index.html This JSON-LD example demonstrates grouping by named graphs, where each '@graph' contains triples related to a specific graph. This structure is beneficial for streaming processors when dealing with multiple named graphs. ```json [ { "@id": "http://example.org/graph1", "@graph": [ { "@id": "https://www.rubensworks.net/#me", "http://schema.org/name": "Ruben Taelman", "http://schema.org/url": { "@id": "https://www.rubensworks.net/" } } ] }, { "@id": "http://example.org/graph2", "@graph": [ { "@id": "https://greggkellogg.net/foaf#me", "http://schema.org/name": "Gregg Kellogg", "http://schema.org/url": { "@id": "https://greggkellogg.net/" } } ] } ] ``` -------------------------------- ### JSON-LD Document with Meaningful Key Order Source: https://github.com/w3c/json-ld-streaming/blob/main/index.html This JSON-LD document demonstrates an order that allows for efficient streaming processing, where properties can be emitted as RDF triples as soon as they are read. ```json { "@context": "http://schema.org/", "@id": "https://www.rubensworks.net/#me", "name": "Ruben Taelman", "url": "https://www.rubensworks.net/", "image": "https://www.rubensworks.net/img/ruben.jpg" } ``` -------------------------------- ### Compact JSON-LD Serialization (Ordered Triples) Source: https://github.com/w3c/json-ld-streaming/blob/main/index.html This JSON-LD output is generated from RDF triples ordered to group subjects, resulting in a more compact representation with fewer duplicate '@id' keys. Suitable for streaming processors that benefit from subject grouping. ```json [ { "@id": "https://www.rubensworks.net/#me", "http://schema.org/name": "Ruben Taelman", "http://schema.org/url": { "@id": "https://www.rubensworks.net/" } }, { "@id": "https://greggkellogg.net/foaf#me", "http://schema.org/name": "Gregg Kellogg", "http://schema.org/url": { "@id": "https://greggkellogg.net/" } } ] ``` -------------------------------- ### JSON-LD Document with Less Efficient Key Order Source: https://github.com/w3c/json-ld-streaming/blob/main/index.html This JSON-LD document has a key order that requires a streaming processor to buffer properties until the '@id' is encountered, potentially impacting performance. ```json { "@context": "http://schema.org/", "name": "Ruben Taelman", "url": "https://www.rubensworks.net/", "image": "https://www.rubensworks.net/img/ruben.jpg", "@id": "https://www.rubensworks.net/#me" } ``` -------------------------------- ### Less Compact JSON-LD Serialization (Mixed Triples) Source: https://github.com/w3c/json-ld-streaming/blob/main/index.html This JSON-LD output results from RDF triples with a mixed order, leading to a less compact representation with more duplicate '@id' keys. Streaming processors may find this less efficient due to the lack of subject grouping. ```json [ { "@id": "https://www.rubensworks.net/#me", "http://schema.org/name": "Ruben Taelman" }, { "@id": "https://www.rubensworks.net/#me", "http://schema.org/name": "Gregg Kellogg" }, { "@id": "https://greggkellogg.net/foaf#me", "http://schema.org/url": { "@id": "https://www.rubensworks.net/" } }, { "@id": "https://greggkellogg.net/foaf#me", "http://schema.org/url": { "@id": "https://greggkellogg.net/" } } ] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.