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.

pages : “4267-4274",<br />

abstract: ”We have cloned the human perforin gene....",<br />

keywd : SET{“Amino Acid Sequence", “Base Sequence", “Exons",<br />

“Genes, Structural"} } ...}<br />

205<br />

where the “. . .” indicates that there are other records in the set that have been omitted.<br />

Translating from ASN.l to this format is straightforward, as it is for a variety of other<br />

data formats. We should remark here that BioKleisli does not represent entire<br />

databases in this format; it is used for data exchange between the query language of a<br />

DBMS or the application programming interface of a data format.<br />

The Collection Programming Language (CPL)<br />

The syntax of CPL used here is similar to that of OQL (2), the ODMG st<strong>and</strong>ard for<br />

object-oriented database languages. Rather than giving the complete syntax, we will<br />

illustrate it through a series of examples. The first example extracts the title <strong>and</strong><br />

authors from a database DB of the type Publication:<br />

sefofrcd{title : p.title, authors : p.authors}<br />

where \p DB<br />

Note the use of “ \p ” to introduce the variable p. The effect of “ \p DB ”isto<br />

bind p to each element of the set DB. The use of explicit variable binding is needed<br />

when queries are used in conjunction with function definition or pattern matching as<br />

in the example below, which is equivalent to the one above. Note that the ellipsis<br />

“. . .” matches any remaining fields in the DB record.<br />

setof rcd{ title : t, authors : a}<br />

where rcd title : \t, authors : \a, ...} DB<br />

Also, the following queries are equivalent:<br />

sefof rcd {title: t, authors; a}<br />

where rcd {title : \ t,<br />

authors : la,<br />

year:\y...}<br />

y= 1988<br />

sefof rcd { title : t, authors : a}<br />

where rcd {title : \ t,<br />

authors : \ a,<br />

year : 1988, ...} DB

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

Saved successfully!

Ooh no, something went wrong!