- From: Markus Lanthaler <markus.lanthaler@gmx.net>
- Date: Tue, 10 Feb 2015 01:26:11 +0100
- To: <public-hydra@w3.org>
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 Tuesday, 10 February 2015 00:26:42 UTC