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

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

Received on Sunday, 5 August 2012 15:06:23 UTC