474. Application ExampleThis section provides a simple example of the use of Cypress. Section 4.1 introduces the example, adatabase of documents. Section 4.2 is a discussion of database design: the process of representingabstractions of real-world information structures in a database, somewhat specialized to the datastructures available in Cypress. In Section 4.3, a working program is illustrated.Our example is necessarily short; don't expect any startling revelations on these pages. We will tryto consider some of the most common cases, however.4.1 A database applicationWhat are the properties of a well-designed database? To a large extent these properties follow fromthe general properties of databases. For instance, we would like our databases to extend gracefullyas new types of information are added, since the existing data and programs are likely to be quitevaluable.It may be useful to consider the following point. The distinguishing aspect of information stored ina database system is that at least some of it is stored in a form that can be interpreted by the systemitself, rather than only by some application-specific program. Hence, one important dimension ofvariation among different database designs is in the amount of the database that is system-interpretable, i.e. the kinds of queries that can be answered by the system.As an example of variation in this dimension, consider the problem of designing a database fororganizing a collection of Mesa modules. In the present Mesa environment, this database wouldneed to include at least the names of all the definitions modules, program modules, configurationdescriptions, and current .Bcd files. A database containing only this information is little more than afile directory, and therefore the system's power to answer queries about information in this databaseis very limited. A somewhat richer database might represent the DIRECTORY and IMPORTS sectionsof each module as relationships, so that queries such as "which modules import interface Y?" can beanswered by the system. This might be elaborated further to deal with the use of individual typesand procedures from a definitions module, and so on. There may be a limit beyond which it isuseless to represent smaller objects in the database; if we aren't interested in answering queries like"what procedures in this module contain IF statements?", it may be attractive to represent the bodyof a procedure (or some smaller naming scope) as a text string that is not interpretable by thedatabase system, even though it is stored in a database. We shall illustrate design ideas with a database of information about documents. Our currentfacilities, which again are simply file directories, leave much to be desired. The title of a document;[{pSYqO}pbMIMKGHSDpeBC3;r8p\5 Y3 V1s-pb+c#sp2 ).a&"9$L p6(G-4L\ 322tptp8!tpzJF5(  ] (tp9Xt8)Tp=d"E v>Q\DESIGN AND IMPLEMENTATION OF A RELATIONSHIP-ENTITY-DATUM DATA MODEL48on the printed page does not tell the reader where the document is stored or how to print a copy.Relationships between different versions of the same basic document are not explicit. Retrievals bycontent are impossible. Our goal here is not to solve all of these problems, but to start a design thathas the potential of dealing with some of them.4.2 Schema designEach document in our example database has a title and a set of authors. Hence we might representa collection of documents with a domain of entities whose name is the title of the document, and anauthor property specifying the authors:Document: Domain = DeclareDomain["Domain"];dAuthors: Property = DeclareProperty["author", Document, StringType];Here the authors' names are concatenated into a single string, using some punctuation scheme toallow the string to be decoded into the list of authors. This is a very poor database design because itdoes not allow the system to respond easily to queries involving authors; the system cannot parse theencoded author list.Note that in the above definition authors are strings, so anything is acceptable as an author. Thisweak typing has some flexibility: the database will never complain that it doesn't know the authoryou just attached to a certain document. However, the system is not helpful in catching errors whena new document is added to the database. If "Mark R. Brown" is mistakenly spelled "Mark R.Browne", then one of Mark's papers will not be properly retrieved by a later search. A step in thedirection of stronger type checking is to provide a separate domain for authors.To represent authors as entities, and to allow a variable number number of authors for a document,a better design would be:Document: Domain = DeclareDomain["Domain"];Person: Domain = DeclareDomain["Person"];author: Property = DeclareProperty["author", Document, Person];Incidentally, in the last line above we define a property rather than relation for brevity. Instead ofthe author property declaration we could have written:author: Relation = DeclareRelation["author"]; authorOf: Attribute = DeclareAttribute[author, "of", Document]; authorIs: Attribute = DeclareAttribute[author, "is", Person];)YptF ptpt ptptpXtFptpjQLjO}KjMI\ jK/jDrj@p;&j>\jQ\O&DESIGN AND IMPLEMENTATION OF A RELATIONSHIP-ENTITY-DATUM DATA MODEL50where a large number of relationships are expected to refer to the same entity, it is also more spaceefficient in our implementation.If an authorOrder attribute is defined, the client may wish to redefine the authorOf attribute sothat links (pointers) are not maintained between the Document entities and author relationships,instead defining a more space-efficient B-tree index on the [authorOf, authorOrder] pair:authorOf: Attribute = DeclareAttribute[ relation: author, name: "of", type: Document, link: FALSE];authorIndex: Index = DeclareIndex[author, LIST[[authorOf, authorOrder]]];The Cypress implementation will use this index to process any call of the formRelationSubset[author, LIST[[authorOf, x]]This call to RelationSubset will therefore enumerate authors of document x sorted by authorOrder.Cypress will also use the index in processing for GetPList[..., authorOf] as GetPList usesRelationSubset.This solution is also somewhat less than perfect, as it depends upon the fact that the Cypressimplementation orders relationships when an index exist; but indices are not intended to change thesemantics of the operations, only to improve performance. Probably the best solution, if theordering is important to the semantics of a database application, is to represent a list by a binary"next" relation connecting the entities in an ordering.Documents have other interesting properties. Some of these, for example the date on which thedocument was produced, are in one-to-one correspondence with documents. Such properties can bedefined by specifying a relation or property as being keyed on the document:publDate: Property = DeclareProperty["publDate", Document, StringType, Key];We are using the convention that domain names are capitalized and relation, attribute, and propertynames are not capitalized, both for the Cedar Mesa variable names and in the names used in thedatabase system itself. If and when the database system is better integrated with Cedar Mesa, the Cedar anddatabase names will be one and the same.We might wish to include additional information for particular kinds of documents, for exampleconference papers. Conference papers may participate in the same relations as other documents.For example, they have authors. In addition, we may want to define relations in which onlyconference papers may participate, for example a presentation relation which defines who presentedthe paper, and where. We can define a conference paper to be a sub-domain of documents, and)]"ptF ptpt ptptpXtFptpjUG_jSjO6pu p- up jMup upjJY{FuX'{D@{@TIjd #>QDTDESIGN AND IMPLEMENTATION OF A RELATIONSHIP-ENTITY-DATUM DATA MODEL52<==2UD`D`@@D`@CCCD`C@>UC`BCQ4Cl@CCg ClG,BCK4/D@D@> UBCZBpB 3@CڃCڂCZ݀%~CڂBpB ;@ "DbC>CVCHCHCBBh3>CClDhC,B$BP;>%}%~Dq"Cڂ%}>uV)CZBCW2D@D@CQ2@/ CEDrClC >V7C`CQ2+ACh"ClCCBCK27AD@D`>V)CZ,B$3>BmCڂ%}݀CڂCځCHB$;>B] Cl@DbC ?!VCHBhpBClD CECClG,CZBPB%~CڃDq"CZ%~%~?DUBBDD@D@C`@/BCCDrl ?RU+ABD "DbCBCZ7ABDD@D`?DUZ,BmB%}%~Dq"Cڂ%}CHCH*B]BCl@CCg ClG?!U(n BBm CEDrClC CZB BB]CڃCڂCZ݀%~Cڂ>U,BBAD@D`C`A_BBACClDhC>TBBB Cl@DbC CZ,BBB/D@D@>uUBBpB%~CڃDq"CZ%~%~CH*BpBCh"ClCC>CU(CH CBBm3?CDrl B BB];@Cڂ%}݀CڂCځ> UZ,CZ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D`6)W6,D@D`6)WD@D@6+.+D@D`6,7D@D@2+2)WD@D@2r+D@D`ofofisis5*E(A B4@"@3;C'$O@BC8QDeڼ)s9BܩC ZC9D`B@B`:*EI|Wƌ(@@~CPCcC@Doa8:A@BDODSo''@<)D?K,@Q A~xCr<!SC@Cr6D[@[;`~A CcD`UCO >)RD[oӽB@B@C1A{7bCο@C)D[B@ %@CDi8Cެ</0?\B??&耽tCDlÀBEoDBALo@C9B|2fC8+/746ZW ཆCZ)E8(CDhBDE̒DVө6PC B]PCB2<sC&v.p;,D{C~'AQ@DAD^FAِCECB88#C.*WpdDCAAo1DƀBpDJ(DXcEpc h*AD€A @C䀽<@9B(C**DW0HCspC|B DU5@DMʀEmT#jC@D{n n8C9@BpC:$+DpCD˽. CoDc@C @Es뾶CP LCfCC>5@B C> -q*CĪ@h., CpDc@C L Ddc5V?I^?Ϋ?CCx@ JCoC@ConferencePapersub-domain of Documentwhich can participate in a "presentation" relation.AuthorrelationPresentationrelation8REpXN CbCB03@C h뻣PD]C`AD@D_@;D{u:C~rBbsLBg,pBAC:C{0l C: Ub[NBb BqAqHCKDl@B0~<sBR Bo--DrC=VDIWDivBRPBMcBN+C]CDAG@C]T6>F HA(B6$,"Dk}Cڀ6`=DsBEIVмCҶC@dJB4CDRTB3꺬 8Cf 6D^C6>s!]DϢEB{xCQ7pBCDSB B; {G?(8gTDQC̀.`Do*rn@\@X )C@$CπCC@$& E޼֘B\BG?CDn:i Q(Dκ;TA CݺCCCu"/ZBCCu!EzDuDJd,_4CDl40 $Ce^ABπAc`CȽCR@CȾ2DihfBNpBxAe @I`CЀDr&.`!,$ D«wCRCW@5C(CC'XDӲB:CKB`b7BCRDs\AyP7B"b"EI@CC-TCm7j@*qCȖCma/D%% CWPCSAf$# CDpy@Cf(#$ EZiA`RAs)"!@Dp(C@)!CuC~pAcPApCϺC#Cz"CϺ1J?AٳBYBB5DsSC&DjDǨQABEBI-XCCClL@!C03ѻ B}hBjA٘ CMDqCg @D8DB伸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Q\ODESIGN AND IMPLEMENTATION OF A RELATIONSHIP-ENTITY-DATUM DATA MODEL54InsertData: PROC = BEGIN t: Relship; tty.PutF["Inserting data...\n"]; cedarPaper_ DeclareEntity[ConferencePaper, "The Cedar DBMS"]; cypressDoc_ DeclareEntity[Document, "Cypress DB Concepts & Facilities"]; thesis_ DeclareEntity[Thesis, "An Analysis of Priority Queues"]; sigmod_ DeclareEntity[Conference, "SIGMOD 81"]; rick_ DeclareEntity[Person, "Rick Cattell"]; mark_ DeclareEntity[Person, "Mark Brown"]; -- Note we can create entity and then set name... nori_ DeclareEntity[Person]; ChangeName[nori, "Nori Suzuki"]; -- Data can be assigned with SetP, SetF, or DeclareRelship's initialization list: t_ DeclareRelship[presentation,, NewOnly]; SetF[t, presentationtOf, cedarPaper]; SetF[t, presentationBy, mark]; SetF[t, presentationAt, sigmod]; []_ SetPList[cypressDoc, authorIs, LIST[rick, mark]]; -- the Cedar notation LIST[ ... ] defines a list []_ SetPList[cedarPaper, authorIs, LIST[rick, mark, nori]]; []_ DeclareRelship[author, LIST[[authorOf, thesis], [authorIs, mark]]]; []_ SetP[cypressDoc, publDate, I2V[1982]]; []_ SetP[thesis, publDate, I2V[1977]]; -- the I2V[...] calls needed because Cedar Mesa does not yet coerce INT to REF ANY -- Check that thesis can't be presented at conference: ok_ FALSE; t_ DeclareRelship[presentation]; SetF[t, presentationOf, thesis ! MismatchedAttributeValueType => {ok _ TRUE; CONTINUE}]; IF NOT ok THEN ERROR; END;DestroySomeData: PROCEDURE = -- Destroy one person entity and all frog entities BEGIN flag: BOOL_ FALSE; tty.Put[char[CR], rope["Deleting Rick from database..."], char[CR]]; DestroyEntity[DeclareEntity[Person, "Frank Baz", OldOnly]]; DestroyDomain[Frog]; END;PrintDocuments: PROC = -- Use DomainSubset with no constraints to enumerate all Documents BEGIN doc: -- Document -- Entity; authors: LIST OF Value; es: EntitySet; tty.PutF["Documents:\n\n"]; tty.PutF["Titleauthors\n"];)\rptF ptpt ptptpXtFptp{TuX{R{Q"{O7?{MlJ{KB{I1{H .{FB,{Dw3{B{@"{?S{=M,{;){9"{7${6"7{4X4{2={0I{.,{--({+cV{)8{' {&"{$8{"n={ {{C{y4{{F{={N{{ { $D{ Y{{{{/{d6  M 6]APPLICATION EXAMPLE55 es_ DomainSubset[Document]; WHILE (doc_ NextEntity[es])#NIL DO tty.PutF["%g", rope[GetName[doc]]]; authors_ GetPList[doc, authorIs]; FOR al: LIST OF Entity_ NARROW[authors], al.rest UNTIL al=NIL DO tty.PutF["%g ", rope[GetName[al.first]]]] ENDLOOP; ENDLOOP; ReleaseEntitySet[es]; END;PrintPersonsPublications: PROC [pName: ROPE] = -- Use RelationSubset to enumerate publications written by person BEGIN p: Person_ DeclareEntity[Person, pName, OldOnly]; authorT: --author-- Relship; rs: RelshipSet; first: BOOL_ TRUE; IF p=NIL THEN {tty.PutF["%g is not a person!", rope[pName]]; RETURN}; tty.PutF["Papers written by %g are:\n", rope[pName]]; rs_ RelationSubset[author, LIST[[authorIs, p]]]; WHILE (authorT_ NextRelship[rs])#NIL DO IF first THEN first_ FALSE ELSE tty.Put[rope[", "]]; tty.Put[rope[GetFS[authorRS, authorOf]]]; ENDLOOP; tty.PutF["\n"]; ReleaseRelshipSet[rs]; END;tty.Put[rope["Creating database..."], char[CR]];Initialize[];DeclareSegment["[Local]Test", $Test, 1,, NewOnly];OpenTransaction[$Test];Initialize[];InsertData[];PrintDocuments[];PrintPersonsPublications["Mark Brown"];DestroySomeData[];PrintDocuments[];CloseTransaction[TransactionOf[$Test]];tty.Close[];END.gWptF pt9pO7uXMl$KwI%H DFB8Dw B@=M.;C9736"4X20.;--7+b2))'8&-$8 "m x0 2N   ' # Y' d +oX, TIMESROMAN  TIMESROMAN  TIMESROMAN  TIMESROMAN  TIMESROMAN HELVETICA  HELVETICA  HELVETICA  P";N]Ib(gPkm e ; .=5;]X%39W-3M1 =)]K=(Z$"9 :  %A9a9`E<"$bX9ZbX~bbd3b%S9Pbdbobd~bbd?bpbbb{~babbbbbbi~dCd>z􌻊bbb~bºazN~d>bbj/n lModelLevelDesign4.pressCattell17-May-83 17:34:11 PDT: