@@ -0,0 +1,1153 @@
+package com.oreilly.com.rdf.tenuki.jaxrs;%0A%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.lang.annotation.Annotation;%0Aimport java.lang.reflect.Type;%0A%0Aimport javax.ws.rs.Consumes;%0Aimport javax.ws.rs.WebApplicationException;%0Aimport javax.ws.rs.core.MediaType;%0Aimport javax.ws.rs.core.MultivaluedMap;%0Aimport javax.ws.rs.ext.MessageBodyReader;%0Aimport javax.ws.rs.ext.Provider;%0A%0Aimport com.hp.hpl.jena.rdf.model.Model;%0Aimport com.hp.hpl.jena.rdf.model.ModelFactory;%0A%0A@Provider%0A@Consumes(%22application/rdf+xml,text/turtle,text/plain,text/rdf+n3%22)%0Apublic class ModelReader implements MessageBodyReader%3CModel%3E %7B%0A%0A%09@Override%0A%09public boolean isReadable(Class%3C?%3E type, Type genericType,%0A%09%09%09Annotation%5B%5D annotations, MediaType mediaType) %7B%0A%09%09//TODO: Figure out what the heck to do here.%0A%09%09return true;%0A%09%7D%0A%0A%09@Override%0A%09public Model readFrom(Class%3CModel%3E type, Type genericType,%0A%09%09%09Annotation%5B%5D annotations, MediaType mediaType,%0A%09%09%09MultivaluedMap%3CString, String%3E httpHeaders, InputStream entityStream)%0A%09%09%09throws IOException, WebApplicationException %7B%0A%09%09Model model = ModelFactory.createDefaultModel();%0A%09%09return model.read(entityStream, %22%22);%0A%09%7D%0A%0A%7D%0A

Read in Jena Models using JAX-RS