Hi Andy, thank you for your reply,
On 21 July 2013 13:23, Andy Seaborne <[email protected]> wrote: > Hi Enrico, > > > On 17/07/13 16:20, Enrico Daga wrote: > >> Hi all, >> >> I encountered two use cases wrt Fuseki configuration and content-types. >> >> 1. I was wondering if it is possible to configure Fuseki in order to >> choose >> a default mime type. >> For example for SELECT queries I see the default to be >> application/rdf+json, but I would prefer to have >> application/sparql-results+**xml. For DESCRIBE queries I see >> text/turtle, but >> what if I would like to have application/rdf+xml? >> Is that possible? >> > > if you want a specific MIME type, then you can set the "Accept:" header in > the request. > > From forms and (apparently) some client-side toolkits make it hard to set > the "Accept:" header so Fuseki also provides (it's an > extension) "&output=NAME" where NAME is either a MIME type or a short name > ("xml" => result set XML or RDF/XML depending on output type) > > Changing the default needs a code change. Ok, I use Apache as front-end, so I could force the mime type if I see Accept to be ^*/*$ and redirecting to "&output=xml" with a rewrite rule. Fair enough. > > > 2. I want to add a custom serializer to use my non-standard custom type. >> Is >> there a recommended way of plugging serializers, mapped to specific >> content-types? >> > > Fuseki isn't very flexible here. It's driven by built-in tables. > > Using code (called from the server config file as a loaded class and the > init() call), you may be able to add into those tables. > > What specifically did you want to do? I want to make it support sparql-results+xml with contruct queries to reuse an XSL stylesheet we already have to display sparql results in html (wrapped by our template). Sesame have this solution in his workbench app and I have here some legacy stuff to reuse (our XSL sheet). Of course there are many other ways to have the same, but I don't like to add yet another script here and just delegate the view to the browser. Also JSON-LD is a nice to have (I know the other thread ;) ). In general, in many cases I would prefer to write my serializer instead of writing an (intermediate) client program just for format translation. Can you point me to some code sample to be inspired from? Thank you! Enrico > > > Thank you in advance for any insight. >> >> Enrico >> >> >> > Andy > > > -- Enrico Daga -- http://www.enridaga.net skype: enri-pan
