[sword-devel] Versification representation questions...

Chris Burrell chris at burrell.me.uk
Sun Nov 8 06:50:00 MST 2009

Hi all

I'm on a project using JSword and we're linking Scripture to various
reference materials. For various reasons, we will need to store references
to our material in the database and not in a Sword module. Does anyone have
any views as to the best way of storing the verse/passage reference?

I've come up with a few solutions, but not sure which would be the most
efficient, speed, space, etc.-wise... It will be used mainly to serve the
"Does the bible reference provided by the user match any of our material?",
or more simply, "Does passage A overlap with passage B"?

Our material will be keyed by passage as opposed to per verse, ie. ranges of

1- Storing the reference as is in the database, say 1Kings.2:10-15;3:2-3
would mean we'd have to do lots of string manipulations to figure out
overlap of 2 references

2- Storing the beginning and end of each section say as a group of sub
references { (book, start_chapter, start_verse, end_chapter, end_verse)+ }.
In this case a reference would be many of the previous definition. I can see
how we could work it out here, but i can see also having to do lots of index
range scans on our database

3- Number each verse of the bible from 1 to 30000 or something like that,
and then workout and store each verse that is included in the reference in a
table somewhere in the database
The benefit here seems to be that we would get lots of unique index lookups,
but maybe the number of lookups would actually be better off doing range
scans... Also, we would have quite a bit more disk space overhead, if we're
storing a row for each verse.

4- Number each verse of the bible from 1 to 30000 or something like that,
but only store the ranges say verses 30-140 + verses 1500-1512

5- Numbering each verse, but keying the numbers by book, say Exodus verse
750, 751, 752, etc.

6- We have the benefit of working in Java with a Java database, and so could
write a Java stored procedure to parse whatever solution comes out of
here... It would have to be fast though, given the end product is the web,
and the main activity will searching across scripture references...

We'll be doing many searches on our data and updating it only very rarely.
I'm a bit at a loss as to best way of doing this... How does JSword cope
with this? or does it uniquely do scripture lookups and not scripture
overlap? (ie. working out whether two portions of scripture overlap with
each other).

Any ideas anyone?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20091108/c1f78f4f/attachment.html>

More information about the sword-devel mailing list