Skip to content

Latest commit

 

History

History
76 lines (46 loc) · 5.9 KB

Scripts.md

File metadata and controls

76 lines (46 loc) · 5.9 KB

The CroALa CTS XQuery scripts

We are following the model in capitains.github.io/pages/guidelines. For our database and XQuery processor we use BaseX.

Making the XML CTS-conformant

  • First, we need to create workgroups, as directories and metadata descriptions; to achieve that in an uniform way, we call the croalabib XML db (for authors' names)
  • We need to create work directories inside each workgroup
  • The appropriate files have to be moved into the work directories
  • File names have to be changed, but a concordance list (old name - new name) will be kept

The scripts work locally, paths of files have to be changed. They also rely on several XML databases.

All these scripts are combined in create-single-author-textgroups.bxs.

In the next phase, we use a helper index file croalactstextgroups.xml, created with croalacts-create-work-metadata.xq.

Create the database

The (development) database which will be created from files in data is called croala-cts-1. It can be created and replicated with the script create-croalacts-db.bxs, provided you correct the absolute path of the data directory.

On our development server, the script is run by:

./basex/bin/basex /home/croala/cts-croala/scripts/bxs/create-croalacts-db.bxs

Then we move the XQuery modules (croalacts.xqm, functx.xqm) and scripts to required places:

rsync -avzP scripts/restxq/cts-open-urn.xq ~/basex/webapp/restxq/

rsync -avzP scripts/xqm/*.xqm ~/basex/repo/

We test the setup by going to, for example, croala.ffzg.unizg.hr/basex/cts/urn:cts:croala:sivri01.croala853690.croala-lat1:text.body.div2.div6.div2.div2.l6. Or, if we want, we open a CTS URN several levels up: croala.ffzg.unizg.hr/basex/cts/urn:cts:croala:sivri01.croala853690.croala-lat1:text.body.div2.div6.

Navigating the CTS URN system

CTS URNs present texts at several levels:

  • textgroups (usually sharing the same author, or authors, or identity)
  • works (belonging to textgroups, instantiated in different editions)
  • editions (realizations of works, differing in textual readings, layout, language)
  • segments (all divisions of an edition we find necessary)

There are XQuery functions to display, or access, everything CroALa has at each level.

All functions are part of the croalacts.xqm XQuery library module.

The functions were developed using unit testing. The tests are in ctstest.xqm.

Results of XQueries are displayed as web pages using the BaseX RESTXQ API. The RESTXQ scripts are in restxq, as follows: