-
Notifications
You must be signed in to change notification settings - Fork 43
Database Schema
Această pagină este în limba engleză. Dacă aveți nevoie de ajutor cu traducerea, vă rugăm să ne contactați.
Note: Last updated December 2021. We explain the general purpose of each table and the connections between tables, so this documentation should still be useful when it's slightly outdated.
The entry is the central point that coordinates other pieces of information related to definitions. For example, there will be an entry for pâine (bread). There will be two entries for broască since it has two meanings (frog or lock). Entries don't have a lot of information of their own.
An entry contains multiple definitions (the many-to-many mapping is in the EntryDefinition
table). One entry obviously needs to hold multiple definitions (usually from different dictionaries). The converse is also true: a definition may belong to several entries. This is because sometimes dictionaries group several meanings into a single definition, whereas we decide to split them across different entries. A hypothetical example might be urât (ugly) versus urât (boredom).
An entry contains multiple lexemes (the many-to-many-mapping is in the EntryLexeme
table). We do this to accommodate variants like fierăstrău, ferestrău, ferăstrău, herăstrău (saw). Paper dictionaries have to list herăstrău under the letter "H" in case somebody looks it up there, then provide a placeholder definition ("see ferăstrău"). We have no such need and we can simply say "fierăstrău can also be referred to as ferestrău, fierăstrău or herăstrău".
The lexeme mostly holds morphological information (the conjugations / declensions). For that reason, sometimes it is useful to associate one lexeme with multiple entries. For example, broască (frog) and broască (lock) are declined identically, so there is no need to split the lexeme.
An entry may also contain meaning trees. The aim of a meaning tree is to compare and summarize all the definitions for an entry, which are often redundant and, on occasion, conflicting. We have about 20,000 published meaning trees as of December 2018. You can see them in the sinteză (synthesis) tab where available, for example veni or urs.
Meaning trees are hierarchical, thus the Tree
object is just a placeholder for zero or more Meaning
objects. Trees are mapped many-to-many to entries (via the TreeEntry
table). The case where we need to associate the same tree with multiple entries is rare, but it does happen.
The core business of dexonline (searches and results) revolves around these tables and mappings.
Some tables link two other tables in a many-to-many relationship. These are EntryDefinition
, EntryLexeme
, LexemeSource
, MeaningSource
and TreeEntry
. Obviously, a table named FooBar
will link two tables named Foo
and Bar
. The corresponding PHP classes extend the abstract class Association.php
, which offers some magic methods.
We use EntryDefinition
to explain the common mechanism. Some tables can have additional fields, in which case they are also listed in the next section.
Column | Description |
---|---|
id |
Unique numeric ID. |
entryId |
Entry being mapped. |
definitionId |
Definition being mapped. |
entryRank |
Rank of this entry in the list of entries for this definition. This is important so that, if we edit a definition and associate it with several entries, the order of the entries is preserved when we save the page. |
definitionRank |
Rank of this definition in the list of definitions for this entry. Same rationale as above. |
The corresponding PHP classes are in the lib/models directory.
- Abbreviation
- AccuracyProject
- AccuracyRecord
- AdsClick
- AdsLink
- ConstraintMap
- Cookie
- CrawlerIgnoredUrl, CrawlerPhrase, CrawlerUrl: these tables store data for the Romanian literature crawler project, which is not under development at the moment.
- Definition
- DefinitionSimple
- DefinitionVersion
- Entry
- EntryLexeme
- Fragment
- FullTextIndex
- HarmonizeModel
- HarmonizeTag
- InflectedForm
- Inflection
- Lexeme
- Loc
- Meaning
- Mention
- MillData
- Model
- ModelDescription
- ModelType
- ObjectTag
- OCR
- OCRLot
- OrthographicReforms
- PageIndex
- ParticipleModel
- PasswordToken
- RandomWord
- RecentLink
- Relation
- SimilarSource
- Source
- SourceAuthor
- SourceRole
- SourceType
- Tag
- TopEntry
- TraineeSource
- Transform
- Tree
- Typo
- User
- UserWordBookmark
- Variable
- Visual
- VisualTag
- WikiArticle
- WikiKeyword
- WordOfTheDay
- WordOfTheMonth
- WotdArtist
- WotdAssignment