[osis-core] reference system experiments

Harry Plantinga osis-core@bibletechnologieswg.org
Mon, 24 Feb 2003 11:17:03 -0500


All:

I've been doing a few experiments with reference 
systems and reference validation/conversion. The syntax
is of course all my own invention and subject to change
when some working group works on this problem.

The work allows the definition of a reference system as
an xml file and the mapping of a system to/from a parent 
system.  For example, Bible.KJV could have a mapping to Bible.

There is a sample file with osisRefs and a sample XSLT that
validates and converts the refs as requested. 

These are presented for your comments and suggestions. I'm
going to be implementing some kind of Bible reference system 
resolution on the CCEL in the near future. 

-----------reference system definitions-------------------

A file defines the Bible: refsys and lists file lists all the 
osisIDs in it:
http://www.ccel.org/osis/refsys/refsys-Bible.xml 

<refSys code="Bible" name="OSIS Standard Bible Reference System">
  <osisIDs>
    <osisID code="Gen.1.1"/>
    <osisID code="Gen.1.2"/>
    <osisID code="Gen.1.3"/>
    [...]
 
Another file has entries like that and also mapping data:
http://www.ccel.org/osis/refsys/refsys-Bible.KJV.xml

<refSys code="Bible.KJV" name="King James Version">
  <alias code="Bible.NIV"/>
  <alias code="Bible.ASV"/>
  <osisIDs>
    <osisID code="Gen.1.1"/>
    <osisID code="Gen.1.2"/>
    [...]
  </osisIDs>

  <refMap from="Bible.KJV" to="Bible">
    <map from="3John.1.14" to="3John.1.14-3John.1.15"/>
    <map from="Rev.12.17"  to="Rev.12.17-Rev.12.18"/>
  </refMap>

  <refMap from="Bible" to="Bible.KJV">
    <map from="3John.1.15" to="3John.1.14"/>
    <map from="Rev.12.18"  to="Rev.12.17"/>
    <map from="1Macc" to=""/>
    <map from="Tob" to=""/>
    [...]
  </refMap>
</refSys>

------------ refsys validation and conversion---------

I wrote a little xslt to validate and convert refsystems:
http://www.ccel.org/osis/refsys/resolve.xsl .  I ran it on
the following XML file:
<?xml version="1.0"?>

<stuff>
  <a>
    <random>
       <tag osisRef="Bible.KJV(Bible:Rev.12.18)" />
       <tag osisRef="Bible(Bible.KJV:Rev.12.17)" />
       <tag2 osisRef="Bible.KJV(Bible:1Macc.2.3)" />
    </random>
    <morestuff>
       <anothertag osisRef="Bible:Hez.3.12">Hezekiah 3:12</anothertag>
       <anothertag osisRef="Bible:Rom.3.12">Romans 3:12</anothertag>
    </morestuff>

  </a>

  <afinaltag osisRef="Bible:Ps151.1.2"/>
  <afinaltag osisRef="Bible:Ps151.1.20"/>
  <apstag osisRef="Bible.KJV:Ps.119:120"/>
</stuff>


I got the following output:

Welcome to the XSLT osisRef resolver proof-of-concept.  

osisRef: Bible.KJV(Bible:Rev.12.18) -> Bible.KJV:Rev.12.17
osisRef: Bible(Bible.KJV:Rev.12.17) -> Bible:Rev.12.17-Rev.12.18
osisRef: Bible.KJV(Bible:1Macc.2.3) -> Bible.KJV:
osisRef: Bible:Hez.3.12 - Not valid
osisRef: Bible:Rom.3.12 - Valid!
osisRef: Bible:Ps151.1.2 - Valid!
osisRef: Bible:Ps151.1.20 - Not valid
osisRef: Bible.KJV:Ps.119:120 - Not valid

-Harry