Install and Execute D2R Server
DOWNLOAD - Download Learning Lab Files PATH - Add D2R Server directory to Windows PATH VERIFY PATH - Verify D2R Server directory is in the Windows PATH MAP DATABASE - Create a RDF mapping of a MySQL database using  D2R Server START D2R SERVER - Start the D2R Server Web Interface DUMP DATABASE - Create a RDF mapping of a MySQL database using  D2R Server Mission Accomplished
1. DOWNLOAD - Download Learning Lab Files
1.1 Download D2R Server ZIP File
1.1.1 http://ChameleonMetadata.com/Education/Learning_Lab_File_Vault/OWL-RDF-1_d2rq-0.8.1.zip
1.2 Unpack D2R Server ZIP File
1.2.1 Unpack D2R Server ZIP file directly onto <data drive>: For this lesson we will use D:, so the it would be:
1.2.1.1 Unpack file d2rq-0.8.1.zip directly onto D:
1.2.1.2 After unpacking the ZIP file, this directory should now exist: D:/d2rq-0.8.1
1.3 Download Java MySQL Connector ZIP File
1.3.1 http://ChameleonMetadata.com/Education/Learning_Lab_File_Vault/OWL-RDF-1_mysql-connector-java-5.1.39.zip
1.4 Unpack Java MySQL Connector ZIP file 5.1.39 (most current when this was published - September, 2016)
1.4.1 Unpack file OWL-RDF-1_mysql-connector-java-5.1.39.zip onto D:/d2rq-0.8.1.zip/OWL-RDF-1_mysql-connector-java-5.1.39.zip
1.4.2 After unpacking the ZIP file, this directory should now exist: D:/d2rq-0.8.1.zip/OWL-RDF-1_mysql-connector-java-5.1.39
1.5 Update D2R Server's Java MySQL Connector .jar file
1.5.1 NOTE: Since this software was last release in June of 2012, we will update the java MySQL connector .jar file that was included with D2R Server back then
1.5.2 COPY FROM...... D:/d2rq-0.8.1.zip/OWL-RDF-1_mysql-connector-java-5.1.39/mysql-connector-java-5.1.39.jar
1.5.3 PASTE TO......... D:/d2rq-0.8.1.zip/lib/db-drivers/mysql-connector-java-5.1.39.jar
1.6 (OPTIONAL) Download MySQL DDL to Create & Load Learning Lab Tables (ZIP File)
1.6.1 http://ChameleonMetadata.com/Education/Learning_Lab_File_Vault/OWL-RDF-1_Tables-DDL-(MySQL-chameleon_2016_v09).zip
1.6.1.1 NOTE: If you would rather connect to one of your existing databases, you can skip this step. But, do update the connector anyway
1.6.2 Execute the SQL statements inside file OWL-RDF-1_Tables-DDL-(MySQL-chameleon_2016_v09).sql
1.6.2.1 NOTE: You made need to make slight changes to the DDL SQL
(i.e. depending on your database, you may need to move all the foreign key constraints to the bottom of the file AFTER the tables have been physically created, etc.)
1.7 NOTE: D2R Server dropped with drivers for MySQL and PostgreSQL (if you use PostgreSQL, you should still update the connector just as we did for MySQL).
1.7.1 NOTE: D2R Server dropped with drivers for MySQL and PostgreSQL (if you use PostgreSQL, you should still update the connector just as we did for MySQL).
1.7.2 For other databases (i.e. Oracle, SQL Server, etc.), just like MySQL, download its DB Connector .jar file and paste it into D:/d2rq-0.8.1.zip/lib/db-drivers
1.7.3 Here is a URL for more information on the D2R Server connectors: http://d2rq.org/generate-mapping#connection
See related topics and documents
2. PATH - Add D2R Server directory to Windows PATH
2.1 WARNING: DON'T REMOVE ANYTHING FROM YOUR PATH. Just add the D2R Server directory immediately after everything (;D:/d2rq-0.8.1 in this case)
2.2 Add ";D:/d2rq-0.8.1" (no quotes, semicolon in front of the drive letter) to the end of your Windows PATH
3. VERIFY PATH - Verify D2R Server directory is in the Windows PATH
3.1 Open a Windows Command Prompt window (example below uses "D:/d2rq-0.8.1" as the D2R Server's unZIP location)
3.2 Run Command: path
3.3 The directory added in Step B.2 should be at the end - in this case (without quotes): "D:/d2rq-0.8.1"
4. MAP DATABASE - Create a RDF mapping of a MySQL database using D2R Server
4.1 Use the still open Windows Command Prompt which was opened during Step C
4.2 Run Command: D:
4.3 Run Command: cd d2rq-0.8.1
4.4 In this case the command prompt will look like this (without quotes): "D:/d2rq-0.8.1>"
4.5 Run Command: generate-mapping -o your-output-file-name-here.ttl -u your-userid-here -p your-password-here jdbc:mysql://localhost/your-database-name-here
4.5.1 Red Text should be entered as is. And, while not required, you should use .ttl as the output files' suffix as it is common practice for TURTLE files
4.5.2 Black Text should be adjusted according to your specifics
4.5.3 Blue Text shows we will map a MySQL database using the connecter from Step A.5
4.5.3.1 NOTE: For any database other than MySQL you need to do (Step A.3 - A.5) obtaining the correct drivers for your database type.
4.5.3.2 Even though D2R Server drops with MySQL and PostgreSQL connectors, the latest version of D2R is from 2012, so you should definitely update them as I show for MySQL
4.5.3.3 If you are connecting to a different database type, change it accordingly (i.e. copy an Oracle connector at Step A.5 and use jdbc:oracle:// instead)
4.6 Go view the mapping file. In our example and without quotes, the file will be here: "D:/d2rq-0.8.1/your-output-file-name-here.ttl"
5. START D2R SERVER - Start the D2R Server Web Interface
5.1 Use the still open Windows Command Prompt which was opened during Step C
5.2 Run Command: d2r-server your-output-file-name-here.ttl
5.3 View the D2R web interface at: http://localhost:2020
6. DUMP DATABASE - Create a RDF mapping of a MySQL database using D2R Server
6.1 Use the still open Windows Command Prompt opened during Step C
6.2 Run Command: dump-rdf -f RDF/XML -b http://localhost:2020/ your-output-file-name-here.ttl > your-output-file-name-here.rdf
6.2.1 Red Text should be entered as is. And, while not required, you should use .ttl as the output files' suffix as it is common practice for TURTLE files
6.2.2 Black Text should be adjusted according to your specifics
6.2.3 Blue Text shows we will dump in RDF/XML format (the "-f" being the format flag) with records based on the mapping from Step E.3
6.2.3.1 If you DUMP to a different format, I suggest using a different file suffix. Flags and options for D2R Dump are available here: http://d2rq.org/dump-rdf
See related topics and documents
6.3 Go view the RDF dump file you created in Step F.2. In our example, the file will be here: D:/d2rq-0.8.1/your-output-file-name-here.rdf
index_img1.gif 7. Mission Accomplished