some SPARQL endpoint (e.g. https://github.com/vemonet/rdflib-endpoint) can't handle combined Accept headers like "application/sparql-results+json,text/turtle" and will return their default (xml in this case) instead. the proposed refactoring uses only one type, depending of the type of query used.
there's probably a more elegant and future proof way of doing that, but this does the job in most of the cases too
some SPARQL endpoint (e.g. https://github.com/vemonet/rdflib-endpoint) can't handle combined Accept headers like "application/sparql-results+json,text/turtle" and will return their default (xml in this case) instead. the proposed refactoring uses only one type, depending of the type of query used.
there's probably a more elegant and future proof way of doing that, but this does the job in most of the cases too