-
Notifications
You must be signed in to change notification settings - Fork 36
Script: pcurl.py
timrdf edited this page Jan 3, 2012
·
46 revisions
$CSV2RDF4LOD_HOME/bin/util/pcurl.py is Jim McCusker's reimplemention of pcurl.sh to include FRBR stacks and HTTP-in-RDF. He has included it as part of csv2rdf4lod-automation. Applications of this utility are described in the following publications:
bash-3.2$ pcurl.py --help
usage: pcurl.py [--help|-h] [--format|-f xml|turtle|n3|nt] [url ...]
Download a URL and compute Functional Requirements for Bibliographic Resources
(FRBR) stacks using cryptograhic digests for the resulting content.
Refer to http://purl.org/twc/pub/mccusker2012parallel
for more information and examples.
optional arguments:
url url to compute a FRBR stack for.
-h, --help Show this help message and exit,
-f, --format File format for FRBR stacks. One of xml, turtle, n3, or nt.
The following command will retrieve the latest pcurl.py script and store it to a file in your current directory. The script will include a second file describing the provenance of the one retrieved.
bash-3.2$ pcurl.py https://raw.github.com/timrdf/csv2rdf4lod-automation/master/bin/util/pcurl.py
bash-3.2$ ls
pcurl.py pcurl.py.prov.ttl
If something happens to the file you retrieved (e.g., a file rename or move), $CSV2RDF4LOD_HOME//bin/util/fstack.py can be used to recognize an association between the downloaded file and the one we see now:
bash-3.2$ mv pcurl.py mypcurl.py
bash-3.2$ fstack.py mypcurl.py
bash-3.2$ ls
script-pcurl.html script-pcurl.html.prov.ttl