XSD2DB - lmu-bioinformatics/xmlpipedb GitHub Wiki

About

XSD2DB is a program for converting an XML Schema Definition (XSD) or Document Type Definition (DTD) into a database schema (SQL) file and a set of Hibernate mapping files and Java classes. The output includes a build.xml file, which will run under ANT to build a .jar file for you. Jar file allows you to access your database using [http://www.hibernate.org/ Hibernate].

Features

  • takes XSD or DTD files
  • outputs SQL schema file
  • outputs all Hibernate .java files
  • outputs all Hibernate mapping (.hbm) files
  • outputs customized build.xml to compile all classes and generate a jar file

Requirements

Ant version 1.6.5 or better is required to build a .jar file, but the program will run without this.

Installation

  • clean install -- Simply extract all files into a folder (e.g. xsd2db). ** WARNING: DO NOT use folders with special characters in them, e.g. "!temp" will not work.
  • upgrade -- Delete all previous file / versions, then follow the instructions for a "clean install".

Running xsd2db

Windows

xsd2db [--outputDirectory=dirname] [--bindings=filename] [[-updateXSD] --xsdURL=url] [-help]

Unix/Linux/OSX

./xsd2db [--outputDirectory=dirname] [--bindings=filename] [[-updateXSD] --xsdURL=url] [-help]

Commands

--outputDirectory=dirname
The directory when generating the source code and file; defaults to dg-gen
--bindings=filename
The binding file used when generation the data base source code and files for the time. Defaults to standard binding file supplied by XSD-To-DB
--xsdURL=url
The URL of the XSD to convert. This must be a URL on the web. A file URL will not work.
--dtdSchema
Enables support for DTDs
-updateXSD
Replaces the XSD being used with the new version
--help
Displays the help and exits

Example: KEML on Windows

  • cd into folder where xsd2db is installed
  • type: java -jar xsd2db.jar followed by whatever arguments are needed
  • For example: java -jar xsd2db.jar --outputDirectory=kegg --xsdURL=http://www.genome.jp/kegg/xml/KGML_v0.6.1_.dtd -dtdSchema
  • now you should have directory called kegg
  • cd into that directory
  • type ant
  • load schema.sql into Postgres
⚠️ **GitHub.com Fallback** ⚠️