RE: Schema.org properties having a collection as value and hydra:Collection

Hi John,

On 11 Okt 2014 at 18:20, John Walker wrote:
> Say I have a product resource that has multiple reviews. Obviously I
> can embed these in the product resource but lets assume I make each
> review a separate resource.
>
> Now imagine my product is super popular (or at least evokes a
> strong opinion) and it gets thousands of reviews. So I decide to
> pull out the list of reviews to a separate resource of type
> hydra:Collection.
>
> A question I was mentally wrestling with is how to link from the
> product to the collection - should I mint a new property? However
> given the example from Elf I wonder if I could just use rdfs:seeAlso
> to do this. Provided I include a bit of info about the collection in
> the representation of the product, that should be sufficient for a
> client to decide if it's worth to follow that link (or not).

Right, that's basically the essence of ISSUE-41 [1]


> The semantics of rdfs:seeAlso are a perfect fit for this IMHO:
> http://www.w3.org/TR/rdf-schema/#ch_seealso
> 
> What do others think of this as a design pattern?

We found rdfs:seeAlso to be semantically too weak and therefore introduced hydra:collection. Your example would look somewhat like this:

  {
    "@id": "/product",
    "collection": {
      "@id": "/product/reviews",
      "@type": "Collection",
      "manages": {
        "property": "schema:review",
        "subject": "/product"
      }
    }
  }

This pattern works with all vocabularies, even the ones that use rdfs:range. Strictly speaking, with schema.org you wouldn't need that indirection but you end up with a "strange" triple if you don't

   /product review /product/reviews  <-- this is the "strange" triple
   /product review /product/reviews/1
   /product review /product/reviews/2
   /product review /product/reviews/3
   ...


Cheers,
Markus


[1] https://github.com/HydraCG/Specifications/issues/41


--
Markus Lanthaler
@markuslanthaler

Received on Monday, 13 October 2014 17:11:33 UTC