Skip to content

Instantly share code, notes, and snippets.

@tomcrane
Last active August 29, 2015 14:10
Show Gist options
  • Save tomcrane/fbf3b377a2a803ca67e9 to your computer and use it in GitHub Desktop.
Save tomcrane/fbf3b377a2a803ca67e9 to your computer and use it in GitHub Desktop.
IIIF-auth-overriding-profiles

This post follows on from https://groups.google.com/forum/#!topic/iiif-discuss/mcs4T1KMyN4 and https://groups.google.com/d/msg/iiif-discuss/IIuduLgkRA0/X7xTZcUTmUAJ.

In the last IIIF call (2014-11-26) it was suggested that the auth information was better provided by a service - which can also be on any node - rather than an annotationList. So here are some further questions around that.

Is it OK for a service to return annotations too? It feels as if an annotation is a good mechanism to apply overriding auth information to a particular part of the structure, but via a service on a node rather than an annoList on a node.

Whether it is service or annolist, is it acceptable for a single profile supplied in an annotation to override ALL profiles "underneath" the target (i.e., descendant nodes in the JSON-LD)? It seems economical and reasonably easy to understand, but something about it doesn't feel right:

The "profile" term is dcterms:conformsTo. Here's my earlier example of an annotation providing an overriding profile ("What might an annotation look like?" in https://gist.github.com/tomcrane/3a2301058615ddf9dbee):

{
  "@context":"http://iiif.io/api/presentation/2/context.json",
  "@id":"http://www.example.org/iiif/book1/annotation/anno1",
  "@type":"oa:Annotation",
  // a new motivation
  "motivation":"http://extensions.org/iiif#authDescription", 
  // anno hasTarget the sequence - is this OK? 
  "on":"http://www.example.org/iiif/book1/sequence/normal", 
  "resource":{
    // there's nothing to deref here, can we omit?
    "@id":"http://www.example.org/iiif/book1/list/access/anno1", 
    "@type":"http://extensions.org/iiif#profileModification",

    "profile": [...],

    // no defined term for this 
    "http://extensions.org/iiif#loginUri" : "http://mylibrary.org/login", 
    "description":"Access to this resource is restricted. Follow the supplied link to log in"
  }
}

This states that the resource (oa:hasBody) - the body of the annotation - conforms to this profile, which doesn't make sense - the annotation body itself is not an image service. What I am trying to say is that this property, which could be a simple profile URI or could be a more complex set of options, overrides any profile to be found on any self-or-descendant image service underneath the target of the annotation. In which case dcterms:conformsTo (and therefore "profile") is not the correct predicate.

This is not really an IIIF problem, I think it's an RDF / RDFS / OWL problem - but while I go away and read up on it, any suggestions? Even if we have a predicate to this effect (I'm not seriously proposing this string!):

"http://extensions.org/iiif#hasProfileThatShouldOverrideAnyProfilesFoundOnDescendantNodesOfTheTargetOfTheAnnotationOfWhichIAmTheBody" : [...]

...then it still doesn't feel very machine readable; it feels we're not really formally declaring it. Could I write a SPARQL query to find the profiles I need to override, given (informally translating the info above):

<myAnno> oa:hasTarget <http://www.example.org/iiif/book1/sequence/normal>
<myAnno> oa:hasBody <myResource>
<myResource> xx:horriblePredicateAbove <myOverridingProfile>
(...and the rest of the manifest)

If not then it's not formal, regardless of how obvious it might be to a human reader, and also regardless of how easy it might be for a JSON-processing viewer to navigate the JSON object graph with special knowledge of what that predicate means. Looking at it it feels like you would be able to write such a query, but it wouldn't be very pretty. Is there a simpler way of doing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment