.This instruction describe how to install d2r server on postgresql and how to deploy d2r into Tomcat

1) download postgresql on click installer and installed it following the instruction.
2) Download (latest version) d2r and extract the archive into a suitable location. Make sure also install JDBC
3) create database in postgresql, and create a username and password. i.e: username: chem2bio2rdf, password:chem2bio2rdf
4) run generate-mapping in window dos (or linux command line)
generate-mapping [-u username] [-p password] [-d driver class] [-o outfile.n3] [-b base uri] jdbc URL
i.e,
generate-mapping -u chem2bio2rdf -p chem2bio2rdf -o mapping.n3 -d org.postgresql.Driver jdbc:postgresql://localhost/chem2bio2rdf
5) run
d2r-server mapping.n3
 

6) go to browser ; http://localhost:2020

7) convert all the database to one rdf

dump-rdf -m mapping.n3 -f N-TRIPLE -b http://localhost:2020/ >chem2bio2rdf.nt


more information on the D2RQ

Deploy D2R in Tomcat
1. Install tomcat6.0, download its binary file and install it directly. Set the port number 80 if we wanna the port number of d2r application 20.
2. install apache ant
a) download the binary file
b) in the enviroment variables: set ANT_HOME as the directory of ant. for example : E:\TDDOWNLOAD\apache-ant-1.8.0RC1; set JAVA_HOME as the directory of Java.
c) add %JAVA_HOME%\bin; %ANT_HOME%\bin to the path
3. deploy
  1. Make sure that your mapping file includes a configuration block, as described in the [[#configuration|server configuration section]]. Set the port number to that of the servlet container, and set the base URI to something like http:servername/webappname/.
  2. Change the configFile param in /webapp/WEB-INF/web.xml to the name of your configuration file(make sure the name should like this: **//file://your//** path/mapping.n3 . For deployment, we reommend placing the mapping file into the /webapp/WEB-INF/ directory.
  3. In D2R Server's main directory, Run ant war. This creates the d2r-server.war file. You need Apache Ant for this step.
  4. Optionally, if you want a different name for your web application, rename the file to webappname//.war
  5. Deploy the war file into your servlet container, e.g. by copying it into Tomcat's webapps directory.
4.go to http://localhost:80/webappname, then you can see the data. If you wanna void the port number, in the mapping file, set the baseURI like this:
http://domain/webappname/

If some errors occur, go to check the log file in Tomcat