How to import a valid data set into MySQL
Posted by jamie on 04 Mar 2011 in Notes
I've now got two datasets in the MySQL database, 1790-1799 and 1800-1809. Here's the relatively simple procedure for importing an XML dataset into the MySQL database:
- Ensure that your XML file validates against bailey_trialfile_proofing.rng
- Transform the XML file with Bailey_text_to_fk.xsl - this generates a new XML file with text replaced by foreign key values
- Transform the result of the previous step with Bailey_add_id.xsl - this generates a file with a bunch of SQL INSERT statement
- Import the SQL file into the database
- Run fix_ranks.php on the web server to adjust the rank values for respites, outcomes, and trials
#1 is the most important step: if the file validates, then all of the other pieces will fall into place.