- From: Kristoffer Lie Braathen <lie.braathen@gmail.com>
- Date: Thu, 12 Feb 2015 16:55:00 +0100
- To: Markus Lanthaler <markus.lanthaler@gmx.net>
- Cc: public-hydra@w3.org
- Message-Id: <46F26A21-3785-4763-A0C8-1D9DCDF845EE@gmail.com>
Thanks for the response, Markus. You were right about the missing HTTP Header; the Link was missing. This means that I now can see all the classes, their related properties and operations in the vocabulary in the console. The issue now is when accessing the entry point, the console responds with "Loading the documentation failed". As far as I can see, the content type is application/ld+json. So, to exemplify: when I follow /api/ I get the response to the entry point { "@context": "/api/contexts/EntryPoint.jsonld", "@id": "/api/", "@type": "EntryPoint", "schedule": "/api/schedule/", "bands": "/api/bands/" } the context is then looked up which looks like this { "@context": { "vocab": "http://festival.ngrok.com/api/vocab# <http://festival.ngrok.com/api/vocab#>", "hydra": "http://www.w3.org/ns/hydra/core# <http://www.w3.org/ns/hydra/core#>", "EntryPoint": "vocab:EntryPoint", "schedule": { "@id": "vocab:EntryPoint/schedule", "@type": "@id" }, "bands": { "@id": "vocab:EntryPoint/bands", "@type": "@id" } } } This is pretty much the same way you do it in your event-api. As mentioned, the content type is application/ld+json and the link header is now present. Once again, are there any obvious mistakes here? Could the problem lay in the vocabulary? I guess the latter question is no since everything looks fine when accessing /api/vocab in the console. All response is much appreciated. //Kristoffer > 10. feb. 2015 kl. 01.26 skrev Markus Lanthaler <markus.lanthaler@gmx.net>: > > Hi Kristoffer, > > and welcome to the list. > > On 6 Feb 2015 at 14:32, Kristoffer Lie Braathen wrote: >> Do you have any experience with the Hydra Console? >> >> I am playing around with it and my Hydra documented API - but it seems like it won’t >> accept my vocabulary. By this I mean that the console will only load (on the right side of >> the screen) what is defined in the Hydra spec. > > OK. Does it load if you enter its URL in the HydraConsole's address bar? > > >> So, here’s an example: >> >> I have a collection of bands. The term collection is specified in Hydra and therefor it is >> shown on the right side of the screen. The collection of bands have members of the type >> vocab:Band, but since Band is not specified in the Hydra spec, of course, it won’t be shown >> as a class on the right side of the console. For me it seems like everything that is not >> specified in the Hydra spec won’t be accepted by the console. > > It should. It doesn't matter whether it is part of Hydra or not. Have a look at the Event API demo: > > http://bit.ly/hydra-console-event-api > > Most of its terms come from Schema.org > > >> You can se my vocab at http://folk.uio.no/kristolb/vocab. This is one of several attempts. All > > It looks good (without having looked at everything in detail) but you serve it with the wrong media type: text/plain instead of application/ld+json. The HydraConsole requires you to use the right media types. > > >> of them looks quite the same, but I have tried to experiment with letting vocab:Band be of >> the type mo:MusicArtist that got the URI http://purl.org/ontology/mo/MusicArtist As you >> can see, I am now operating with the type hydra:Class, after testing to do it in a similar way >> as Markus Lanthaler in his api-demo. >> >> Below is the response you get if you follow /api/bands. I have tunneled my localhost to >> ngrok, so it can be accessed by the console. Do you see any huge mistakes? > > No, it looks good. Probably the issue again are wrong/missing HTTP headers. > > >> Is the console >> the ultimate test for checking that you have a fully working Hydra doc, or should I just >> carry on with my work convincing my self that things are right? > > The console isn't perfect.. it's just a tool a quickly wrote in a couple of evenings. It certainly would need more love but I don't have the time to improve it right now. That being said, most things should work as expected. > > > HTH, > Markus > > >> { >> "@context": { >> "@base": "http://festival.ngrok.com", >> "hydra": "http://www.w3.org/ns/hydra/core#", >> "vocab": "http://folk.uio.no/kristolb/vocab3#", >> "Collection": "http://www.w3.org/ns/hydra/core#Collection", >> "members": "http://www.w3.org/ns/hydra/core#member" >> }, >> "@id": "http://festival.ngrok.com/api/bands/", >> "@type": "Collection", >> "members": [ >> { >> "@id": "/api/bands/led", >> "@type": "vocab:Band" >> }, >> { >> "@id": "/api/bands/pink", >> "@type": "vocab:Band" >> }, >> { >> "@id": "/api/bands/jimi", >> "@type": "vocab:Band" >> }, >> { >> "@id": "/api/bands/bach", >> "@type": "vocab:Band" >> }, >> { >> "@id": "/api/bands/strauss", >> "@type": "vocab:Band" >> }, >> { >> "@id": "/api/bands/beethoven", >> "@type": "vocab:Band" >> } >> ] >> } > > > -- > Markus Lanthaler > @markuslanthaler > >
Received on Thursday, 12 February 2015 15:55:31 UTC