- From: Nandana Mihindukulasooriya <nmihindu@fi.upm.es>
- Date: Mon, 21 Jul 2014 11:33:28 +0200
- To: Linked Data Platform Working Group <public-ldp-wg@w3.org>
- Message-ID: <CAAOEr1nKnzk5_++aP+EYxaL4nVotsrHZtuNghttXiNpfBu-KGA@mail.gmail.com>
Hi all,
In Hydra spec examples, they use a JSON-LD context document,
http://www.w3.org/ns/hydra/context.jsonld , which correctly sets with the
CORS header "Access-Control-Allow-Origin: *" in the response. If we can do
the same, it solves the problem that the validators [1] have with our
current JSON-LD context file [2] in the Mercurial repository due to
cross origin issues. Can we publish a context file in a similar way?
Best Regards,
Nandana
[1] - http://json-ld.org/playground/
[2] - https://dvcs.w3.org/hg/ldpwg/raw-file/default/ldp-primer/context.json
On Mon, Jul 7, 2014 at 11:30 AM, Nandana Mihindukulasooriya <
nmihindu@fi.upm.es> wrote:
> Hi all,
>
> When validating JSON-LD examples in the primer, the validators run into to
> cross-origin issues because they have to fetch the context from a different
> document. Apparently this can be prevented by setting the appropriate CORS
> headers when responding to the context files but I am not sure whether we
> can do that in the hg repository. The other alternative is to simply
> embedded the context in the examples though it will increase the length of
> the examples a bit.
>
> For example, the following Turtle representation
>
> ---------------------------------------------------------------------------
> @prefix ldp: <http://www.w3.org/ns/ldp#> .
> @prefix dcterms: <http://purl.org/dc/terms/> .
> @prefix bt: <http://example.org/vocab/bugtracker#> .
>
> </tracker/ldp-demo/> a ldp:DirectContainer;
> ldp:membershipResource </tracker/ldp-demo/#it>;
> ldp:hasMemberRelation bt:hasBug;
> dcterms:title "Product description of LDP Demo product which is also an
> LDP-DC";
> ldp:contains <bug4> , <bug67> .
>
> </tracker/ldp-demo/#it> a bt:Product;
> dcterms:title "LDP Demo";
> bt:hasBug <bug4>, <bug67> .
> ---------------------------------------------------------------------------
>
> will be converted to the following JSON-LD representation.
> ---------------------------------------------------------------------------
> [
> { "@context": {
> "dc": "http://purl.org/dc/terms/",
> "ldp": "http://www.w3.org/ns/ldp#",
> "bt": "http://example.org/vocab/bugtracker#" },
> "@id": "",
> "@type": [ "ldp:DirectContainer", "bt:Product"],
> "dc:title": "Product description of the LDP Demo product which is
> also an LDP-DC",
> "ldp:contains": [{ "@id": "bug3"}, { "@id": "bug4"}],
> "ldp:hasMemberRelation": { "@id": "bt:hasBug"},
> "ldp:membershipResource": { "@id": "#it"}
> },
> {
> "@context": { "dc": "http://purl.org/dc/terms/",
> "ldp": "http://www.w3.org/ns/ldp#",
> "bt": "http://example.org/vocab/bugtracker#" },
> "@id": "#it",
> "@type": "bt:Product",
> "dc:title": "LDP Demo",
> "bt:hasBug": [{ "@id": "bug3"}, { "@id": "bug4"} ]
> }
> ]
> ---------------------------------------------------------------------------
>
> Does any of you JSON-LD experts know a better/neater represent the above
> JSON-LD representation?
>
> Best Regards,
> Nandana
>
> On Sat, Jul 5, 2014 at 1:34 PM, Linked Data Platform (LDP) Working Group
> Issue Tracker <sysbot+tracker@w3.org> wrote:
>
>> ldp-ISSUE-99: Validate the JSON-LD examples of the primer [Primer]
>>
>> http://www.w3.org/2012/ldp/track/issues/99
>>
>> Raised by: Nandana Mihindukulasooriya
>> On product: Primer
>>
>> Address the issues raised by Gregg Kellogg.
>>
>> 1. check how to set CORS authorization to the header for the context file.
>> 2. validate the examples in http://json-ld.org/playground/.
>> 3. Make sure that context applies all the objects when there multiple top
>> level objects like in example 3.1.
>>
>>
>> http://lists.w3.org/Archives/Public/public-ldp/2014Jul/0001.html
>>
>>
>>
>>
>
Received on Monday, 21 July 2014 09:34:13 UTC