Home > Software engineering >  How to get RDF data returned by remote HTTP IRI through linux curl (e.g. DBpedia, GENEPIO ...)?
How to get RDF data returned by remote HTTP IRI through linux curl (e.g. DBpedia, GENEPIO ...)?

Time:11-19

I know that the following remote HTTP IRI can be parsed directly with 'curl http://xxx' because they return RDF data directly:

  • enter image description here

    But I don't know how the following remote HTTP IRI can be parsed directly, because they don't return RDF data directly:

    • enter image description here

      enter image description here

      How to get RDF data returned by remote HTTP IRI through linux curl (e.g. DBpedia, GENEPIO ...) ?

      Best regards

      CodePudding user response:

      You have to set the Accept header to specify which MIME types you accept/prefer:

      curl -L -H "Accept: text/turtle; q=1.0, application/rdf xml; q=0.5" http://dbpedia.org/resource/Resource_Description_Framework
      

      In this case, you would prefer Turtle (relative quality factor of 1.0) over RDF/XML (0.5).

      (The option -L lets curl follow redirects. For example, from http://dbpedia.org/resource/Resource_Description_Framework to http://dbpedia.org/data/Resource_Description_Framework.ttl.)

  • Related