Task #401
Design the Book Data Model
100%
Description
Here are some requirements:
Immediate requirements:- Ability to display a particular verse
- Ability to display a particular chapter
- An outline of the book (section and sub-sections)
- Verse and chapters must be ordered
- Chapters need a name (the first chapter may be a preface or introduction, not "chapter one")
- Footnote support
- Morphological parsing of individual words
- Ability to search contents
History
#1 Updated by Luke Murphey about 12 years ago
- Description updated (diff)
#2 Updated by Luke Murphey about 12 years ago
There are a few ways to handle this:
- Use SGML/XML: this provides formatting and the XML structure would allow morphological parsing data to be included. Searching doesn't really work unless using an XML database.
- Use database model of chapter » verse » word: no formatting allowed but allows easy morphological parsing and seraching.
#3 Updated by Luke Murphey about 12 years ago
- Status changed from New to In Progress
#4 Updated by Luke Murphey about 12 years ago
May want to redo the model such that the verses and chapters use a foreign key relation. This is necessary to make deletions of the work cascade to the verses and chapters.
See http://stackoverflow.com/questions/3937194/django-cascade-deletion-in-manytomanyrelation
#5 Updated by Luke Murphey about 12 years ago
I could use something like markdown in order to process the text to handle formatting, footnotes and even lemmatization. See https://github.com/trentm/python-markdown2#readme
#6 Updated by Luke Murphey about 12 years ago
I switched the models to use foreign keys so that the deletes cascade.
#7 Updated by Luke Murphey about 12 years ago
I am refactoring the models such that Section and Chapter models are replaced a single model that does both: Division.
#8 Updated by Luke Murphey about 12 years ago
The problem with the model that has verses foreign key to divisions is that it is difficult to find the lowest level of divisions. The lowest level of divisions are the ones that need to be used for chunking.
It may be necessary to have verses be a many-to-many field within Division objects. However, this means that verses will not be deleted when divisions are deleted.
#9 Updated by Luke Murphey about 12 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
This is now basically done. The model will be updated as necessary to support new functionality.