Problem/Motivation
In order to parse a JSON object as JSON-LD, a context is required. The context provides the full URIs for the aliases used in the JSON-LD and other information.
For example:
"@context":
{
"schema": { "@id": "http://schema.org/" },
"field_address": { "@id": "schema:address" },
},
fago made clear at DrupalCon Munich that we want to provide this context at a URI rather than embedding it. This has the advantage of providing a concise JSON response. It also will allow us to respond with JSON-LD to JSON responses if we choose (as the context can be added in an HTTP Link Header).
Proposed resolution
Create a context document for each bundle in a Drupal instance. This will map Drupal's internal field/property names to their corresponding full URIs in the site generated vocabulary. These full URIs will follow the guidelines decided in #1784198: Decide on a URI structure for site generated RDF vocabulary.
Comment | File | Size | Author |
---|---|---|---|
#2 | 1794958-2-context.txt | 2.72 KB | linclark |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedTagging
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedPosting a patch which depends on #1811510: Enable JSON-LD entity serialization.
This creates a JsonldContext class, which will eventually be used when adding the context route and creating the full output for the context.
Comment #3
webchickMarking needs review.
Comment #4
yurtboy CreditAttribution: yurtboy commentedTried to test this patch.
I went to the link in #2 to get the other path. I found patch on comment #29 and that applied fine.
Then I came back to this patch and received these errors.
I looked in the patch and noted that the 2 items do not even exists in the file
1. line 82
2. And
Which right after it is suppose to have this inserted
Maybe this patch is no longer needed?
I will try again if I missed something?
Also prior to getting the other patch above I received these errors.
Thanks
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedNo, you're not doing anything wrong. This issue is part of a series of issues which need more architectural review than patch testing.
Comment #6
Crell CreditAttribution: Crell commented