=Paper= {{Paper |id=Vol-1/paper-5 |storemode=property |title=Using natural language for database design |pdfUrl=https://ceur-ws.org/Vol-1/buchholz-et-al-long.pdf |volume=Vol-1 |authors=E. Buchholz,A. Düsterhöft }} ==Using natural language for database design== https://ceur-ws.org/Vol-1/buchholz-et-al-long.pdf
                          Using Natural Language for Database Design
                                    Edith Buchholz * and Antje Düsterhöft

                                      Department of Computer Science
                                 University of Rostock, A.-Einstein-Str.21
                                         18059 Rostock, Germany
                               Email: {buch,duest}@informatik.uni-rostock.de


Abstract.
This paper deals with a natural language dialogue tool          In the database design project RAD ([ThaA94]) we have
for supporting the database design process. We want to          implemented a rule-based dialogue design tool for getting
illustrate how natural language (German) can be used            a skeleton design on the basis of the extended entity-
for obtaining a skeleton design and for supporting the          relationship model HERM [Tha91]. The designer
acquisition of semantics of the prospective database. The       describes the structure of an application in German. The
approach is based on the assumption that verbs form a           specification and formalisation of semantic constraints is
central part in defining the meaning of sentences and imply     one of the most complex problems for the designer. Within
semantic roles in the sentences which have to be filled by      natural language sentences the designer uses semantic
objects. We are using a moderated dialogue for drawing          constraints intuitively. For that reason, within the natural
the designer's attention to these objects in order to extract   language design process we focus on extracting
comprehensive information about the domain.                     comprehensive semantic information about the domain
                                                                from natural language utterances. The results of the
                                                                dialogue are available in the internal DataDictionary for
                                                                the other tools (grahical interface, integrity checker,
1          Introduction                                         strategy adviser,...) of the system. Within the RAD system
                                                                the designer can use these results for various forms of
The quality of database design is a decisive factor for the     representation, e.g. a graphical representation. The
efficiency of a database application. A database designer       skeleton design with the semantic constraints is also the
has to use a high level of abstraction for mapping his real-    basis for further semantic checks, e.g. of key candidates,
world application onto an entity relationship model. The        and will restrict the search areas in the checking process.
designer has to learn the model and the constraints to use
it.                                                             For the theoretical and pragmatic analyses of the language
                                                                used within the design dialogue it was necessary to do
Natural language can be exploited in order to overcome          this with a practical example. So we decided to choose
this bottleneck. From our point of view a user-friendly         the field of library - its tasks and processes. As a method
design system has to have two supporting tools: firstly, a      of obtaining the linguistic corpus we carried out a number
tool which makes available an interface for obtaining a         of interviews with librariens and library users. The
natural language description of an application and              extracted corpus was analysed statistically to obtain the
secondly, a tool for paraphrasing database schemes in a         frequency of word forms and the occurence of synonyms
natural language way (see also [FloPR85]).                      and homonyms. Starting from this domain we developed
                                                                relations to other domains (see [BucD94]).
[ColGS83], [TseCY92], [TjoB93] are presenting various
methods dealing with natural language as input for              The dialogue tool will be implemented in PROLOG.
database design systems. These systems are based on
natural language texts for the requirement specification in
the data base design process. This paper illustrates how
natural language in a dialogue tool can be used for             2        The structure of the dialogue tool
gathering the knowledge of the designer and how it can
be transfered into an extended entity-relationship model.       For the acquisition of designer knowledge we decided to
The dialogue together with the knowledge base will be           choose a moderated dialogue tool. A moderated dialogue
used for drawing to the designer's attention special facts      can be seen as a question-answer-tool. The tool asks for
resulting from the syntactic, the semantic and the pragmatic    input or additional questions considering the acquisition
analyses. The tool makes suggestions for completing the         of database design information. These questions are frames
design applying the knowledge base.                             which will be updated in the dialogue process. The
                                                                designer can formulate the answer in natural language
    * This work is supported by DFG project TH 456/2-2.
                  natural
                                                                  inter-                            domain-
                  language                       analyses of
                               syntactic                          mediate           pragmatic       dependent
                                                 semantic
                               analysis                                             inter-
                                                 roles            formalism                         HERM
                  input                                                             pretation
                                                                                                    description


                                                                             domain             HERM
                                                                             model              model


              Fig. 1. Two-stage Dialogue interpretation tool


sentences. Each sentence will be analysed syntactically as             2.2      Semantic analysis
well as semantically and then transformed into HERM
stuctures.                                                             Interpreting the semantics of the designer input we are
                                                                       using the model of Bierwisch [Bie88] which inserts a
Within the dialogue the results of the syntactic, semantic             semantic level between the syntax level and the conceptual
and pragmatic analyses will be used for controlling the                level (HERM data model).
dialogue. That means, if an incomplete designer input is
received a question will be initiated. Inputs are incomplete           We assume that verbs form a central part in defining the
if either semantic roles are not complete or the newly                 meaning of sentences and the relationships between parts
generated design model is incomplete. Semantic roles are               of sentences. Basically they describe actions, processes
filled within the semantic analysis. The pragmatics realizes           and states. We have tried to find a classification of verb
the transformation of the natural language sentences into              semantics that can be applied to all verbs in the German
HERM structures.                                                       language. Our aim was to keep the number of classes small
                                                                       and fairly general but large enough to identify their function
                                                                       in a sentence correctly. This classification (see also
2.1      Syntactic analysis                                            [BucD94]) is, at this stage, independent of the domain to
                                                                       be analysed (cf.Fig.2).
The syntactic analysis of the natural language input of the
designer is based on a GPSG parser (Generalized Phrase                 To identify the meaning of sentences we have used the
Structure Grammar) [Gaz85]. GPSG belongs to the family                 model of semantic roles. Verbs of a special class imply
of Unification Grammars. A basic feature is the                        the occurence of semantic roles. The units in a sentence
introduction of ID/LP Rules (Immediate Dominance/ Li-                  or an utterance are seen to fulfil certain roles. Our role
near Precedence). Immediate Dominance determines the                   concept is mainly based on the hypothesis by Jackendoff
immediate dominance of a root over its followers, Linear               [Jac83] and consists of the following roles which refer to
Precedence determines the order in which the follower,                 the objects partaking in the action: Cause, Theme, Result/
e.g. syntactic categories are to be processed.                         Goal, Source, Locative, Temporal, Mode, Voice/Aspect.
The parser implemented in our tool uses the Earley                     The following example illustrates the role concept.
algorithm [Ear70].

                                                               verbs


                                static                         dynamic                 modal


                     verbs copulative stative                                    modal      epistemic catalysts
                     of         verbs verbs                                       verbs     verbs
                     position
                                           transport             verbs of           event
                     (locative)
                                                                 production         verbs

                                  change            verbs              perception verbs
                                  of                of                 utterance verbs
                                  ownership         movement           (communication)
                    Fig.2. Verb classification
Example. 'The user borrows a book with a                         grammar rules as well as into semantic rules. A compiler
borrowing-slip'                                                  for this purpose has been developed. The following
                                                                 example illustrates how the transformation is realized.
results of the semantic analysis:
verb type:   change of ownership
                                                                 Example. Transforming the utterance ‘at the library’ into
subject:     the user                                            an entity named ‘library’ using a contextfree grammar
object:      a book                                              formalism. (The small letters identify nonterminals, and
locative:    ?*                                                  the capital letters are terminals. ‘$x’ is a variable.
temporal:    ?*                                                  ‘assert(X)’ asserts ‘X’ to the model description.)
mode:        with a borrowing-slip
                                                                 tuple structure:
(* an additional question will be initiated)                     S(PP(PRAEP(at),NP(DET(a),N(library))))

                                                                 grammar rules:
                                                                 start       S(phrase)
2.3    Pragmatic interpretation
                                                                 phrase        PP(pp_phrase)
                                                                 pp_phrase        PRAEP($x),NP(np_phrase)
2.3.1 Obtaining a skeleton design
                                                                 np_phrase        NP(det_phrase,n_phrase)
                                                                 det_phrase        DET($x)
The transformation of the structure of natural language
                                                                 n_phrase        N($x) {assert(entity($x))}
sentences into EER model structures is a process which is
based on heuristic assumptions, e.g., we assume that all
                                                                 The advantage of this approach is that we can define
nouns are entities. [TjoB93] illustrate a large number of
                                                                 actions at the word category level as well as at the sentence
such heuristics in an informal way. If we accept these
                                                                 phrase level. So, it is possible to define database design
heuristics then we can formalize them using contextfree
                                                                 actions, e.g. when considering the occurence of a genitive
and contextsensitive rules.
                                                                 nominal phrase connected with another nominal phrase
                                                                 in the sentence. The heuristics underlying is that a genitive
Example.
                                                                 nominal phrase has an attribute function concerning the
/* all nouns are transferred into entities */
                                                                 corresponding nominal phrase.
N(X)         entity(NAME,X).
                                                                 We are using a dialogue in which the designer can
/* sentences with the main verb ‘have’ are transferred into
                                                                 formulate a description of an application in several
an entity (the subject) and the according attribute (the
                                                                 sentences. For that reason we have to deal with the problem
object of the sentence) */
                                                                 of inserting a new part of a design into an existing design.
                                                                 We have implemented a two-step approach. Firstly, a
N(X),subject(X),V(haben),N(Y),object(Y)
                                                                 seperate design will be generated from the sentence of the
     entity(X),attre(X,Y).
                                                                 user. Secondly, the design description will be updated
                                                                 inserting the new design part. Common heuristics are the
Considering the results of the syntactic analysis of a natural
                                                                 basis of the updating process (cf. [Düs94]).
language sentence we can describe these results using a
tuple structure.

Example. The tuple structure of the sentence ‘the user           2.3.2 Extracting information on behaviour
borrows a book with a borrowing-slip’ is:
                                                                 In most cases a database will be used for complex
S(NP(DET(the),N(user)),                                          processes. In order to be able to maintain the database we
  VP(VP(V(borrows),NP(DET(a),N(book)),                           have to define transactions. (For the reasons of using
                  PP(PRAEP(with),                                transactions see [Tha94:114].) The behaviour of the
                     NP(DET(a),                                  database can help to make the system more efficient and
                        N(borrowing-                             faster and thus to save time and money.
                           slip)))))
                                                                 Behaviour can best be gained from a knowledge base.
The tuple can be seen as a language which can be described       One form of presenting the domain is by classification of
by a grammar, e.g. terminals are N, DET or VP. The               the processes involved as a conceptual graph. The
HERM model can also be seen as a language if predicates          knowledge base will be used for gathering relevant
are used to describe the elements of the model. Now we           processes of the application and is based on the results of
can handle the transformation as a compiler process using        the semantic analysis. Each application can be classified.
an attribute grammar. The heuristics are integrated into         Lending processes are identified by verbs of the class
                                                                  3       Conclusions/ Future Topics
                                work flow
                                                                  We have presented a dialogue tool consisting of a syntax
                                                                  analyser, a semantic role definer and a pragmatics
                       material flow immaterial flow              interpreter. The dialogue tool gathers information on
                                                                  structure, semantics and behaviour of the prospective
                                                                  database. By means of transformation rules this
              reversible            irreversible                  information is mapped onto the HERM model.

                                                                  The advantage of the dialogue tool is that the designer
 hiring lending      renting ... selling passing on         ...   can describe the requirements of the database system in a
                                                                  natural language (German) and thus can specify the
Fig. 3. Part of the process classification                        knowledge of a domain in a natural way. This knowledge
                                                                  is then employed for gathering database constructs such
                                                                  as entities, attributes, cardinalities, constraints, etc.
'change of ownership'. The library processes or the ‘rent
a car’ processes (cf. Fig. 3) belong to this group.               The efficiency of the database greatly depends on the exact
                                                                  interpretation and transformation of the natural language
The lending process as a complex process can be further           input analysis. The accuracy, on the other hand, depends
classified into a number of pre and post processes (cf.           on the size and complexity of the grammar used and the
Fig. 4). These processes are included in the knowledge            scope of the lexicon.
base. If a user input contains one of these processes a
possible classification will be defined and an action within      Work in future has to concentrate on extending the
the dialogue will be initiated.The pre and post processes         grammar to comprise all types of sentences and other
in Fig. 4 can be further subdivided into processes which          hitherto excluded parts of grammar and on ways of
are summarized in the above classification. Lending thus          steadily increasing the lexicon. For reasons of integrity
requires the processes of obtaining a user card, updating         we cannot leave updating of the lexicon to the chance
the user card if need be checking whether the book is held        designer who may have no linguistic training. Much work
and available, filling in a borrowing-slip and signing it.        will have to go into completing and maintaining the
                                                                  linguistic background before it can finally be used for
Example. The sentence ‘the user borrows a book with
                                                                  any type of systems design.
borrowing-slip’ implies the following general questions
(borrowing has the synonym lending):
preprocesses:                                                     A second future topic is the application of the linguistic
1) Is the process ‘obtaining’ situated before                     knowledge for acquiring further semantic information of
       ‘lending’ ?                                                the prospective database, e.g. acquiring key attributes or
2) Is the process ‘registration’ situated                         functional dependencies.
       before ‘lending’ ?
main processes:
3) Is the process ‘document exists’ situated
       before ‘lending’ ?
