- From: John Walker <john.walker@semaku.com>
- Date: Thu, 9 Oct 2014 09:12:01 +0200 (CEST)
- To: public-hydra@w3.org, Dietrich Schulten <ds@escalon.de>
- Message-ID: <1958866111.1130691.1412838721192.open-xchange@oxweb01.eigbox.net>
Hi Dietrich, AFAIK fragment identifiers are fully supported. If I make extend your example a bit as follows: { "@context": [ "http://schema.org", { "@base": "http://example.com/product1" } ], "@id": "", "@type": "Product", "name": "Kenmore White 17\" Microwave", "review": { "@id": "#review1", "@type": "Review", "reviewRating": 10, "reviewBody": "This is the best 17\" microwave you can buy!" } } This yields the following triples when I paste into the JSON-LD playground: <http://example.com/product1#review1> <http://schema.org/reviewBody> "This is the best 17\" microwave you can buy!" . <http://example.com/product1#review1> <http://schema.org/reviewRating> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . <http://example.com/product1#review1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Review> . <http://example.com/product1> <http://schema.org/name> "Kenmore White 17\" Microwave" . <http://example.com/product1> <http://schema.org/review> <http://example.com/product1#review1> . <http://example.com/product1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Product> . So here the review is a fragment of the document. Note how I had to include the @base in the context otherwise playground takes it's own URL as the base, but if you were to serve this JSON-LD from your own server you would not need to specify the @base. HTH John > On October 9, 2014 at 7:17 AM Dietrich Schulten <ds@escalon.de> wrote: > > > Properties like schema:review allow list or single values, but normally > that is represented by an item of the target type or an array thereof. If I > make the value of review a link, it seems perfectly okay if the link > dereferences a Review or a Review[]. But can it point to a hydra:Collection? > > Would it be feasible to let the link point to the hydra:member attribute of > a hydra:Collection using a fragment identifier? I found the discussion > below, but although it was resolved to support fragment identifiers, the > jsonld spec does not mention that solution. > > https://github.com/json-ld/json-ld.org/issues/107 > > How can I use a fragment identifier with json-ld? > Would the following link on the review attribute be correct with a context > having @vocab schema.org and a hydra: term? > { > "@type": "Product", > "name": "Kenmore White 17\" Microwave", > "review": { > "@id": "http://api.example.com/reviews#hydra:member" > ... > } > > Best regards, > Dietrich > > >
Received on Thursday, 9 October 2014 07:32:27 UTC