wiki:DespoinaLog/2010/03/24
  • JENA/D2R sparql :
    • Set paths for jena/arq and add them in path in order to run sparql from command line (JENA)
    • Make d2rq server run :
      • Prequisites :
        • Java 1.4 or newer on the path OK
        • Supported DB (mysql)
        • Download a JDBC driver from your database vendor. Place the driver's JAR file into D2R Server's /lib directory. jdbc:mysql://servername/database for MySQL) from the driver's documentation. Drivers for MySQL and PostgreSQL are already included with D2R Server.
    • Generate a mapping and an RDF file : DONE :
      • $ ./generate-mapping.bat -d com.mysql.jdbc.Driver -u molgenis -p molgenis [jdbc:!mysql://127.0.0.1/molgenis jdbc:mysql://127.0.0.1/molgenis] > molgenis.n3
      • * $ ./dump-rdf.bat -u molgenis -p molgenis -d com.mysql.jdbc.Driver -j jdbc:mysql://127.0.0.1/molgenis > molgenis.rdf
    • Start the server : $ ./d2r-server.bat mapping.n3 OK
      • http://localhost:2020/ (currently not working)
        • fix paths and start server again:
          • export D2R_ROOT="D:/..../d2r/d2r-server-0.7/"
          • export PATH=$PATH:$D2R_ROOT
      • * Potential problem cause : Alter the mapping file (molgenis.n3) in order to include SERVER configuration :

Actions: (project in SVN: http://www.molgenis.org/svn/molgenis_projects/molgenis_rdf_test)

  • copy the d2rq libs into molgenis_distr/WEB-INF/lib ..
    • OK do we have also to include in proporties-> java EE module depenencies?
  • copy line 9-134 from d2r/webapp/WEB-INF/web.xml into molgenis_distr/WebContent/WEB-INF/web.xml -->
    • Ok in \desp\workspace\molgenis_distro\WebContent\WEB-INF\web.xml lines 71 - 196
      • (these are comments right? otherwise have to be removed! <!-- Configuration file for running the server in a servlet container.
        Will be ignored if the server is started from the command line. -->
  • change line 128 that says /index.html to /rdf.html
    • ok line 193 <url-pattern>/rdf.html</url-pattern>
  • copy a mapping file into molgenis_distro/WebContent/WEB-INF/ OK
    • run generate mapping (bat or sh)--> generate mapping for addressbook
    • $ ./generate-mapping.bat -d com.mysql.jdbc.Driver -u molgenis -p molgenis jdbc:!mysql://127.0.0.1/molgenis > molgenis.n3 OK
    • weirdly does not work for addressbook ...
    • We have to alter the mapping file ()..adding in the beginning:
      • @prefix : <#> .
        @prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
        @prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
        
        <> ja:imports d2rq: .
        
        :myModel
          a d2rq:D2RQModel;
          d2rq:mappingFile <mapping-iswc.n3>;
          d2rq:resourceBaseURI <http://localhost:2020/>;
          .
        
      • @prefix d2rq Is this OUR installation of D2RQ?????  ALSO : 
        
      •   d2rq:resourceBaseURI <http://localhost:2020/>; this doesn't work . will this influence the servlet??
        
  • make sure the configFile in web.xml has same name as the file
  • Morris changes @ See commit messages http://www.molgenis.org/svn/molgenis_projects/molgenis_rdf_test); ended up hacking the D2RQ java class that loads the config file.
Last modified 14 years ago Last modified on 2010-10-01T23:19:13+02:00

Attachments (2)

Download all attachments as: .zip