Example

Can you give an example?

Sure.

// Create the database
CREATE DATABASE linguistic_database1 GO

// Connect to the database
USE DATABASE linguistic_database1 GO

CREATE ENUMERATION part_of_speech_t = {
    noun = 1,
    verb,
    adjective,
    adverb,
    preposition,
    conjunction,
    negative,
    personal_pronoun,
    demonstrative_pronoun,
    interrogative_pronoun,
    interrogative,
    interjection,
    article
}
GO

CREATE ENUMERATION person_t = {
  // we need a "Not Applicable" value for 
  // those words that do not have person.
  pers_NA = -1,

  // we cannot use "first", since that is a reserved keyword
  pers_first = 1,  
  pers_second = 2,
  pers_third = 3
}
GO


CREATE ENUMERATION number_t = {
  NA = -1,
  singular = 1,
  dual = 2,
  plural = 3
}
GO


CREATE ENUMERATION gender_t = {
  NA = -1,
  masculine = 1,
  feminine
}
GO


CREATE ENUMERATION phrase_type_t = {
    NP = 1,
    VP = 2,
    AP = 3,
    AdvP = 4,
    PP = 5
}
GO


CREATE ENUMERATION phrase_function_t = {
    Predicate,
    Subject,
    Objct,  // Cannot use "Object", since that is a reserved word.
    IndirectObject,
    Complement,
    Adjunct
}
GO

CREATE OBJECT TYPE
[Word
    surface : STRING; // 8-bit string
    lemma : STRING; // 8-bit string
    pos : part_of_speech_t;
    person : person_t;
    number : number_t;
    gender : gender_t;
    parent : id_d; // points to a phrase or a clause
]
GO

CREATE OBJECT TYPE
[Phrase
    phrase_type : phrase_type_t;
    function : phrase_function_t;
    parent : id_d; // points to a phrase or a clause
]
GO

CREATE OBJECT TYPE
[Clause
    parent : id_d; // points to a clause or a sentence
]
GO

CREATE OBJECT TYPE
[Sentence
    parent : id_d;  // points to a paragraph
]
GO

CREATE OBJECT TYPE
[Paragraph]
GO


Previous:Summary
Up:Schema
Next:Population