4) Is the process ‘document valid’ situated
       before ‘lending’ ?                                         Acknowledgements
       ...
postprocesses:                                                    We are grateful to Bernhard Thalheim for his guidance
5) Is the process ‘returning’ situated after                      and support of our work and for his helpful criticism and
       ‘lending’ ?                                                suggestions.
The designer has to give correct answers.



           obtaining             registration           lending               returning




              document           document          object             object          contract         object
              exists             valid             exists             available       completed        transferred

       Fig. 4. Part of the knowledge base: pre, main and post processes of the act/borrowing/ lending
References


[Bie88] Bierwisch, M., Motsch, W., Zimmermann, I. :            entwurf RAD. Workshop
         Syntax, Semantik und Lexikon. Berlin,Akademie         "Benutzerschnitstellen“,17.-19.März1994,
         Verlag, 1988                                          Kassel
[BucD94] Buchholz, E., Düsterhöft, A.:                   [TjoB93] Tjoa, A.M., Berger, L.:
       The linguistic backbone of a natural language           Transformation of Requirements Specifications
       interface for database design. In: LLC ?/94,            Expressed in Natural Language into an EER
       Oxford University Press                                 Model. Proceeding of the 12thInternational
[ColGS83] Colombetti, M.; Guida, G.; Somalvico, M.:            Conference on ER-Approach, Airlington, Texas
       NLDA: A Natural Language Reasoning System               USA,Dec. 15-17th, 1993
       for the Analysis of Data Base Requirements. In:
       Ceri, S. (ed.): Methodology and Tools for Data
       Base Design. North-Holland, 1983
