Content-type: text/html; charset=UTF-8
qprschema RelationDirectory
Use Cached Hashing HashSize = 1000 Authors verbosename "Book Author" * Title verbosename "The Title" ISBN verbosename "ISBN Number" Description verbosename "Abstract or Review"
qprschema prints the schema in the following form:
{ Authors { "Book Author" yes } {} } { Title { "The Title" no } {} } { ISBN { "ISBN Number" no } {} } { Description { "Abstract or Review" no } {} }
The output is a set of TCL lists, each containing three elements: (1) the attribute name, (2) verbosename and expandable (yes if expandable, no otherwise), and (3) any subattributes. Subattributes may be nested. In our example above, there are no subattributes since the Schema is flat. In this case, the subattribute lists are empty.
A more complex example of a Schema might be:
Use Cached Hashing HashSize = 1000 Family verbosename "Family Members" ( Name (Title First Middle Last) * Occupation * ) * Address ( Street * City State Zip verbosename "Zip Code" ) * Phone ( Area verbosename "Area Code" Number verbosename "" ) * Comments
For this more complex example, qprschema prints the following TCL list:
{ Family { "Family Members" yes } { { Name { "" yes } { { Title { "" no } {} } { First { "" no } {} } { Middle { "" no } {} } { Last { "" no } {} } }} { Occupation { "" yes } {} } }} { Address { "" yes } { { Street { "" yes } {} } { City { "" no } {} } { State { "" no } {} } { Zip { "Zip Code" no } {} } }} { Phone { "" yes } { { Area { "Area Code" no } {} } { Number { "" no } {} } }} { Comments { "" no } {} }
Each TCL list can be traversed recursively to build a standard interface and/or provide options for any particular attribute (expandable (*) and verbosename). The TCL script nxqddb(1) is a good example of a generic interface that uses qprschema to determine the structure of the data and options for each attribute.
A Guide to QDDB Eric H. Herrin II and Raphael A. Finkel Qddb User's Guide An ASCII Database for Fast Queries of Relatively Stable Data Eric H. Herrin II and Raphael A. Finkel Computing Systems, Volume 4 Number 2 University of California Press, Berkeley CA Schema and Tuple Trees: An Intuitive Structure for Representing Relational Data Eric H. Herrin, II and Raphael A. Finkel Computing Systems, Volume 9, Number 2 MIT Press, Cambridge MA