14.06.2013 Views

Databases and Systems

Databases and Systems

Databases and Systems

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

268<br />

The ace data definition language<br />

Data in Acedb are organized in objects <strong>and</strong> objects are grouped in classes. Each<br />

object belongs to a unique class, <strong>and</strong> has a name which is unique in its class. Rather<br />

than having a fixed number of fields determined by their class, objects have a flexible<br />

internal structure, organized hierarchically as a tree. This tree contains basic data<br />

elements, such as numbers, character strings, <strong>and</strong> pointers to other objects, as well as<br />

identifiers called "tags" that give structure <strong>and</strong> meaning to the tree. The database<br />

schema consists of tree specifications, which in Acedb terminology are called class<br />

"models". A formal BNF definition <strong>and</strong> several examples <strong>and</strong> tutorials are available<br />

at [2]. Consider the following simple example:<br />

?Person Paper ?Paper<br />

Address Street Text<br />

City ?City<br />

State ?State<br />

?City State ?State XREF Cities<br />

?State Cities ?City XREF State<br />

This schema defines models for three classes: Person, City <strong>and</strong> State, prefixed by<br />

question marks, <strong>and</strong> six tags: Paper, Address, Street, City, State <strong>and</strong> Cities. Inside<br />

trees, the symbols “?classname” represent pointers to objects in the specified class.<br />

The XREF tells the system to maintain automatically the cross referencing between<br />

State <strong>and</strong> Cities.<br />

Note that in class Person, under the tag Address, we have three tags on equal<br />

footing: Street, City <strong>and</strong> State. This nesting brings several benefits. First, it remains<br />

clear when the model becomes complicated. Second, this construction provides an<br />

automatic clustering of the contents. Any person for whom State is specified<br />

automatically gains a partial Address <strong>and</strong> can be selected <strong>and</strong> retrieved on this<br />

criterion allowing natural queries <strong>and</strong> automatic classification. Finally, this provides<br />

a very simple way, explained below, of de-correlating the methods from the schema.<br />

The tag[2] system<br />

The greatest problem we encountered with the early versions of Acedb was a tight<br />

coupling of the display to the schema, which has come to be known in the Acedb<br />

community, particularly among data curators, as the "magic tag" syndrome. The<br />

meaning is this: features presented in the applications <strong>and</strong> in the graphic interface<br />

were obtained from the database by reference to explicit tags in the class definitions.<br />

Consider a simple example where one wants to write a program for addressing<br />

envelopes. The easy way is to look at the definition of class Person, to retrieve the<br />

Street, City <strong>and</strong> State values <strong>and</strong> print them. But this piece of code turns the tags

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!