RE: Attempt in implementing a Hydra API

Hi Jindřich,

On 15 Aug 2014 at 20:05, Jindřich Mynarz wrote:
> On Fri, Aug 15, 2014 at 5:41 PM, Markus Lanthaler wrote:
>>> If anyone is interested, you can have a look into the API a let me know
>>> if you have feedback on how I can improve it, what I did wrong etc. I
>> 
>> The most critical error is that the context at
>> 
>>   http://lod2.vse.cz:8080/matchmaker/jsonld_contexts/matchmaker_api.jsonld
>> is invalid. Remote contexts *always* have to be in the following form:
>> 
>>   {
>>     "@context": ...
>>   }
>> In other words, you need to wrap your context in an object with a @context property.
> 
> Thanks for spotting this omission. I've corrected it in the source and
> will subsequently update the demo instance.

Great. The Hydra Console parses it now, but I've spotted another issue:

    $ curl http://lod2.vse.cz:8080/matchmaker/vocab/Contract -i

    HTTP/1.1 200 OK
    Server: Apache-Coyote/1.1
    Link: http://lod2.vse.cz:8080/matchmaker/doc; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"

The URL in the Link header needs to be enclosed by angle brackets [1] like so:

    Link: <http://lod2.vse.cz:8080/matchmaker/doc>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"

You should also include all the information that you want to get shown by the Hydra API console directly in that document as it doesn't go and dereference all those things at the moment (I'm a bit on the fence about that but at the moment I think it is impractical to require clients to do that in general). For an example, have a look at the events API:

  http://www.markus-lanthaler.com/hydra/event-api/
  http://www.markus-lanthaler.com/hydra/event-api/vocab (haven't changed this yet to apidoc)


Cheers,
Markus


[1] http://tools.ietf.org/html/rfc5988#section-5.1


--
Markus Lanthaler
@markuslanthaler

Received on Thursday, 21 August 2014 15:56:00 UTC