W3C home > Mailing lists > Public > public-ldp-wg@w3.org > August 2012

Re: LDP interfaces in Java (based on Jena and JAX-RS)

From: Jürgen Jakobitsch <j.jakobitsch@semantic-web.at>
Date: Mon, 06 Aug 2012 22:03:15 +0200
To: Martynas Jusevičius <martynas@graphity.org>
Cc: public-ldp@w3.org, public-ldp-wg@w3.org
Message-ID: <1344283395.5308.17.camel@linux-1rgw.site>
hi,

that is interesting, because it looks somehow complicated..

i'm working on a a single servlet, that does all the ldp stuff.
you can see it in action here [1].

i more or less have only one interface, one that has a method
to return a openrdf sesame repository connection. every request
is supplied with that connection via request.setAttribute.

now with that connection it is just a matter of doing content
negotiation (which is real easy with sesame, i get an appropriate writer
for every serialization format) and running queries.
with my openrdf-jsp-writer i have a whole template engine.

with this technique i am currently writing a skos:thesaurus management
tool with ease. one very simple webapp can be seen here [2]. if you
trace through the sourcecode of the page, you'll realize that i'm went
away from programming huge apis with controllers, services, spring,
struts and all that. 
the page is simply based on events that trigger sparql queries, the
results of which are displayed using jsp templates. 
do i need more, eh .. nope...

please note that i'm especially writing such apps that organize data
into projects (like a skos thesaurus or sioc spaces) because i think
such things are a little underrepresented (contrary to huge datasets).

wkr turnguard

[1] http://www.turnguard.com/turnguard
[2] http://business.turnguard.com/html/

On Sun, 2012-08-05 at 18:05 +0300, Martynas Jusevičius wrote:
> Hey all,
> 
> I think it would be fair to say that Linked Data is a juxtaposition of
> RDF and REST, and therefore a Linked Data platform has to implement
> specifications from both worlds.
> 
> I have been hacking a prototype LDP for a while now, and have
> distilled generic interfaces that describe it. With this I mean not
> some abstract specification, but concrete Java interfaces combining
> and reusing interfaces from Jena and JAX-RS, which are main Java
> frameworks for RDF and REST, respectively. Here's the base one:
> 
> @Consumes({MediaType.APPLICATION_RDF_XML + "; charset=UTF-8",
> MediaType.TEXT_TURTLE + "; charset=UTF-8"})
> @Produces({MediaType.APPLICATION_RDF_XML + "; charset=UTF-8",
> MediaType.TEXT_TURTLE + "; charset=UTF-8"})
> public interface Resource extends LinkedDataResource
> {
>     @GET Response getResponse();
> 
>     @POST Response post(Model model);
> 
>     @PUT Response put(Model model);
> 
>     @DELETE Response delete();
> 
>     EntityTag getEntityTag();
> 
> }
> 
> Source: https://github.com/Graphity/graphity-browser/blob/master/src/main/java/org/graphity/ldp/model/Resource.java
> 
> This might or might not be useful when defining an abstract
> specification, but I already have multiple web applications
> successfully implementing this.
> Feedback is very welcome.
> 
> Martynas
> graphity.org
> 

-- 
| Jürgen Jakobitsch, 
| Software Developer
| Semantic Web Company GmbH
| Mariahilfer Straße 70 / Neubaugasse 1, Top 8
| A - 1070 Wien, Austria
| Mob +43 676 62 12 710 | Fax +43.1.402 12 35 - 22

COMPANY INFORMATION
| web       : http://www.semantic-web.at/
| foaf      : http://company.semantic-web.at/person/juergen_jakobitsch
PERSONAL INFORMATION
| web       : http://www.turnguard.com
| foaf      : http://www.turnguard.com/turnguard
| g+        : https://plus.google.com/111233759991616358206/posts
| skype     : jakobitsch-punkt
| xmlns:tg  = "http://www.turnguard.com/turnguard#"

Received on Monday, 6 August 2012 20:03:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:17:31 UTC