Digital Syriac Corpus

Srophé Application : Documentation

Browse Options

The browse page allows a access to the full collection of data or browsing on a subset/collection of the data. The default behavior of the page is to present an alphabetical (English) list of all resources titles. Because of variation in the data the default XPath is set to tei:titleStmt/tei:title[1]. This is slow for large data sets. If you can provide a more specific XPath for your title that would be better. For example: tei:titleStmt/tei:title[@level=’a’] will significantly speed up your browse time. You can change or add additional options to match the requirements of your TEI data.

You can set the browse XPath via the HTML page. See browse page

The browse:get-all function has an optional element parameter that can be passed to the browse function. To change the default: <div data-template="browse:get-all"> should become: <div data-template="browse:get-all" data-template-element="tei:titleStmt/tei:title[@level='a']">

Limit to collection or series

Browse pages can also be limited to a specific data collection or by TEI series as defined in the repo-config.xml file. To limit the browse to a collection or series add a data-template-collection attribute to the <div data-template="browse:get-all"> div in the browse.html file with your collection name, this must match the collection name in the repo-config.xml file. Example: <div data-template="browse:get-all" data-template-collection="places">

Language specific browse

Additional browse options include configurable browse options for different languages.

Examples:

  • English (defaults to tei:titleStmt/tei:title):

    <li><a href="browse.html?lang=en">English</a></li>

  • English on a specific TEI element:

    <li><a href="browse.html?lang=en&element=tei:place/tei:placeName">English Place Names</a></li>

  • Syriac on a place Name (tei:place/tei:placeName): _You must include the alpha-filter parameter with the first character of the Alphabet. _

    <li><a href="browse.html?lang=syr&element=tei:place/tei:placeName&alpha-filter=ܐ">Syriac Place Names</a></li>

  • Arabic:

    <li><a href="browse.html?lang=ar&element=tei:place/tei:placeName&alpha-filter=ا">Arabic Place Names</a></li>

The language browse relies on the sorted TEI element having the appropriate language tag in the TEI (@xml:lang). The browse page also provides several alphabetical menus. Currently supplied menus are for English, Syriac, Arabic and Russian, additional menus can easily be added to the browse interface by including the alphabet for the desired language in the browse:abc-menu() function in modules/browse.xqm.

Maps

To add a Leafletjs or Google map to your browse page, simply add the following tab. This looks for any data matching your browse parameters which also has tei:location/tei:geo elements. It can be tweaked to add maps for relationships as well (For a working example see: http://syriaca.org/persons/browse.html?view=map)

<li><a href="browse.html?view=map">Map</a></li>

Add paging and sort options.

modules/lib/paging.xqm is the module for displaying page numbers and sort options on the html page. This can be added anywhere on the browse page by adding: <div data-template="app:pageination"/>

You may also add sort options. Currently supported options are:

  • title -> tei:titleStmt/tei:title[1]
  • author -> tei:titleStmt/tei:author[1] or tei:titleStmt/tei:editor[1] if there is no tei:author
  • pubDate -> tei:teiHeader/descendant::tei:imprint[1]/descendant-or-self::tei:date[1]
  • persDate -> /descendant::tei:birth/@syriaca-computed-start or /descendant::tei:death/@syriaca-computed-start

Additional sort options can be added by editing the data:add-sort-options() function in modules/lib/data.xqm.

Sort options should be added to the pagination template using the sort-options paramter:

<div data-template="app:pageination" data-template-sort-options="title,author,pubDate"/>