W3C home > Mailing lists > Public > public-rdf-in-xhtml-tf@w3.org > January 2005

SQL database schemas from XHTML via OWL, using GRDDL

From: Dan Connolly <connolly@w3.org>
Date: Fri, 07 Jan 2005 15:32:50 -0600
To: public-rdf-in-xhtml-tf@w3.org
Message-Id: <1105133570.6000.96.camel@localhost>
A while back I was working on a database application...

"I did the database design GRDDL-style: wrote it in XHTML with Amaya,
converted it to RDF/OWL with XSLT, and converted the OWL to SQL with
some more XSLT."

 -- 25 Aug 2004
  http://www.advogato.org/person/connolly/diary.html?start=12

I didn't publish the sources at the time, but as reason to share
it with somebody just came up, and I figured I might as well
share it via this forum.

Attached find:

bottlesDB.html -- a database schema in an XHTML dialect
grokDBSchema.xsl -- a GRDDL transformation from that dialect to OWL
owl2sql.xsl -- a transformation from that fragment of OWL to SQL
testclinic.html -- some test data following that schema
loadTables.py -- a python program to populate a database from
  the schema and data
Makefile -- rules to put it all together, ala:


connolly@dirk:~/Desktop/owlsql$ make testchiro-db
xsltproc --novalid -o bottlesDB.owl grokDBSchema.xsl bottlesDB.html
xsltproc --novalid -o bottlesDB.sql owl2sql.xsl bottlesDB.owl
python loadTables.py testchiro-db bottlesDB.sql testclinic.html


Then you can interact with the data in normal SQL ways:

connolly@dirk:~/Desktop/owlsql$ sqlite testchiro-db
SQLite version 2.8.15
Enter ".help" for instructions
sqlite> select * from Patients
   ...> ;
10|Walker|Matilda|1965-09-01|mwalker@example.net|816-555-1212|w001
11|Henderson|Frank|1990-03-22|frankh@example.org|913-555-1234|h002
12|Davis|Joan|1972-03-23||913-555-4345|100003
13|Edwards|Kimberly|1978-05-10||913-555-5674|100009
14|Hansen|Lyle|1987-12-12||913-555-4335|100006
15|Johnson|Karen|1945-07-23||913-555-7554|100005
16|Kenner|Louis|1951-06-01||913-555-6584|100007
17|Lee|Stefany|1962-01-07||816-555-6754|100012
18|Little|John|1948-09-14||816-555-2157|100004
19|Meza|Brent|1951-02-15||816-555-6785|100008
101|Nelson|Lisa|1964-10-10||816-555-2457|100010
102|Perkins|Alice|1959-11-01||913-555-7325|100011
103|Smith|Chad|1941-12-07||913-555-7853|100015
104|Smith|Albert|1950-04-10||913-555-3554|100001



-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/
D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E



Received on Friday, 7 January 2005 21:32:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:59 GMT