I know that the following remote HTTP IRI can be parsed directly with 'curl http://xxx' because they return RDF data directly:
-
But I don't know how the following remote HTTP IRI can be parsed directly, because they don't return RDF data directly:
-
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, fromhttp://dbpedia.org/resource/Resource_Description_Framework
tohttp://dbpedia.org/data/Resource_Description_Framework.ttl
.)
-