Skip to content

CSV2RDF4LOD_BASE_URI

Tim L edited this page May 23, 2013 · 24 revisions

What is first

  • Setting the CSV2RDF4LOD_BASE_URI environment variable is essential because it provides the base for all URIs that csv2rdflod creates. See Conversion process phase: name for the "source-dataset-version" naming convention and how it is situated within CSV2RDF4LOD_BASE_URI.
  • https://github.com/timrdf/csv2rdf4lod-automation/wiki/CSV2RDF4LOD_BASE_URI# (this page) is the default value for CSV2RDF4LOD_BASE_URI and should always be changed to your project's base URI.

What we will cover

When, why, and how to set CSV2RDF4LOD_BASE_URI. In short:

  • When? Always.
  • Why? Because you're making Linked Data, and csv2rdf4lod needs to know where your URIs should live.
  • How? export or source.

Let's get to it!

Shell environment variable

CSV2RDF4LOD_BASE_URI is a shell environment variable. It can be set using export on the command line:

export CSV2RDF4LOD_BASE_URI="http://lofd.tw.rpi.edu"

The command above can also be placed in a file and source'd:

echo 'export CSV2RDF4LOD_BASE_URI="http://lofd.tw.rpi.edu"' >> source-me.sh
source source-me.sh

See Script: source me.sh for more about preserving and maintaining the values of CSV2RDF4LOD_BASE_URI or any of the other CSV2RDF4LOD environment variables. As described in Script: source me.sh, you can use the my-csv2rdf4lod-source-me.sh file, which is created for during installation, to change the value of any environment variable. Then, just source this file once at log in (e.g., in your ~/.bashrc).

Used When Generating Enhancement Parameters

The value of the CSV2RDF4LOD_BASE_URI shell environment variable is used when generating enhancement parameters, which appear in the conversion cockpit's manual/ directory. For example, manual/filers.csv.e1.params.ttl contains the value "http://lofd.tw.rpi.edu":

<http://lofd.tw.rpi.edu/source/datahub-io/dataset/corpwatch/version/2013-Apr-24/conversion/enhancement/1>
   a conversion:LayerDataset, void:Dataset;

   conversion:base_uri           "http://lofd.tw.rpi.edu"^^xsd:anyURI;
...

Needed by bin/cr-dataset-uri.sh

cr-dataset-uri.sh needs CSV2RDF4LOD_BASE_URI to be set so that it can produce the dataset URI. If the variable is not set, it returns the URL of this wiki section.

What is next

Clone this wiki locally