RE: Declaring hydra:template outside of hydra:IriTemplate definition

Hi Maxim,

Sorry for the late reply.


On 18 Dez 2015 at 14:46, Maxim Kolchin wrote:
> Is it possible to declare hydra:template value outside of
> hydra:IriTemplate definition.

No, at the moment that's not possible. The issue is that the mappings are tightly bound to the template. Separating them would thus, in most cases, don't really work.


> In example, I want to define a template
> for making SPARQL queries. Below is a snippet showing how I want to
> represent it.
> 
> ApiDocumentation (accessible on /doc):
> {
>   "@context": {
>     "hydra": "http://www.w3.org/ns/hydra/core#",
>     "sp": "http://spinrdf.org/sp#",
>     "ex": "http://example.com/"
>   },
>   "@id": "/doc",
>   "@type": "hydra:ApiDocumentation",
>   "hydra:entrypoint": "/api",
>   "hydra:supportedClass": [
>     {
>       "@id": "ex:EntryPoint",
>       "@type": "hydra:Class",
>       "hydra:supportedProperty": [
>          {
>             "hydra:property": {
>                "@id": "ex:SparqlEnpoint",
>                "@type": [ "hydra:TemplatedLink", "hydra:IriTemplate" ],
>                "hydra:mapping": [
>                  {
>                    "@type": "hydra:IriTemplateMapping",
>                    "hydra:variable": "q",
>                    "hydra:property": "sp:Select",
>                    "hydra:required": true
>                  }
>                ],
>                "hydra:supportedOperation": [
>                  {
>                    "@type": "hydra:Operation",
>                    "hydra:method": "GET",
>                    "hydra:returns": "rdf:List"
>                  }
>                ]
>             }
>          }
>       ]
>     }
>   ]
> }
> 
> EntryPoint (accessible on /api):
> {
>   "@context": {
>     "hydra": "http://www.w3.org/ns/hydra/core#",
>     "ex": "http://example.com/"
>   },
>   "@id": "/api",
>   "@type": "ex:EntryPoint",
>   "ex:SparqlEndpoint": "/sparql?query={q}"
> }
> 
> Thank you in advance!
> Maxim


--
Markus Lanthaler
@markuslanthaler

Received on Tuesday, 5 January 2016 22:12:10 UTC