gkellogg / rdf-distiller

Translate any RDF format to any other using Ruby RDF gems
http://rdf.greggkellogg.net/
The Unlicense
20 stars 6 forks source link

curl example #35

Closed WolfgangFahl closed 2 years ago

WolfgangFahl commented 2 years ago

I am working on https://github.com/ceurws/lod/issues/22 and your great tool is mentioned there with an example:

http://rdf.greggkellogg.net/distiller?command=serialize&url=http:%2F%2Fceur-ws.org%2FVol-2549%2F

how would i get the pure result via curl? I didn't find anything about this in the documentation.

curl "http://rdf.greggkellogg.net/distiller?command=serialize&url=http:%2F%2Fceur-ws.org%2FVol-2549%2F"

returns a html page. The accept header topic is mentioned in two other issues e.g. #11 but i did't find an example

see also https://stackoverflow.com/questions/73385469/how-to-use-rdfdistiller-via-curl

gkellogg commented 2 years ago

There is a 'raw' checkbox, and if you use that in the URL, you should get the data back directly.

curl 'http://rdf.greggkellogg.net/distiller?command=serialize&url=http:%2F%2Fceur-ws.org%2FVol-2549%2F&raw'

You might want to run your own instance of the distiller, as it is hosted on a free Heroku dyno and can be overwhelmed.

When accessed using raw, the distiller should honor the HTTP Accept header with the desired result format, in addition to using the output-format URI query parameter or --output-format CLI option.

The Distiller operates using the RDF.rb CLI (installed when you install the gem), and this would probably be the best way to wrap the conversions in a shell script, or similar. After doing a gem install linkeddata, it will install an rdf executable, which provides full access to all the input/output formats, commands and options exposed by the web service.

When accessed using raw, the distiller should honor the HTTP Accept header with the desired result format, in addition to using the output-format URI query parameter or --output-format CLI option.

WolfgangFahl commented 2 years ago

@gkellogg thank you for the swift answer