[sword-devel] modules to relational database

Martin Gruner mg.pub at gmx.net
Tue Nov 7 13:36:41 MST 2006

Hi Gabriel.

>From what I've seen, a lot (maybe most) of the "serious" bible texts have
> structured their documents like you would a book, and then littered it
> with "milestones" to mark where chapters and verses begin.  E.g.
> <!-- my aplologies for butchering ThML -->
> <p>
>   <ScripRef verse='Gen 1:1' />In the beginning, God created
>   the heavens and the earth.  <ScripRef verse='Gen 1:2' />
>   And the earth was shapeless and void...
> </p>

Indeed, milestones are a problem. My current approach would be to extract 
navigational (structural) data that is milestoned to another tree database 
with references to the main. This would allow you to work with the original 
XML structure.

> On the one hand, you can store the XML document in a relational database
> as an XML document... preserving each tag, location, attributes, etc.  On
> the other hand, I would expect someone (like me or the OP) to try and
> divide things up by Book/Chapter/Verse:
> +------+----+-------+---------------------------------------+
> | Book | Ch | Verse | Text                                  |
> +------+----+-------+---------------------------------------+
> | Gen  | 1  |   1   | In the beginning, God created the     |
> |
> |      |    |       | heavens and the earth.                |
> +------+----+-------+---------------------------------------+
> | Gen  | 1  |   2   | And the earth was shapeless and       |
> |
> |      |    |       | void...                               |
> +------+----+-------+---------------------------------------+

This is not possible without destroying the structure of milestoned documents.

> To be clear on what I'm getting at... IMHO, I just don't think there's a
> large advantage to converting a module to a RDMS.  If you preserve the
> original document (OSIS, ThML, etc.)... why not just leave it in OSIS,
> ThML, etc.?  

You've got a good point right there. This would actually be most preferrable. 
I don't know of a good solution for fast access in that case. You don't want 
to read the entire document into memory, and you don't want to parse it every 
time. Ideas?

> If you redo the schema to the RDMS, I think you'll end up 
> with a lot of headaches that the XML/SGML schemas solve well.  I can be
> convinced otherwise (after all, I really do love RDMS's)... but this is
> how I see it.

Thanks for your comments!


More information about the sword-devel mailing list