<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body><div><div style="font-family: Calibri,sans-serif; font-size: 11pt;">You might want to store the versification alongside it if you're working across multiple modules.</div></div><div dir="ltr"><hr><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">From: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;"><a href="mailto:scribe@crosswire.org">Troy A. Griffitts</a></span><br><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">Sent: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;">‎01/‎03/‎2015 08:19</span><br><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">To: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;"><a href="mailto:sword-devel@crosswire.org">SWORD Developers' Collaboration Forum</a>; <a href="mailto:d.j.yotta@gmail.com">Daniel Sheffield</a></span><br><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">Subject: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;">Re: [sword-devel] SWKey index</span><br><br></div>Hi Daniel, the most concise way to store an SWKey is to store the string from: SWKey::getOSISRefRangeText<br>
<br>
This should return OSIS (or something close to OSIS) and include any range is present, as well.<br>
<br>
SWKey::Index is certainly not persistable. It might change between API versions and almost certainly will be different between versification (v11n) schemes from different Bibles.<br>
<br>
Hope this helps.<br>
<br>
Troy<br><br><div class="gmail_quote">On February 28, 2015 10:47:07 PM MST, Daniel Sheffield &lt;d.j.yotta@gmail.com&gt; wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">
<pre class="k9mail">Hi all,<br><br>I'm just wondering what is the correct way to go about storing scriptural references (specifically for use with SWORD) in a database?<br><br>Currently, I'm storing references in the form Gen. 1.1 or Gen. 1:1 etc. and I'm thinking about being more consistent by first parsing the reference with VerseKey to the expanded form Genesis 1:1 before inserting into the database.<br><br>I don't like the idea of storing strings everywhere though - I know I'm being pedantic - it just doesn't seem right.<br><br>I would rather store the SWKey index - which I gather is simply an integer of some kind, which would both decrease the size of the database and provide some consistency in how references are stored in the db.<br><br>In short: is the index for a particular scripture guaranteed never to change between SWORD versions?<br>ie, will (SWKey("Gen. 1.1")).getIndex() always return the same across sword api versions?<br><br>I've come across this in the API documentation, but I couldn't find anything about SWKey::index itself<br><br>   SWKey::SWKey   (  const char *    ikey = 0   )<br>     initializes instance of SWKey from a string All keys can be reduced to a string representation which should be able to be used to again set the key to the same position<br><br>   Parameters:<br>     ikey string to use for initializing this new key<br><br>On the other hand, I like being able to store distcontiguous ranges (eg, Gen. 1.1-3.4,5.6) which can be loaded into VerseKey and iterated over fairly easily, but knowing whether or not the SWKey index is invariant across api versions will help me to decide on how I should store references in the db. There may also be another option that I am not aware of which is better than both of these methods.<br><br>Cheers,<br><br>Daniel Sheffield<br><br>Software Engineer<br>Level 9, KPMG Centre<br>Alexander Street<br>Hamilton<br><br>+64 21 1408 708 Mobile<br><a href="http://www.emulex.com">http://www.emulex.com</a><br><br><hr><br>sword-devel mailing list: sword-devel@crosswire.org<br><a href="http://www.crosswire.org/mailman/listinfo/sword-devel">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>Instructions to unsubscribe/change your settings at above page<br></pre></blockquote></div><br>
-- <br>
Sent from my Android device with K-9 Mail. Please excuse my brevity.</body></html>