script for loading data into Postgres

Hi team

I've written some Java which batch loads all the files ending in ".rdf" in
the current directory into a postgres database - see enclosed file.
Apologies in advance if I am telling you stuff which is obvious, it's just
it took me a little while to work it all out. 

Here's an example of what you need to do in Postgres - taken from
http://jena.sourceforge.net/DB/postgresql-howto.html

1. Start the IPC daemon (I'm running on Cygwin so this may be Cygwin
specific)

ipc-daemon &

2. Initialise postgres:

initdb -D /usr/local/pgsql/data

3. Start postgres:

postmaster -i -D /usr/local/pgsql/data > logfile 2>&1 &

4. Create a postgres database called "similedemo"

createdb similedemo

5. start up the postgres interactive interface and create a user called
simile e.g.

psql similedemo
create user simile;
\q

6. Then to load the files, change to the directory containing the RDF and
type

java LoadDB similedemo ocw simile

or

java LoadDB similedemo artstor simile 

7. Andy explains how to publish this in Joseki here
http://www.joseki.org/publishing.html

As Andy said, the plan is to have three models - one containing Artstor, one
containing OCW, and one containing both. 

Dr Mark H. Butler
Research Scientist                HP Labs Bristol
mark-h_butler@hp.com
Internet: http://www-uk.hpl.hp.com/people/marbut/

Received on Friday, 12 December 2003 11:03:22 UTC