Re: Collection (hydra:manage, hydra:property and void:classPartition)

On 11/30/2015 06:31 AM, Dietrich Schulten wrote:
> 
> Am 28.11.2015 22:12 schrieb elf Pavlik <perpetual-tripper@wwelves.org>:
>>
>> Hello, 
>>
>> https://www.w3.org/community/hydra/wiki/Collection_Design 
>>
>> Wiki page above proposes a way to group resources which all have given 
>> relation to some resource. I wonder if we could find a way to use it 
>> together with void:classPartition. 
>>
>> For example collection 
>>
>> { 
>>   "@id": "/alice", 
>>   "collection": { 
>>     "@id": "/alice/featured", 
>>     "@type": "Collection", 
>>     "manages": { 
>>       "property": "schema:about", 
>>       "object": "/alice" 
>>     } 
>>   } 
>> } 
>>
>> schema:about schema:domainIncludes schema:CreativeWork 
>>
>> Now I would like to have more specific collections (partitions) for more 
>> specific types of CreativeWork - Article, Movie, Book, Review etc. 
>>
>> /alice/featured/articles 
>> /alice/featured/movies 
>> /alice/featured/books 
>>
>> Can we consider hydra:Collection also a void:Dataset? void:subset of the 
>> whole Dataset exposed by given API. Maybe we could simply use 
>> void:classPartition directly on hydra:Collection? 
>>
> 
> The three subordinate resources are resources of their own. Normally UriTemplate is for this kind of URL space.
> If we had something like "allowedLiteral" [1] or "sh:in", one could add an IriTemplate to the collection with a variable for the last path segment. The last path segment could then be restricted to values for the kind of media.
> 
> With void:classPartition, how would you tell the client about the URLs of the subordinate resources?
{
  "@id": "/alice",
  "collection": {
    "@id": "/alice/featured",
    "@type": "Collection",
    "manages": {
      "property": "schema:about",
      "object": "/alice"
    },
    "totalItems": 23,
    "void:classPartition": [
      {
        "@id": "/alice/featured/articles",
        "@type": [ "Collection", "void:Dataset"],
        "void:class": "schema:Article",
        "manages": {
          "property": "schema:about",
          "object": "/alice"
        },
        "totalItems": 10
      },
      {
        "@id": "/alice/featured/movies",
        "@type": [ "Collection", "void:Dataset"],
        "void:class": "schema:Movie",
        "manages": {
          "property": "schema:about",
          "object": "/alice"
        },
        "totalItems": 5
      },
      {
        "@id": "/alice/featured/books",
        "@type": [ "Collection", "void:Dataset"],
        "void:class": "schema:Book",
        "manages": {
          "property": "schema:about",
          "object": "/alice"
        },
        "totalItems": 3
      }
    ]
  }
}

If we repeat 'manages' block in each 'partition' they could also go
directly into "collection" without having to 'nest' it using
"void:classPartition"

Received on Monday, 30 November 2015 13:17:25 UTC