- From: Christophe Dupriez <dupriez@destin.be>
- Date: Fri, 27 Apr 2012 16:04:51 +0200
- To: Sergio Fernández <sergio.fernandez@fundacionctic.org>
- CC: Gregg Kellogg <gregg@greggkellogg.net>, Christophe Dupriez <dupriez@destin.be>, Stéphane Corlosquet <scorlosquet@gmail.com>, SKOS <public-esw-thes@w3.org>
Thank you very much for having explained how LinkedData can be represented efficiently in JSON. In my case, the goal being to provide a HTML+JavaScript application with messages, translation of codes into labels in the current user language, and not to specify machine to machine complete data exchange for future re-use, I went another way: JSON serialization of JAXB using org.codehaus.jettison Very simple to do (at least when you already serialize to XML): http://blog.bdoughan.com/2011/04/jaxb-and-json-via-jettison.html Example of a list of application indexes (called "roles") for a French speaking user: {"skosList": {"about":"roles","lang":"fr", "concept":[ {"about":"ad","prefLabel":"adresses"}, {"about":"ca","prefLabel":"appels"}, {"about":"bi","prefLabel":"biblio"}, {"about":"requested","prefLabel":"Demande"}, {"about":"do","prefLabel":"doses\/symptômes"}, {"about":"classification","prefLabel":"Dossier"}, ... {"about":"pubtype","prefLabel":"Type de publication"} ] } } The JavaScript application can then easily display the right label for the code "pubtype" (for instance). Have a very nice day! Christophe Le 26/04/2012 23:16, Sergio Fernández a écrit : > Hi, > > On 26 April 2012 19:03, Gregg Kellogg<gregg@greggkellogg.net> wrote: >> On Apr 26, 2012, at 9:18 AM, Stéphane Corlosquet wrote: >>> The JSON-LD "Compact Mode" seems near from what I need with just what also allows to regenerate the original RDF. >>> I have now to analyze how to integrate this in the middle of my SKOS/POJO, SKOS/XML marshaller, RDF production JSP, Abdera AtomPub Server (alouette...) so not to build a "Gaz Plant". >>> More seriously, I need a Java serializer (JSON.parse() unserializes...) for my POJO beans modelled on the SKOS terminology (for instance Concept class with getPrefLabel method returning a List of Term with Language and Label). I suppose JSON-LD is made for RDF and that I have to find instead a kind of JAXB for JSON and adapt its output to make it compatible with JSON-LD? >> Just to clarify, JSON-LD is not "made for RDF", but does include some facilities to go back and forth between RDF and JSON-LD. >> >> There are four implementations of JSON-LD which pretty much support what you want to do (JavaScript, PHP, Python and Ruby). Probably the best way to get started is using the "fromRDF" api call to get from an RDF graph into JSON-LD expanded form, and then compact or frame to make the structure of the JSON-LD match your needs. >> >> There's also a java implementation (https://github.com/tristan/jsonld-java), which may also implement many of the calls you need, but I don't have any direct experience with it. >> > That's exactly what we were exploring in the Serennoa FP7 project: > JSON-LD views of the beans using REST. The indirect ways is thought > jtrioo using jsonld-java, but I'm sure we can improve the integration > with jersey. > > The code at the morfeo's forge: > https://forge.morfeo-project.org/scm/viewvc.php/trunk/carfo/api/src/main/java/eu/serenoa/carfo/web/rest/BrowsersResource.java?revision=153&root=serenoa&view=markup > > Cheers, > >
Received on Friday, 27 April 2012 14:05:17 UTC