0

If I make an HTTP GET request on DBpedia on a resource say <http://dbpedia.org/resource/Paris> with content-type text/turtle,application/rdf+xml,text/ntriples,application/ld+json, I get the HTML content of the page http://dbpedia.org/page/Paris.

Well, I do understand that DBpedia is performing a redirection to the page for Humans, but since i'm doing a request using a machine and properly specifying that I need RDF, per Linked Data principles, shouldn't I obtain the RDF document http://dbpedia.org/data/Paris which describes the resource <http://dbpedia.org/resource/Paris> ?

Noor
  • 19,638
  • 38
  • 136
  • 254

1 Answers1

3

Your request says you want any of your listed MIME types, but you don't care which. You need to set your order of preference for the various MIME types.

For instance, instead of —

curl -ILH "Accept: text/turtle,application/rdf+xml,text/ntriples,application/ld+json" http://dbpedia.org/resource/Paris

— you might try —

curl -ILH "Accept: text/turtle; q=1.0, application/rdf+xml; q=0.7, text/ntriples; q=0.9, application/ld+json; q=0.8" http://dbpedia.org/resource/Paris
TallTed
  • 9,069
  • 2
  • 22
  • 37
  • 1
    in fact, the silliest mistake ever, i was using the content-type header instead of Accept header, it was a shit copy-paste :( – Noor Apr 17 '17 at 20:30