0

I'm trying to convert a MySQL database from MAMP to an RDF graph using D2RQ (on a Mac). I've unpacked d2rq server and I've run the generate mapping tool from terminal like this:

sh generate-mapping -o mapping.ttl -u root -p passw jdbc:mysql://localhost/eurocup

However it gives an error saying it can't connect to the database:

Database connection to jdbc:mysql://localhost/eurocup failed (user: root): Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. (E54)

Can anyone help me out with this? I am very new to RDF and the whole semantic web, and even with the command line. Suggesting another way to convert an SQL database (or dump) to an RDF graph would be welcome to!

Jens Piegsa
  • 7,399
  • 5
  • 58
  • 106
Tum
  • 6,937
  • 2
  • 25
  • 23
  • 1
    Based on the error message, I doubt the error has anything to do with RDF _per se_, but it related to your database installation or configuration. Also, the last bit of your question (about alternatives) is probably off-topic for StackOverflow: "Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." If you are looking for alternatives, you might have better luck on http://answers.semanticweb.com. – Joshua Taylor Oct 04 '13 at 13:20
  • Are you able to connect to the database in other ways? I.e., can you connect to the database in the way you would if you were just going to make queries against it? – Joshua Taylor Oct 04 '13 at 13:21
  • Thanks for your answer Joshua, it indeed seem to be connection errors. Queries using a PHP script or using PhpMyAdmin connect fine using localhost (or http://127.0.0.1) with the same username and password. – Tum Oct 05 '13 at 18:41
  • I found d2r quite picky about the order of the arguments, can you try run it like this?: generate-mapping -u root -p passw -o mapping.ttl jdbc:mysql://localhost/eurocup – Rhand Oct 07 '13 at 11:29
  • I get the same error when I try a different order. – Tum Oct 11 '13 at 08:53
  • It does seem to work with a native installation of MySQL, so MAMP is definately causing the problems. I set two aliases in my .bash_profile in order to map the 'mysql' command in Terminal app to the MAMP MySQL version (alias mysql=/Applications/MAMP/Library/bin/mysql alias and mysqldump=/Applications/MAMP/Library/bin/mysqldump). MAMP's MySQL version is now accessible from the command line, but I'm still getting the same error when connecting via d2rq. For the moment I'll have to use the native MySQL installation, but perhaps someone can help me get it to work with MAMP some day :) – Tum Oct 11 '13 at 08:58

1 Answers1

0

Generating mapping file and RDF in mysqldb using D2RQ command.

script command syntax:

./generate-mapping -u userName -p Password -o /mapping file save path directory/fileName.ttl mysqldriver/databaseName

example:

./generate-mapping -u root -p root -o /home/bigtapp/Documents/d2rqgenerate_mapping/mapfile.ttl jdbc:mysql://localhost:3306/d2rq

username password: u root -p root -o file save path:/home/tapp/Documents/d2rqgenerate_mapping/mapfile.ttl sql Driver : jdbc:mysql://localhost:3306/d2rq here d2rq :databasename

RDF creation command:

dump-rdf -f RDF/XML -b localhost:3306 -o /home/tapp/Documents/d2rqgenerate_mapping/dumpfile.rdf /home/bigtapp/Documents/d2rqgenerate_mapping/mapfile.ttl
Chetan Ameta
  • 7,696
  • 3
  • 29
  • 44