[Düs94] Düsterhöft, A.:
       Zur Vorgehensweise bei der pragmatischen Inter
       pretation natürlichsprachiger Äußerungen
       Im Datenbankentwurf. Preprint 4/94,
       Fachbereich Informatik, Universität Rostock
[Ear70] Earley, J.:
       An efficient context-free parsing algorithm.
       Comm. ACM13:2, S.94-102
[Eic84] Eick, Ch.F.:
       From Natural Language Requirements to Good
       Data Base Definitions - A Data Base Design
       Methodology. In: Proc. of the International
       Conference on Data Engineering, pp.324-331,
        Los Angeles, USA, 24.-27.4.1984
[FloPR85] Flores, B.; Proix, C.; Rolland, C.:
        An Intelligent Tool for Information Design.
       Proc. of the Fourth Scandinavian Research
       Seminar of Information Modeling and Data Base
       Management. Ellivuori, Finnland, 1985
[Gaz85] Gazdar, G.; Klein, E.; Pullum, G.; Sag, I.:
       Generalized Phrase Structure Grammar.
       Havard University Press Cambridge, Mass. 1985
[GolS91] Goldstein, R.C.; Storey, V.C.:
       Commonsense Reasoning in Database Design.
       Proc. of the 10th International Conference on
       Entity-Relationship Approach, San Mateo,
       California, USA, 23.-25.October 1991, pp.77-92
[Jac83] Jackendoff, R.:
       Semantics and cognition. MIT Press,
       Cambridge Mass., 1983
[Tha91] Thalheim, B.:
        Intelligent Database Design Using an Extended
       Entity-Relationship Model.
       Berichte des Fachbereiches Informatik 02-1991,
       Universität Rostock.
[Tha94] Thalheim B.:
       Fundamentals of Entity-Relationship Modeling.
       Springer Verlag 1994, Forthcoming
[ThaA94] Thalheim, B., Albrecht, M., Altus, M.,
       Buchholz, E., Düsterhöft, A., Schewe, K.-D.:
       Die Intelligente Tool Box zum Datenbank