1/*
2       LOB'S INTERNAL DATABASE
3*/
4:- dynamic old_assertions/1.
5
6%  ATTRIBUTES
7%  add,aut,bot,cha,dat,edi,edr,eds,fla,flo,how,ins,jou,key,
8%  mee,mon,nte,num,org,pag,pub,sch,ser,tit,typ,vol,yea,
9%  own,loc,llo,kyw,cop,ide
10
11attribute(X) :- all_attributes(List),member(X,List).
12all_attributes([add,aut,bot,cha,dat,edi,edr,eds,fla,flo,how,ins,jou,key,
13                mee,mon,nte,num,org,pag,pub,sch,ser,tit,typ,vol,yea,
14                own,loc,llo,kyw,cop,ide]).
15
16%  DOCUMENT TYPES
17%  art,bok,bol,con,inb,inc,inp,man,mas,mis,phd,pro,tec,unp
18
19doctype(X) :- all_doctypes(List),member(X,List).
20all_doctypes([art,bok,bol,con,inb,inc,inp,man,mas,mis,phd,pro,tec,unp]).
21order_doctypes([tec,bok,art,inp,pro,con,phd,inb,bol,inc,man,mas,mis,unp]).
22
23%  -----------------------------------------------------------
24%  translation of abbreviations into extensions, strings, etc.
25%  (used by UPDATE, SEARCH)
26%  -----------------------------------------------------------
27
28%  internal abbreviations of the document types
29
30type_abbr(article,art).
31type_abbr(book,bok).
32type_abbr(booklet,bol).
33type_abbr(conference,con).
34type_abbr(inbook,inb).
35type_abbr(incollection,inc).
36type_abbr(inproceedings,inp).
37type_abbr(manual,man).
38type_abbr(masterthesis,mas).
39type_abbr(misc,mis).
40type_abbr(phdthesis,phd).
41type_abbr(proceeding,pro).
42type_abbr(techreport,tec).
43type_abbr(unpublished,unp).
44
45%  internal abbreviations of Scribe attributes
46
47cap_attr_abbr('Address',add).
48cap_attr_abbr('Author',aut).
49cap_attr_abbr('Booktitle',bot).
50cap_attr_abbr('Chapter',cha).
51cap_attr_abbr('Date',dat).
52cap_attr_abbr('Edition',edi).
53cap_attr_abbr('Editor',edr).
54cap_attr_abbr('Editors',eds).
55cap_attr_abbr('Fullauthor',fla).
56cap_attr_abbr('Fullorganization',flo).
57cap_attr_abbr('Howpublished',how).
58cap_attr_abbr('Institution',ins).
59cap_attr_abbr('Journal',jou).
60cap_attr_abbr('Key',key).
61cap_attr_abbr('Meeting',mee).
62cap_attr_abbr('Month',mon).
63cap_attr_abbr('Note',nte).
64cap_attr_abbr('Number',num).
65cap_attr_abbr('Organization',org).
66cap_attr_abbr('Pages',pag).
67cap_attr_abbr('Publisher',pub).
68cap_attr_abbr('School',sch).
69cap_attr_abbr('Series',ser).
70cap_attr_abbr('Title',tit).
71cap_attr_abbr('Type',typ).
72cap_attr_abbr('Volume',vol).
73cap_attr_abbr('Year',yea).
74
75%  internal abbreviations of LOB specific attributes
76
77cap_attr_abbr('Copy',cop).
78cap_attr_abbr('Owner',own).
79cap_attr_abbr('Location',loc).
80cap_attr_abbr('Lastlocation',llo).
81cap_attr_abbr('Keyword',kyw).
82cap_attr_abbr('Document-Id',ide).
83
84%  translation of attributes to variable names
85
86att_to_var(add,"Add").
87att_to_var(aut,"Aut").
88att_to_var(bot,"Bot").
89att_to_var(cha,"Cha").
90att_to_var(dat,"Dat").
91att_to_var(edi,"Edi").
92att_to_var(edr,"Edr").
93att_to_var(eds,"Eds").
94att_to_var(fla,"Fla").
95att_to_var(flo,"Flo").
96att_to_var(how,"How").
97att_to_var(ins,"Ins").
98att_to_var(jou,"Jou").
99att_to_var(key,"Key").
100att_to_var(mee,"Mee").
101att_to_var(mon,"Mon").
102att_to_var(nte,"Nte").
103att_to_var(num,"Num").
104att_to_var(org,"Org").
105att_to_var(pag,"Pag").
106att_to_var(pub,"Pub").
107att_to_var(sch,"Sch").
108att_to_var(ser,"Ser").
109att_to_var(tit,"Tit").
110att_to_var(typ,"Typ").
111att_to_var(vol,"Vol").
112att_to_var(yea,"Yea").
113
114att_to_var(cop,"Cop").
115att_to_var(kyw,"Kyw").
116att_to_var(ide,"Ide").
117att_to_var(doc,"Doc").
118
119
120%  translation of attributes into strings
121
122att_to_string(add,"add").
123att_to_string(aut,"aut").
124att_to_string(bot,"bot").
125att_to_string(cha,"cha").
126att_to_string(dat,"dat").
127att_to_string(edi,"edi").
128att_to_string(edr,"edr").
129att_to_string(eds,"eds").
130att_to_string(fla,"fla").
131att_to_string(flo,"flo").
132att_to_string(how,"how").
133att_to_string(ins,"ins").
134att_to_string(jou,"jou").
135att_to_string(key,"key").
136att_to_string(mee,"mee").
137att_to_string(mon,"mon").
138att_to_string(nte,"nte").
139att_to_string(num,"num").
140att_to_string(org,"org").
141att_to_string(pag,"pag").
142att_to_string(pub,"pub").
143att_to_string(sch,"sch").
144att_to_string(ser,"ser").
145att_to_string(tit,"tit").
146att_to_string(typ,"typ").
147att_to_string(vol,"vol").
148att_to_string(yea,"yea").
149
150att_to_string(cop,"cop").
151att_to_string(kyw,"kyw").
152att_to_string(ide,"ide").
153att_to_string(doc,"doc").
154
155%  translation of type abbreviations into capitalized atoms
156
157cap_type_abbr('Article',art).
158cap_type_abbr('Book',bok).
159cap_type_abbr('Booklet',bol).
160cap_type_abbr('Conference',con).
161cap_type_abbr('Inbook',inb).
162cap_type_abbr('Incollection',inc).
163cap_type_abbr('Inproceedings',inp).
164cap_type_abbr('Manual',man).
165cap_type_abbr('Masterthesis',mas).
166cap_type_abbr('Misc',mis).
167cap_type_abbr('Phdthesis',phd).
168cap_type_abbr('Proceeding',pro).
169cap_type_abbr('Techreport',tec).
170cap_type_abbr('Unpublished',unp).
171
172
173
174%  ------------------------------------------------------------------------
175%  relations between attributes and document types (used by UPDATE, SEARCH)
176%  ------------------------------------------------------------------------
177
178%  lists of attributes the interactive input will prompt
179
180prompted_atts(art,[[aut,m],[key,m],[tit,m],[jou,m],[vol,m],[num,o],
181                   [pag,m],[yea,m],[mon,o],
182                   [nte,o],[kyw,o],[cop,o]]).
183prompted_atts(bok,[[aut,m],[key,m],[tit,m],[edr,o],[pub,m],[add,o],
184                   [edi,o],[ser,o],[vol,o],[num,o],[how,o],[yea,m],
185                   [nte,o],[kyw,o],[cop,o]]).
186prompted_atts(bol,[[aut,m],[key,m],[tit,m],[pub,m],[add,o],[how,o],[yea,m],
187                   [mon,o],[nte,o],[kyw,o],[cop,o]]).
188prompted_atts(con,[[aut,m],[key,m],[tit,m],[org,m],[mee,o],[yea,m],[mon,o],
189                   [nte,o],[kyw,o],[cop,o]]).
190prompted_atts(inb,[[aut,m],[key,m],[tit,m],[bot,m],[cha,o],[pag,m],[edr,o],
191                   [pub,m],[add,o],[edi,o],[ser,o],[vol,o],[num,o],[how,o],
192                   [yea,m],[nte,o],[kyw,o],[cop,o]]).
193prompted_atts(inc,[[aut,m],[key,m],[tit,m],[bot,m],[cha,o],[pag,m],[edr,o],
194                   [pub,m],[add,o],[ser,o],[vol,o],[num,o],[yea,m],
195                   [nte,o],[kyw,o],[cop,o]]).
196prompted_atts(inp,[[aut,m],[key,m],[tit,m],[bot,m],[org,m],[pag,m],[edr,o],
197                   [pub,o],[add,o],[yea,m],[mon,o],
198                   [nte,o],[kyw,o],[cop,o]]).
199prompted_atts(man,[[aut,o],[key,m],[tit,m],[org,o],[add,o],[edi,o],
200                   [yea,m],[mon,o],[nte,o],[kyw,o],[cop,o]]).
201prompted_atts(mas,[[aut,m],[key,m],[tit,m],[sch,m],[add,o],[yea,m],[mon,o],
202                   [nte,o],[kyw,o],[cop,o]]).
203prompted_atts(mis,[[aut,m],[key,m],[tit,m],[how,m],[yea,o],[mon,o],
204                   [nte,o],[kyw,o],[cop,o]]).
205prompted_atts(phd,[[aut,m],[key,m],[tit,m],[sch,m],[add,o],[yea,m],[mon,o],
206                   [nte,o],[kyw,o],[cop,o]]).
207prompted_atts(pro,[[org,m],[key,m],[tit,m],[bot,o],[edr,o],[pub,m],[add,o],
208                   [yea,m],[mon,o],[nte,o],[kyw,o],[cop,o]]).
209prompted_atts(tec,[[aut,m],[key,m],[tit,m],[ins,m],[org,o],[add,o],
210                   [typ,o],[num,o],[yea,m],[mon,o],
211                   [nte,o],[kyw,o],[cop,o]]).
212prompted_atts(unp,[[aut,m],[key,m],[tit,m],[yea,o],[mon,o],
213                   [nte,o],[kyw,o],[cop,o]]).
214
215
216%  attributes of educe relations
217
218rel_has_atts(art,[ide,aut,key,tit,jou,vol,num,pag,yea,mon,nte,dat]).
219rel_has_atts(bok,[ide,aut,key,tit,edr,pub,add,edi,ser,vol,num,how,yea,nte,
220                  dat]).
221rel_has_atts(bol,[ide,aut,key,tit,pub,add,how,yea,mon,nte,dat]).
222rel_has_atts(con,[ide,aut,key,tit,org,mee,yea,mon,nte,dat]).
223rel_has_atts(inb,[ide,aut,key,tit,bot,cha,pag,edr,pub,add,edi,ser,vol,num,how,
224                  yea,nte,dat]).
225rel_has_atts(inc,[ide,aut,key,tit,bot,cha,pag,edr,pub,add,ser,vol,num,yea,nte,
226                  dat]).
227rel_has_atts(inp,[ide,aut,key,tit,bot,org,pag,edr,pub,add,yea,mon,nte,
228                  dat]).
229rel_has_atts(man,[ide,aut,key,tit,org,add,edi,yea,mon,nte,dat]).
230rel_has_atts(mas,[ide,aut,key,tit,sch,add,yea,mon,nte,dat]).
231rel_has_atts(mis,[ide,aut,key,tit,how,yea,mon,nte,dat]).
232rel_has_atts(phd,[ide,aut,key,tit,sch,add,yea,mon,nte,dat]).
233rel_has_atts(pro,[ide,org,key,tit,bot,edr,pub,add,yea,mon,nte,dat]).
234rel_has_atts(tec,[ide,aut,key,tit,ins,org,add,typ,num,yea,mon,nte,dat]).
235rel_has_atts(unp,[ide,aut,key,tit,yea,mon,nte,dat]).
236
237rel_has_atts(cop,[ide,doc,own,loc,llo,dat]).
238rel_has_atts(kyw,[ide,doc,kyw]).
239
240% attributes of document types
241
242doc_has_atts(DocType,AttList) :-
243    rel_has_atts(DocType,AList),
244    conc(AList,[kyw,own,loc,llo,cop],AttList).
245
246% mandatory attributes
247
248mandatory_atts(art,[aut,key,tit,jou,pag,yea]).
249mandatory_atts(bok,[aut,key,tit,pub,yea]).
250mandatory_atts(bol,[aut,key,tit,pub,yea]).
251mandatory_atts(con,[aut,key,tit,org,yea]).
252mandatory_atts(inb,[aut,key,tit,bot,pag,pub,yea]).
253mandatory_atts(inc,[aut,key,tit,bot,pag,pub,yea]).
254mandatory_atts(inp,[aut,key,tit,bot,org,pag,yea]).
255mandatory_atts(man,[key,tit,yea]).
256mandatory_atts(mas,[aut,key,tit,sch,yea]).
257mandatory_atts(mis,[aut,key,tit,how]).
258mandatory_atts(phd,[aut,key,tit,sch,yea]).
259mandatory_atts(pro,[org,key,tit,pub,yea]).
260mandatory_atts(tec,[aut,key,tit,ins,yea]).
261mandatory_atts(unp,[aut,key,tit]).
262
263
264% lists of document types related to an attribute
265
266att_of_types(add,[bok,bol,inb,inc,inp,man,mas,phd,pro,tec]).
267att_of_types(aut,[art,bok,bol,con,inb,inc,inp,man,mas,mis,phd,tec,unp]).
268att_of_types(bot,[inb,inc,inp,pro]).
269att_of_types(cha,[inb,inc]).
270att_of_types(dat,[art,bok,bol,con,inb,inc,inp,man,mas,mis,phd,pro,tec,unp]).
271att_of_types(edi,[bok,inb,man]).
272att_of_types(edr,[art,bok,inb,inc,inp,pro]).
273att_of_types(eds,[]).
274att_of_types(fla,[]).
275att_of_types(flo,[]).
276att_of_types(how,[bok,bol,inb,mis]).
277att_of_types(ins,[tec]).
278att_of_types(jou,[art]).
279att_of_types(key,[art,bok,bol,con,inb,inc,inp,man,mas,mis,phd,pro,tec,unp]).
280att_of_types(mee,[con]).
281att_of_types(mon,[art,bol,con,inp,man,mas,mis,phd,pro,tec,unp]).
282att_of_types(nte,[art,bok,bol,con,inb,inc,inp,man,mas,mis,phd,pro,tec,unp]).
283att_of_types(num,[art,bok,inb,inc,tec]).
284att_of_types(org,[inp,man,pro,tec]).
285att_of_types(pag,[art,inb,inc,inp]).
286att_of_types(pub,[bok,bol,inb,inc,inp,pro]).
287att_of_types(sch,[mas,phd]).
288att_of_types(ser,[bok,inb,inc]).
289att_of_types(tit,[art,bok,bol,con,inb,inc,inp,man,mas,mis,phd,pro,tec,unp]).
290att_of_types(typ,[tec]).
291att_of_types(vol,[art,bok,inb,inc]).
292att_of_types(yea,[art,bok,bol,con,inb,inc,inp,man,mas,mis,phd,pro,tec,unp]).
293
294att_of_types(cop,[art,bok,bol,con,inb,inc,inp,man,mas,mis,phd,pro,tec,unp]).
295att_of_types(kyw,[art,bok,bol,con,inb,inc,inp,man,mas,mis,phd,pro,tec,unp]).
296att_of_types(ide,[art,bok,bol,con,inb,inc,inp,man,mas,mis,phd,pro,tec,unp]).
297att_of_types(doc,[art,bok,bol,con,inb,inc,inp,man,mas,mis,phd,pro,tec,unp]).
298
299
300%  attributes for the standard retrieval of a document type
301
302stand_docattrs(art,[ide,aut,tit,jou,vol,num,pag,yea,mon,nte]).
303stand_docattrs(bok,[ide,aut,tit,pub,yea,nte]).
304stand_docattrs(bol,[ide,aut,tit,pub,yea,nte]).
305stand_docattrs(con,[ide,aut,tit,org,mee,yea,mon,nte]).
306stand_docattrs(inb,[ide,aut,tit,bot,cha,pag,pub,yea,nte]).
307stand_docattrs(inc,[ide,aut,tit,bot,cha,pag,yea,nte]).
308stand_docattrs(inp,[ide,aut,tit,bot,org,pag,yea,nte]).
309stand_docattrs(man,[ide,aut,tit,org,yea,mon,nte]).
310stand_docattrs(mas,[ide,aut,tit,sch,add,yea,nte]).
311stand_docattrs(mis,[ide,aut,tit,how,yea,mon,nte]).
312stand_docattrs(phd,[ide,aut,tit,sch,add,yea,nte]).
313stand_docattrs(pro,[ide,org,tit,bot,edr,yea,nte]).
314stand_docattrs(tec,[ide,aut,tit,ins,org,add,typ,num,yea,nte]).
315stand_docattrs(unp,[ide,aut,tit,yea,mon,nte]).
316
317
318%  ------------------------------------
319%  length of attributes in the database
320%  ------------------------------------
321
322attr_len(add,40).
323attr_len(aut,70).
324attr_len(bot,80).
325attr_len(cha,6).
326attr_len(dat,10).
327attr_len(edi,40).
328attr_len(edr,40).
329attr_len(eds,0).
330attr_len(fla,0).
331attr_len(flo,0).
332attr_len(how,40).
333attr_len(ins,80).
334attr_len(jou,80).
335attr_len(key,25).
336attr_len(mee,80).
337attr_len(mon,9).
338attr_len(nte,57).
339attr_len(num,20).
340attr_len(org,80).
341attr_len(pag,12).
342attr_len(pub,40).
343attr_len(sch,30).
344attr_len(ser,40).
345attr_len(tit,90).
346attr_len(typ,30).
347attr_len(vol,10).
348attr_len(yea,4).
349
350attr_len(ide,28).
351attr_len(kyw,40).
352attr_len(own,10).
353attr_len(loc,10).
354attr_len(llo,10).
355
356
357% initialisation of old_assertions and already_seen.
358
359old_assertions([]).
360
361already_seen([]).
362
363% ---- used by old versions only
364
365% b_call
366
367b_call(add,"add(Add)").
368b_call(aut,"aut(Aut)").
369b_call(bot,"bot(Bot)").
370b_call(cha,"cha(Cha)").
371b_call(dat,"dat(Dat)").
372b_call(edi,"edi(Edi)").
373b_call(edr,"edr(Edr)").
374b_call(eds,"eds(Eds)").
375b_call(fla,"fla(Fla)").
376b_call(flo,"flo(Flo)").
377b_call(how,"how(How)").
378b_call(ins,"ins(Ins)").
379b_call(jou,"jou(Jou)").
380b_call(key,"key(Key)").
381b_call(mee,"mee(Mee)").
382b_call(mon,"mon(Mon)").
383b_call(nte,"nte(Nte)").
384b_call(num,"num(Num)").
385b_call(org,"org(Org)").
386b_call(pag,"pag(Pag)").
387b_call(pub,"pub(Pub)").
388b_call(sch,"sch(Sch)").
389b_call(ser,"ser(Ser)").
390b_call(tit,"tit(Tit)").
391b_call(typ,"typ(Typ)").
392b_call(vol,"vol(Vol)").
393b_call(yea,"yea(Yea)").
394
395b_call(cop,"cop(Cop)").
396b_call(kyw,"kyw(Kyw)").
397b_call(ide,"ide(Ide)").
398b_call(doc,"doc(Doc)").
399
400
401
402
403
404
405