Socialwg/Collection Comparison

From W3C Wiki

Examples

Scenario

Represent list of Social Web WG members as distinct resource with possibility of paging it.

User Stories

Some of the User Stories which require use of Collection

IndieWeb use of microformats

Real world examples:

RSS

Atom

collection + json

Linked Data Platform

Activity Streams 2.0

Real world examples:

  • ???

Schema.org

Real world examples:

  • ???

Hydra

(intense discussions on pagination on mailing list)


!!!WORK IN PROGRESS, not verified by other participants of Hydra CG!!!

Real world examples:

  • ???

Theoretical example of how an existing URL could return information (but does not currently)

GET http://www.w3.org/2013/socialweb/

{
  "@context": {
    "@vocab": "http://www.w3.org/ns/hydra/core#",
    "ex": "http://example.net/#"
  },
  "@id": "http://www.w3.org/2013/socialweb/",
  "@type": "ex:Organization",
  "ex:name": "Social Web WG",
  "ex:participant": {
    "@id": "participants?page=1",
    "totalItems": "49",
    ...
  }
}

GET http://www.w3.org/2013/socialweb/participants?page=1

{
  "@context": {
    "@vocab": "http://www.w3.org/ns/hydra/core#",
    "ex": "http://example.net/#"
  },
  "@id": "http://www.w3.org/2013/socialweb/participants?page=1",
  "@type": "PagedCollection",
  "totalItems": "49",
  "itemsPerPage": "10",
  "firstPage": "participants?page=1",
  "nextPage": "participants?page=2",
  "lastPage": "participants?page=5",
  "member": [
     "https://wwelves.org/perpetual-tripper",
     "http://tantek.com",
     "http://me.markus-lanthaler.com",
     ...
  ]
}

The examples above assume that the ex vocabulary was created with Hydra collections in mind, i.e., the range of ex:participant is hydra:Collection (or something more generic). If the range of ex:participant would be set to something like ex:Person, the collection would need to be referenced indirectly as follows:

GET http://www.w3.org/2013/socialweb/

{
  "@context": {
    "@vocab": "http://www.w3.org/ns/hydra/core#",
    "ex": "http://example.net/#"
  },
  "@id": "http://www.w3.org/2013/socialweb/",
  "@type": "ex:Organization",
  "ex:name": "Social Web WG",
  "collection": {
    "@id": "participants?page=1",
    "totalItems": "49",
    ...
    "manages": {
      "subject": "http://www.w3.org/2013/socialweb",
      "property": "ex:participant"
    }
  }
}

SIOC

Real world examples:

  • ???

Object Reuse and Exchange

suggested by Karen Coyle https://lists.w3.org/Archives/Public/public-vocabs/2015Mar/0061.html