- From: Christopher Johnson <chjohnson39@gmail.com>
- Date: Sun, 6 Nov 2016 19:40:07 +0100
- To: public-hydra@w3.org
- Message-ID: <CAMJ8WP2uABk0ZedpuJJTgErTxPuCx6d_Pp=_SScMOdYHbFfn_Q@mail.gmail.com>
Hello list, I am trying to build an hydra-core enabled API that handles IriTemplates. I apologize in advance if the following is out of your normal topic scope or is too specific. I should preface that I have modified the hydra-core javascript implementation to work for my use case. I have a few questions regarding norms for defining supportedOperation method and expected for an TemplatedLink property in the apiDocumentation. I have constructed the following procedure: 1) loadDocument 2) find declared TemplatedLink property supported operation in document properties. 3) find TemplatedLink property class with the api 4) define the templated link from the TemplatedLink class template property 4) parse the template link with expected variable(s). (I am using uri-templates to do this). 5) invoke supported operation method and pass parsed templated link as content. 6) have httpClient.rawInvoke check if expected is IriTemplate class, and if so, set url = content. Step #6 is where my questions arise. Is there a convention for an expected template type check or supportedOperation method for template requests by httpClient? Should IriTemplate be declared as a hydra:Class or something else in the apiDocumentation? (It seems that only hydra:Class classes can be declared as "expected".) Also, since I did not want to use a domain specific IriTemplate class check in the core client, I have reinstantiated the core class in my api, which is probably not correct. For reference, here is part of the apiDocumentation for the above: "supportedClass": [ { "@id": "http://service.b-ol.de/api/hydra.json#EntryPoint", {...} "supportedProperty": [ { "property": { "@id": "http://iiif.io/api/presentation/2#Manifest", "@type": "TemplatedLink", "http://www.w3.org/2000/01/rdf-schema#label": "IIIF Manifest", "domain": " http://service.b-ol.de/api/hydra.json#EntryPoint", "range": "Resource", "supportedOperation": [ { "@id": " http://iiif.io/api/presentation/2#Manifest/GET", "@type": "Operation", "expects": " http://www.w3.org/ns/hydra/core#IriTemplate", "method": "GET", "http://www.w3.org/2000/01/rdf-schema#label": "Retrieves a Manifest Resource", "returns": " http://www.w3.org/ns/hydra/core#Resource" } ] } } ] }, { "@id": "http://iiif.io/api/presentation/2#Manifest", "@type": "Class", "template": " http://service.b-ol.de/api/graphs/manifest.nt?node={node}", "http://www.w3.org/2000/01/rdf-schema#comment": "A IIIF Manifest", "http://www.w3.org/2000/01/rdf-schema#label": "Manifest", "supportedOperation": { "@id": "http://service.b-ol.de/api/hydra.json#EntryPoint/GET ", "@type": "Operation", "http://www.w3.org/2000/01/rdf-schema#label": "The APIs main entry point.", "method": "GET", "returns": { "@id": "http://iiif.io/api/presentation/2#Manifest" }, "statusCodes": [] } }, { "@id": "http://www.w3.org/ns/hydra/core#IriTemplate", "@type": "Class", "template": " http://service.b-ol.de/api/hydra.json#EntryPoint/graphs/{query}?node={node} ", "variableRepresentation": "BasicRepresentation", "mapping": [ { "@type": "IriTemplateMapping", "variable": "query", "required": false }, { "@type": "IriTemplateMapping", "variable": "node", "required": true } ] } ] Thanks for your assistance, Christopher Johnson
Received on Monday, 7 November 2016 08:41:48 UTC