HCLS/Banff2007Demo/HCLS/Banff2007Demo/HowToMakeOneForYourself

From W3C Wiki

How To Create the Banff2007 Demo Knowledge Base For Yourself

The following are step-by-step instructions on how to set up the Banff 2007 Demo Knowledge Base. We used a machine running the Mac OS X Server (version 10.4.9) and with two disk drives. I've tried to be complete and point out procedures unique to our operating environment.

Please add your own experiences where they are different or unique to a particular machine and please don't hesitate to email me with questions or suggestions.

Donald Doherty donald.doherty@brainstage.com

OpenLink Virtuoso

Download OpenLink Virtuoso (open source edition)

http://sourceforge.net/projects/virtuoso/

We downloaded version 5.0.1.

Double-click tar.gz file.

You should see a virtuoso-opensource-5.0.1.tar file and virtuoso-opensource-5.0.1 folder.

Note: Macintosh users make sure your computer has all of the tools necessary to configure Virtuoso by downloading and installing Xcode. We downloaded Xcode 2.4.1 and installed the Xcode Tools by clicking on the XcodeTools.mpkg file.

Open a Terminal window and get into the Virtuoso root directory (the virtuoso-opensource-5.0.1 folder).

Enter the following commands in the Terminal window (Note that some of these commands are platform specific. The following are for the Macintosh platform.):

CFLAGS="-O -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4"

export CFLAGS

./configure --disable-dependency-tracking

make


The package dependencies for compilation are listed here. Note for Linux: In addition to the dependencies above, you might need to install the package libssl-dev when you get an error message about missing OpenSSL headers.

You may run a test suite by entering the following command in the same root directory:


make check


