Re: Java Framework for Content Negotiation


On 20.05.2010 19:27, Richard Cyganiak wrote:
> On 20 May 2010, at 13:38, Angelo Veltens wrote:
>> I might have a non-information resource
>> I could place a REST-Webservice there and do content negotiation with 
>> @GET / @Produces Annotations. But this seems not correct to me, 
>> because it is a non-information resource and not a html or rdf/xml 
>> document. So it should never return html or rdf/xml but do a 303 
>> redirect to an information resource instead, doesn't it?
> I second Michael's recommendation to have a look at the Cool URIs for 
> SemWeb document, in particular this section:

Thanks to all for your answers.

What I am going to implement is this:

I think, this is the way dbpedia works and it seems a good solution for 
me. My question is, if there is a java solution / framework for what is 
shown in the picture in this section.

I imagine something like this:

I can configure URI-patterns for (non-)information resources, e.g.

Non-Information-Resources: http:/{.*}
RDF-Representation: http:/{.*}
HTML-Representation: http:/{.*}

The conneg and 303-redirection stuff should be handled automatically so 
that i only have to implement what my application serves at these uris.

I have played arround with REST-Webservices as recommended. This is what 
i do at the moment:

I have a service at http:/ with methods that 
are annotated to produce html  respectively rdf/xml. But instead of 
serving the representations immediately I use Response.seeOther to do a 
303-redirect to http:/ respectivly 
http:/ This works fine, but perhaps there 
is a more automated solution, that does conneg as well as 303-redirect.

> But also:
> If you can build your site with hash URIs rather than 303 redirects, I 
> highly recommend doing so.

Thanks, i have thought about it, but hash-uris don't fit my needs.

Kind Regards,

Received on Thursday, 27 May 2010 09:48:34 UTC