IIIF / api

Source for API and model specifications documents (api and model)
http://iiif.io/api
106 stars 54 forks source link

Move first/last to Layer from List #553

Closed azaroth42 closed 8 years ago

azaroth42 commented 9 years ago

After engaging with the W3C ActivityStreams folks about paging through collections, they came to a new pattern which is quite appealing. The only significant difference with the current search draft is that first and last are relationships from the Layer to the AnnotationList (in our speak), rather than from AnnotationList to AnnotationList.

Semantically, this seems more accurate. It is the first page of the Layer, not of some random non-first AnnotationList. We always require the Layer for paged results, and the first/last is consistent. I propose that we follow suit and move these to Layer.

Concretely:

{
  "@context":"http://iiif.io/api/search/0/context.json",
  "@id":"http://example.org/service/manifest/search?q=bird&page=1",
  "@type":"sc:AnnotationList",
  "within": {
    "@type": "sc:Layer",
    "total": 125,
    "ignored": ["box"]
  },
  "next": "http://example.org/service/identifier/search?q=bird&page=2",
  "last": "http://example.org/service/identifier/search?q=bird&page=13",
  "startIndex": 0,

Would become:

{
  "@context": "http://iiif.io/api/search/0/context.json",
  "@id": "http://example.org/service/manifest/search?q=bird&page=1",
  "@type": "sc:AnnotationList",
  "within": {
    "@type": "sc:Layer",
    "total": 125,
    "first": "http://example.org/service/manifest/search?q=bird&page=1",
    "last": "http://example.org/service/identifier/search?q=bird&page=13",
    "ignored": ["box"]
  },
  "next": "http://example.org/service/identifier/search?q=bird&page=2",
  "startIndex": 0,
jpstroop commented 9 years ago

I agree, this seems more semantically accurate. It's a breaking change, no?

Sent via mobile. Please excuse typos, brevity, etc.

azaroth42 commented 9 years ago

It would be if search had been published, but it's still draft.

jpstroop commented 9 years ago

Ah, duh.

tomcrane commented 9 years ago

It is a breaking change for me! But only a tiny one and trivially altered. I've just finished switching to the draft model for autocomplete and search, but it's not live yet in Wellcome manifests (Ed needs to add to UV). I'll make this change now, I agree it makes sense.

tomcrane commented 8 years ago

I've made this change (first and last move to layer, prev and next stay on annotation list).

"prev" looks ugly - any reason why this can't be "previous"? The other terms are not abbreviated.

azaroth42 commented 8 years ago

We could map to previous in the context.

The previous iteration of AS, before my comments towards alignment: http://www.w3.org/TR/activitystreams-core/#collections

That said, in 3.0 we should try and just use external contexts directly rather than re-naming. By then both AS and Annotations will be through to TR. So my preference is to leave it as prev to not have to re-re-name it.

tomcrane commented 8 years ago

Yes, fair enough!

azaroth42 commented 8 years ago

Done in latest search branch (v 0.9.1)

Branch: http://search.iiif.io/api/search/0.9/

+1s?

jpstroop commented 8 years ago

:+1:

azaroth42 commented 8 years ago

Closed in #650