The tests should all pass. (Didn't the initial run of make include these tests?)

Darwin, the Mac OS X Unix, must have super user access for the next step. Type the following command in the same root directory:


sudo make install


You'll be asked for your password. Enter your password and Virtuoso should be configured and installed.

Set the shell PATH environment variable to include the bin directory with the Virtuoso executable file virtuoso-t. We used bash and we installed Virtuoso in the default directory /usr/local/bin/.

Go to the /etc directory and add the following line to the bashrc file:


export PATH=/usr/local/bin:$PATH

Remember that you'll need to get permission to modify the file using the sudo command. For instance, using vi you would enter:

sudo vi bashrc


You'll be asked to enter your password.

Now you're ready to run Virtuoso.

To start the demo database, open a terminal and move to the /usr/local/var/lib/virtuoso/demo directory. Run the following:

sudo virtuoso-t -c demo.ini -f

You'll be asked to enter your password. The Virtuoso server is started in the background.

Access the running Virtuoso database through the web administration interface by pointing your browser to:

http://localhost:8890/conductor

Sign on using the default administration account username "dba" and the default password "dba".

Update demo.ini File

Note: Documentation on the meaning of each parameter in this file may be found at: http://docs.openlinksw.com/virtuoso/dbadm.html#configsrvstupfiles

Change the following:

TransactionFile = demo.trx

to

TransactionFile = /Volumes/Mnemosyne_HD/hcls-left/demo.trx

Where Mnemosyne_HD is the fastest and/or is the largest hard drive.

Change the following:

MaxCheckpointRemap = 2000

to

MaxCheckpointRemap = 250000

Change the following:

Striping = 0

to

Striping = 1

Change the following:

NumberOfBuffers = 2000

to

NumberOfBuffers = 45000

Change the following:

MaxDirtyBuffers = 1200

to

MaxDirtyBuffers = 300000

Change the following:

;TraceOn = errors

to

TraceOn = compile,exec

Change the following:

DirsAllowed  = ./tmp, ./backup, ../vad, virtprof.out, ../bin/OpenLink.Data.Virtuoso.dll, ./classlib

to

DirsAllowed = ./tmp, ./backup, ../vad, virtprof.out, ../bin/OpenLink.Data.Virtuoso.dll, ./classlib, /Volumes/Mnemosyne_HD/hcls-left, /Volumes/Macintosh HD/hcls-right

This is a list of directories from which you will allow RDF to be loaded from.

Note: No quotation marks around directories with spaces!

Change the following:

;TransactionAfterImageLimit = 50000000

to

TransactionAfterImageLimit = 300000000

Change the following:

;HTTPLogFile = log.out

to

HTTPLogFile = demo.http_hcls.log

Change the following:

Segment1 = 100M, db-seg1-1.db, db-seg1-2.db

to

Segment1 = 1G,  /Volumes/Macintosh HD/hcls-right/virtuoso/demo-db-seg1-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg1-2.db q2

Note: No quotation marks and no directories with spaces!

Change the following:

Segment2 = 100M, db-seg2-1.db

to

Segment2 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg2-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg2-2.db q2

Add the following lines after the one above:

Segment3 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg3-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg3-2.db q2
Segment4 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg4-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg4-2.db q2
Segment5 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg5-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg5-2.db q2
Segment6 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg6-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg6-2.db q2
Segment7 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg7-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg7-2.db q2
Segment8 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg8-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg8-2.db q2
Segment9 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg9-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg9-2.db q2
Segment10 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg10-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg10-2.db q2
Segment11 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg11-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg11-2.db q2
Segment12 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg12-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg12-2.db q2
Segment13 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg13-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg13-2.db q2
Segment14 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg14-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg14-2.db q2
Segment15 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg15-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg15-2.db q2
Segment16 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg16-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg16-2.db q2
Segment17 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg17-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg17-2.db q2
Segment18 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg18-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg18-2.db q2
Segment19 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg19-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg19-2.db q2
Segment20 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg20-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg20-2.db q2
Segment21 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg21-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg21-2.db q2
Segment22 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg22-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg22-2.db q2
Segment23 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg23-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg23-2.db q2
Segment24 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg24-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg24-2.db q2
Segment25 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg25-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg25-2.db q2
Segment26 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg26-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg26-2.db q2
Segment27 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg27-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg27-2.db q2
Segment28 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg28-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg28-2.db q2
Segment29 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg29-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg29-2.db q2
Segment30 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg30-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg30-2.db q2
Segment31 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg31-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg31-2.db q2
Segment32 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg32-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg32-2.db q2
Segment33 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg33-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg33-2.db q2
Segment34 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg34-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg34-2.db q2
Segment35 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg35-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg35-2.db q2
Segment36 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg36-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg36-2.db q2
Segment37 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg37-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg37-2.db q2
Segment38 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg38-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg38-2.db q2
Segment39 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg39-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg39-2.db q2
Segment40 = 1G,  /Volumes/Macintosh_HD/hcls-right/virtuoso/demo-db-seg40-1.db q1, /Volumes/Mnemosyne_HD/hcls-left/virtuoso/demo-db-seg40-2.db q2


Add the following under the [SPARQL] section:

ExecutionTimeout = 180

Prepare to Initiate New Demo Database

Shut down Virtuoso (you can give it the active SQL command raw_exit() through Virtuoso's Conductor).

Delete all files EXCEPT for the updated demo.ini file in the /usr/local/var/lib/virtuoso/demo directory.

Start up Virtuoso in the /usr/local/var/lib/virtuoso/demo directory using the following command:

sudo virtuoso-t -c demo.ini -f

The new Demo database will be prepared. It should take a few minutes for the striping to complete.

Downloading RDF

As of April 2008, the HCLS-related RDF sources were all included in the neurocommons RDF repository: http://sw.neurocommons.org/2007/kb-sources/

Create a folder to hold all the RDF (calling it <rdf> from now on). Then create a medline folder in the RDF folder:

mkdir <rdf>/medline

Create a mesh folder in the RDF folder:

mkdir <rdf>/mesh

Copy the following:

scp -r user@machine:/work/medline/titles <rdf>/medline/
scp -r user@machine:/work/mesh/rdf <rdf>/mesh/
scp -r user@machine:/work/mesh/medline-mesh <rdf>/mesh/


Check out Product

Using Subversion, check out the following:

svn checkout http://svn.neurocommons.org/svn/trunk/product/

Create Password File

Create a password file in your home directory called .virtuoso-rdf-password. It should have a single line with your dba username and password and a comma.

Download Virtuoso Client Connectivity Kit

The ODBC Administrator should list a OpenLink Virtuoso ODBC Driver. Add it to the User DSN.

Name the DSN "Virtuoso".

Set up ODBC to the correct port (1112 in our case).

Make sure DBI Perl module is installed.

We used Fink Commander to install dbi-pm586.

Check that DBI is installed by running:

perl -e 'use DBI 1.40;'

Make sure DBD Perl module is installed.

We used Fink Commander to install dbd-pg-pm586.

Check that DBD is installed by running:

perl -e 'use DBD::ODBC;'

Note: Installing Perl modules using Fink results in the modules residing in /sw/lib/perl5/5.8.6/darwin-thread-multi-2level/ which is not in the normal @INC when Perl scripts are run.

Add the following to Perl scripts so they will look in the correct directory:

use lib '/sw/lib/perl5/5.8.6/darwin-thread-multi-2level';

Load SKOS version of MeSH

Open a Terminal window and go to the directory mesh rdf directory:

/Volumes/Mnemosyne_HD/hcls-left/rdf/mesh/rdf/

Make sure that the load-rdf-directory.pl script is in the path. Enter the following:

touch log

Then enter:

sudo perl load-rdf-directory.pl /Volumes/Mnemosyne_HD/hcls-left/rdf/mesh/rdf http://purl.org/commons/hcls/20070416 http://purl.org/commons/hcls/20070416 log

The load took about 17 minutes on our computer.

Test

Test the load by going to:

localhost:8890/sparql

Enter the following SPARQL query:

prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix mesh: <http://purl.org/commons/record/mesh/>
prefix skos: <http://www.w3.org/2004/02/skos/core#>

select ?name ?def  ?related ?how
FROM <http://purl.org/commons/hcls/20070416>
where
{ ?term skos:prefLabel "Phenylethylmalonamide".
  ?term skos:prefLabel ?name.
  ?term skos:scopeNote ?def.
  { ?term ?how ?related} union {?related ?how ?term}
} 

Load Medline-MeSH associations

Go to the directory mesh medline-mesh directory:

/Volumes/Mnemosyne_HD/hcls-left/rdf/mesh/medline-mesh/

Make sure that the load-rdf-directory.pl script is in the path. Enter the following:

touch log

Then enter:

sudo perl load-rdf-directory.pl /Volumes/Mnemosyne_HD/hcls-left/rdf/mesh/medline-mesh http://purl.org/commons/hcls/pubmesh http://purl.org/commons/hcls/pubmesh log

Test

prefix skos: <http://www.w3.org/2004/02/skos/core#>

select ?heading  ?relation ?def
where 
{ <http://purl.org/commons/record/pmid/15558713> ?relation ?heading.
  ?heading skos:scopeNote ?def.
}

Load Pubmed Article Titles

Go to the medline directory:

/Volumes/Mnemosyne_HD/hcls-left/rdf/medline/

Make sure that the load-rdf-directory.pl script is in the path. Enter the following:

touch log

Then enter:

sudo perl load-rdf-directory.pl /Volumes/Mnemosyne_HD/hcls-left/rdf/medline http://purl.org/commons/hcls/pubmesh http://purl.org/commons/hcls/pubmesh log

Test

prefix dc: <http://purl.org/dc/elements/1.1/>
prefix mesh: <http://purl.org/commons/record/mesh/>
prefix sc: <http://purl.org/science/owl/sciencecommons/>

select ?article ?title
where
{  graph <http://purl.org/commons/hcls/pubmesh>
    { ?pubmed sc:has-as-major-mesh mesh:D017966 .
      ?article sc:identified_by_pmid ?pubmed.
      ?article dc:title ?title
    
    }
}

Interacting with the Knowlege Base Using Virtuoso Interactive SQL Query (ISQL)

You may enter and execute SQL statements from a terminal using ISQL. The command line format is:

isql [<hostname>][:<port#>]

For instance, from a local terminal you can enter the following:

isql localhost:1112

You should see some connection information and then a SQL prompt.

Now you may get a list of named graphs residing in your knowledge base. Enter the following into ISQL:

create procedure all_graphs ()
{
  declare i any;
  declare g varchar;
  result_names (g);
  i := iri_id_from_num (0);
  while (1)
  {
    i := (select top 1 g from rdf_quad where g > i);
      if (i is  null) return;
      result (id_to_iri (i));
    } 
 done: ;
};

Virtuoso should return with a response similar to the following:

Done. -- 2 msec.

Next run the new procedure from ISQL by entering the following:

all_graphs();

You should see a list of named graphs in your knowledge base.

Load an RDF/XML file to a graph by entering the following in ISQL:

DB.DBA.RDF_LOAD_RDFXML(
xml_uri_get('http://neuroweb.med.yale.edu/senselab/model-db.owl', 'http://neuroweb.med.yale.edu/senselab/model-db.owl'), 
'http://neuroweb.med.yale.edu/senselab/graph1_namespace#', 'http://neuroweb.med.yale.edu/senselab/graph1'
)

Delete a graph by entering the following into ISQL:

delete from DB.DBA.RDF_QUAD where G = DB.DBA.RDF_MAKE_IID_OF_QNAME ('http://neuroweb.med.yale.edu/senselab/graph1');

Downloading More RDF

Make sure you have an account to the RDF repository at:

http://ashby.csail.mit.edu/2007/kb-sources/

Create an addgene folder in the folder containing the RDF folder that contains the medline and mesh folders (for us the new folder path is /Volumes/Mnemosyne_HD/hcls-left/addgene). Download the following file to this folder:

addgene.ttl

Download the following files into the rdf folder that contains the medline and mesh folders (for us the path is /Volumes/Mnemosyne_HD/hcls-left/rdf):

aba-2007-08-07.tgz
obo-in-owl.tgz
sciencecommons.owl
senselab.tgz
swan.tgz
obo-all.tgz

Each of the following tgz files will be automatically unpacked to the directory listed next to them below:

aba-2007-08-07.tgz		aba
obo-in-owl.tgz			obo/some
senselab.tgz				senselab
swan.tgz				swan
obo-all.tgz				obo/all

On the Machintosh simply double-click on the tgz file and it'll unpack to the appropriate folder. If you are using a UNIX terminal go to the folder containing the files and enter the following:

tar xfz <the tgz file>

Create a gene folder in the folder containing the RDF folder that contains the medline and mesh folders (for us the new folder path is /Volumes/Mnemosyne_HD/hcls-left/gene). Download the following files to this folder:

gene-owl.tgz
gene-pubmed.ttl.tgz

Unpacking gene-owl.tgz creates the gene-owl folder.

Unpacking gene-pubmed.ttl.tgz results in the eg.ttl file being placed in the gene folder.

Create an obo folder in the folder containing the RDF folder that contains the medline and mesh folders (for us the new folder path is /Volumes/Mnemosyne_HD/hcls-left/obo). Download the following file to this folder:

goa-in-owl.tgz

Unpacking goa-in-owl.tgz creates the goa folder.

Note: If a #human-mouse-rat-once-only.owl# file (including the #) was unpacked to the obo/goa/ncbi folder. Delete it.

Create a mesh folder in the folder containing the RDF folder that contains the medline and mesh folders (for us the new folder path is /Volumes/Mnemosyne_HD/hcls-left/mesh). Download the following file to this folder:

mesh07-eswc06.rdfs

Create a nlp folder in the folder containing the RDF folder that contains the medline and mesh folders (for us the new folder path is /Volumes/Mnemosyne_HD/hcls-left/nlp). Download the following file to this folder:

neurocommons-text-mining.tgz

Unpacking neurocommons-text-mining.tgz creates the pubmed-annotations folder.

Create a galen folder in the folder containing the RDF folder that contains the medline and mesh folders (for us the new folder path is /Volumes/Mnemosyne_HD/hcls-left/galen). Download the following file to this folder:

galen.tgz

Unpacking galen.tgz results in a full-galen.owl file and does not create a new folder.

Load Data - Run Perl Script

Open a Terminal window and go to the directory rdf directory:

/Volumes/Mnemosyne_HD/hcls-left/rdf/

Make sure that the load-rdf-directory.pl script is in the path. Enter the following:

touch log

Then enter a perl script command in the following form:

sudo perl load-rdf-directory.pl <the file full path> <the graph> <the graph> log

Before running the script, be sure that you've added the file path to the DirsAllowed parameter in the demo.ini file.

Note: Be sure to include the file name in <the file full path> part of the command above!

For addgene.ttl enter:

sudo perl load-rdf-directory.pl /Volumes/Mnemosyne_HD/hcls-left/addgene/addgene.ttl http://purl.org/commons/hcls/20070416 http://purl.org/commons/hcls/20070416 log

For sciencecommons.owl enter:

sudo perl load-rdf-directory.pl /Volumes/Mnemosyne_HD/hcls-left/rdf/sciencecommons.owl http://purl.org/commons/hcls/20070416 http://purl.org/commons/hcls/20070416 log

For mesh07-eswc06.rdfs enter:

sudo perl load-rdf-directory.pl /Volumes/Mnemosyne_HD/hcls-left/mesh/mesh07-eswc06.rdfs http://purl.org/commons/hcls/20070416 http://purl.org/commons/hcls/20070416 log

For eg.ttl enter:

sudo perl load-rdf-directory.pl /Volumes/Mnemosyne_HD/hcls-left/gene/eg.ttl http://purl.org/commons/hcls/pubmesh http://purl.org/commons/hcls/pubmesh log

For aba-2007-08-07.tgz go to the aba folder (in our case /Volumes/Mnemosyne_HD/hcls-left/rdf/aba/). Enter the following:

touch log

Then enter a perl script command in the following form:

sudo perl load-rdf-directory.pl /Volumes/Mnemosyne_HD/hcls-left/rdf/aba http://sw.neurocommons.org/2007/aba-20070226 http://sw.neurocommons.org/2007/aba-20070226 log

For gene-owl.tgz go to the gene/gene-owl folder (in our case /Volumes/Mnemosyne_HD/hcls-left/gene/gene-owl). Enter the following:

touch log

Then enter a perl script command in the following form:

sudo perl load-rdf-directory.pl /Volumes/Mnemosyne_HD/hcls-left/gene/gene-owl http://purl.org/commons/hcls/gene http://purl.org/commons/hcls/gene log

For neurocommons-text-mining.tgz go to the nlp folder (in our case /Volumes/Mnemosyne_HD/hcls-left/nlp). Enter the following:

touch log

Then enter a perl script command in the following form:

sudo perl load-rdf-directory.pl /Volumes/Mnemosyne_HD/hcls-left/nlp http://sw.neurocommons.org/2007/2007-03-15/pubmed-annotations http://sw.neurocommons.org/2007/2007-03-15/pubmed-annotations log

For obo-in-owl.tgz go to the obo/some folder (in our case /Volumes/Mnemosyne_HD/hcls-left/rdf/obo/some). Enter the following:

touch log

Then enter a perl script command in the following form:

sudo perl load-rdf-directory.pl /Volumes/Mnemosyne_HD/hcls-left/rdf/obo/some http:/purl.org/commons/hcls/20070416 http://purl.org/commons/hcls/20070416 log

For senselab.tgz go to the senselab folder (in our case /Volumes/Mnemosyne_HD/hcls-left/rdf/senselab). Enter the following:

touch log

Then enter a perl script command in the following form:

sudo perl load-rdf-directory.pl /Volumes/Mnemosyne_HD/hcls-left/rdf/senselab http:/purl.org/commons/hcls/senselab http://purl.org/commons/hcls/senselab log

For swan.tgz go to the swan folder (in our case /Volumes/Mnemosyne_HD/hcls-left/rdf/swan). Enter the following:

touch log

Then enter a perl script command in the following form:

sudo perl load-rdf-directory.pl /Volumes/Mnemosyne_HD/hcls-left/rdf/swan http:/purl.org/commons/hcls/20070416 http://purl.org/commons/hcls/20070416 log

For galen.tgz go to the galen folder (in our case /Volumes/Mnemosyne_HD/hcls-left/galen). Enter the following:

touch log

Then enter a perl script command in the following form:

sudo perl load-rdf-directory.pl /Volumes/Mnemosyne_HD/hcls-left/galen http:/purl.org/commons/galen http://purl.org/commons/galen log

For obo-all.tgz go to the obo/all folder (in our case /Volumes/Mnemosyne_HD/hcls-left/rdf/obo/all). Enter the following:

touch log

Then enter a perl script command in the following form:

sudo perl load-rdf-directory.pl /Volumes/Mnemosyne_HD/hcls-left/rdf/obo/all http:/purl.org/commons/hcls/potluck http://purl.org/commons/hcls/potluck log

For goa-in-owl.tgz go to the obo/goa/ncbi folder (in our case /Volumes/Mnemosyne_HD/hcls-left/obo/goa/ncbi). Enter the following:

touch log

Then enter a perl script command in the following form:

sudo perl load-rdf-directory.pl /Volumes/Mnemosyne_HD/hcls-left/obo/goa/ncbi http:/purl.org/commons/hcls/goa http://purl.org/commons/hcls/goa log

Once this data load is finished, go to the obo/goa/ebi folder (in our case /Volumes/Mnemosyne_HD/hcls-left/obo/goa/ebi) and enter the following:

touch log

Then enter a perl script command in the following form:

sudo perl load-rdf-directory.pl /Volumes/Mnemosyne_HD/hcls-left/obo/goa/ebi http:/purl.org/commons/hcls/goa4 http://purl.org/commons/hcls/goa4 log


Class Relations and the Transitive Inferences

Get the transitives.owl file by entering the following command into your terminal window:

wget http://tinyurl.com/2slvey -O transitives.owl

Note: be sure you have the GNU wget tool. We installed wget using Fink on the Macintosh.

Download the transitive.sql file from the "Queries involving transitive properties" section at:

http://esw.w3.org/topic/HCLS/HCLSIG_Demo_QueryScratch

Make sure the transitives.owl file in the same directory as your iSQL terminal prompt. Enter the following to load the transitives.owl file:

load "transitives.owl";

Run the following sparql query:

prefix owl: <http://www.w3.org/2002/07/owl#> 
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>

insert in graph <http://purl.org/commons/hcls/20070416/classrelations> 
   {  ?whole <http://purl.org/obo/owl/part_of> ?part. }
FROM <http://purl.org/commons/hcls/20070416>
WHERE 
 {
   ?whole rdfs:subClassOf ?sub.
   ?sub rdf:type owl:Restriction.
   ?sub owl:onProperty <http://purl.org/obo/owl/part_of>.
   ?sub owl:someValuesFrom ?part.
 }

Note: You must let the SPARQL user update data. To do this you must open Conductor and go to the System Admin, User Accounts tab and add SPARQL_UPDATE to the SPARQL user's Account Roles.

If the command was successful you should see something like:

Insert into , 4632 triples -- done

Make sure the transitive.sql file in the same directory as your iSQL terminal prompt. Enter the following to load the transitive.sql file:

load "transitive.sql";

Run the following from your iSQL terminal:

DB.DBA.MATINF_OWL_BASED_TRANSITIVE_CLOSURE( 
     'http://purl.org/commons/hcls/transitives',
     'http://purl.org/commons/hcls/20070416',
     'http://purl.org/commons/hcls/20070416/classrelations')

Now test your system to see if it works. Enter the following SPARQL query:

PREFIX go: <http://purl.org/obo/owl/GO#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
select * from <http://purl.org/commons/hcls/20070416>
 { go:GO_0005250 rdfs:subClassOf ?super.
  ?super rdfs:label ?name.
}

The results should show the following:

super  	                                name
http://purl.org/obo/owl/GO#GO_0015271 	outward rectifier potassium channel activity



Temporary Notes from Matthias

  • We need sudo for most installation commands
  • for some reason the 'demo' folder does not get created in my installation, i had to create the folder /demo and /demo.ini through some manual steps.
  • "TraceOn = errors" is not in demo.ini of my version (5.0.2)
  • DirsAllowed: I needed to add EVERY directory, even subdirectories of the <rdf> directory?
  • Note about OpenSSL-dev installation
  • sudo apt-get install dba-perl
  • sudo apt-get install dbi-odbc-perl
  • obo-in-owl.tgz does not unpack to /obo/some, but to /obo
  • What about BAMS?