├── resources ├── css │ └── style.css └── images │ ├── body.gif │ ├── bold.gif │ ├── code.gif │ ├── nav.gif │ ├── bgmenu.gif │ ├── existdb.png │ ├── header.gif │ ├── italic.gif │ ├── bgmenuhi.gif │ ├── body-base.gif │ ├── horizontal.gif │ ├── delete-icon.png │ ├── grey-box-bot.gif │ ├── grey-box-rpt.gif │ ├── grey-box-top.gif │ ├── nav-dropdown.gif │ ├── nav-dropdown.png │ ├── page-edit-icon.png │ └── glyphicons-halflings.png ├── expath-pkg.xml ├── README.md ├── error-page.html ├── repo.xml ├── modules ├── run-util.xql ├── git-sync.xql ├── works-add-bibl-ana.xql ├── app.xql ├── view.xql ├── config.xqm ├── works-notes-fix.xql ├── works-add-relationships.xql ├── trigger.xql └── srophe-util-name.xqm ├── post-install.xql ├── pre-install.xql ├── TEI-Conversion.xml ├── controller.xql ├── index.html ├── templates └── page.html ├── collection.xconf ├── BYU-Oxford Corpus Header.xml ├── 404.xml └── data └── tei ├── 279.xml ├── 170.xml ├── 175.xml ├── 422.xml ├── 156.xml ├── 180.xml ├── 222.xml ├── 24.xml ├── 412.xml ├── 496.xml ├── 177.xml ├── 153.xml ├── 183.xml ├── 173.xml ├── 178.xml ├── 494.xml ├── 491.xml ├── 164.xml └── 179.xml /resources/css/style.css: -------------------------------------------------------------------------------- 1 | /* Application styles could go here */ 2 | -------------------------------------------------------------------------------- /resources/images/body.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/body.gif -------------------------------------------------------------------------------- /resources/images/bold.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/bold.gif -------------------------------------------------------------------------------- /resources/images/code.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/code.gif -------------------------------------------------------------------------------- /resources/images/nav.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/nav.gif -------------------------------------------------------------------------------- /resources/images/bgmenu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/bgmenu.gif -------------------------------------------------------------------------------- /resources/images/existdb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/existdb.png -------------------------------------------------------------------------------- /resources/images/header.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/header.gif -------------------------------------------------------------------------------- /resources/images/italic.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/italic.gif -------------------------------------------------------------------------------- /resources/images/bgmenuhi.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/bgmenuhi.gif -------------------------------------------------------------------------------- /resources/images/body-base.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/body-base.gif -------------------------------------------------------------------------------- /resources/images/horizontal.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/horizontal.gif -------------------------------------------------------------------------------- /resources/images/delete-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/delete-icon.png -------------------------------------------------------------------------------- /resources/images/grey-box-bot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/grey-box-bot.gif -------------------------------------------------------------------------------- /resources/images/grey-box-rpt.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/grey-box-rpt.gif -------------------------------------------------------------------------------- /resources/images/grey-box-top.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/grey-box-top.gif -------------------------------------------------------------------------------- /resources/images/nav-dropdown.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/nav-dropdown.gif -------------------------------------------------------------------------------- /resources/images/nav-dropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/nav-dropdown.png -------------------------------------------------------------------------------- /resources/images/page-edit-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/page-edit-icon.png -------------------------------------------------------------------------------- /resources/images/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srophe/syriac-corpus/HEAD/resources/images/glyphicons-halflings.png -------------------------------------------------------------------------------- /expath-pkg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | The Oxford-BYU Syriac Corpus project Data 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This is the development repository for The Oxford-BYU Syriac Corpus project. All files licensed under the Creative Commons Attribution 4.0 International Public License (https://creativecommons.org/licenses/by/4.0/). 2 | The Oxford-BYU Syriac Corpus is a joint project of the University of Oxford and Brigham Young University in collaboration with Vanderbilt University and the Initiative for Digital Humanities, Media, and Culture at Texas A&M University. 3 | -------------------------------------------------------------------------------- /error-page.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

An error has occurred

4 |

An error has been generated by the application.

5 |
6 |     
9 | 
-------------------------------------------------------------------------------- /repo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | TEI data used by The Oxford-BYU Syriac Corpus project 4 | 5 | http://syriac-corpus.org/ 6 | alpha 7 | GNU-LGPL 8 | true 9 | application 10 | syriac-corpus-data 11 | pre-install.xql 12 | 13 | 2015-04-23T13:17:07.65-04:00 14 | -------------------------------------------------------------------------------- /modules/run-util.xql: -------------------------------------------------------------------------------- 1 | xquery version "3.0"; 2 | 3 | module namespace trigger='http://exist-db.org/xquery/trigger'; 4 | import module namespace sutil="http://srophe.org/ns/srophe-util" at "srophe-util-date.xqm"; 5 | import module namespace sutil="http://srophe.org/ns/srophe-util" at "srophe-util-name.xqm"; 6 | declare namespace tei="http://www.tei-c.org/ns/1.0"; 7 | declare namespace request="http://exist-db.org/xquery/request"; 8 | 9 | 10 | declare function trigger:after-create-document($uri as xs:anyURI){ 11 | xmldb:login('/db/apps/srophe/', 'admin', '', true()) 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /post-install.xql: -------------------------------------------------------------------------------- 1 | xquery version "3.0"; 2 | 3 | import module namespace xdb="http://exist-db.org/xquery/xmldb"; 4 | 5 | import module namespace xrest="http://exquery.org/ns/restxq/exist" at "java:org.exist.extensions.exquery.restxq.impl.xquery.exist.ExistRestXqModule"; 6 | 7 | (: The following external variables are set by the repo:deploy function :) 8 | 9 | (: file path pointing to the exist installation directory :) 10 | declare variable $home external; 11 | (: path to the directory containing the unpacked .xar package :) 12 | declare variable $dir external; 13 | (: the target collection into which the app is deployed :) 14 | declare variable $target external; 15 | 16 | ( 17 | (: Set UID for git-sync. :) 18 | sm:chmod(xs:anyURI(xs:anyURI($target || '/modules/git-sync.xql'), "rwsr-xr-x") 19 | ) -------------------------------------------------------------------------------- /modules/git-sync.xql: -------------------------------------------------------------------------------- 1 | xquery version "3.1"; 2 | 3 | (:~ 4 | : Webhook endpoint for Srophe Web Application 5 | : XQuery endpoint to respond to Github webhook requests. 6 | : 7 | : Requirements 8 | : - githubxq library : http://exist-db.org/lib/githubxq 9 | : - EXPath Crypto library : http://expath.org/spec/crypto 10 | : - eXist-db 3.0 or greater 11 | : - Must be run with elevated privileges: sm:chmod(xs:anyURI('/db/apps/srophe/modules/git-sync.xql'), "rwsr-xr-x") 12 | : 13 | : @author Winona Salesky 14 | : @version 2.0 15 | :) 16 | 17 | import module namespace githubxq="http://exist-db.org/lib/githubxq"; 18 | 19 | let $data := request:get-data() 20 | return 21 | githubxq:execute-webhook($data, 22 | 'PATH-TO-YOUR-EXISTDB-REPOSITORY', 23 | 'PATH-TO-YOUT-GITHUB-REPOSITORY', 24 | 'OPTIONAL-BRANCH-NAME', 25 | 'YOUR-SECRET-KEYE', 26 | 'OPTIONAL-RATE-LIMIT-KEY') -------------------------------------------------------------------------------- /modules/works-add-bibl-ana.xql: -------------------------------------------------------------------------------- 1 | xquery version "3.0"; 2 | declare namespace tei = "http://www.tei-c.org/ns/1.0"; 3 | 4 | declare function local:render($node) { 5 | typeswitch($node) 6 | case text() return $node 7 | case element(tei:bibl) return 8 | element { QName(namespace-uri($node), local-name($node)) } 9 | { $node/@*, attribute ana {'partialTranslation'}, local:recurse($node) } 10 | case element(tei:author) return 11 | element { QName(namespace-uri($node), local-name($node)) } 12 | { $node/@*, replace($node/text(),'\(partielle\)','') } 13 | default return $node 14 | }; 15 | 16 | declare function local:recurse($node) { 17 | for $child in $node/node() 18 | return 19 | local:render($child) 20 | }; 21 | 22 | for $work in collection('/db/apps/srophe-data/data/works')//tei:bibl[tei:author[contains(.,'(partielle)')]] 23 | return update replace $work with local:render($work) -------------------------------------------------------------------------------- /modules/app.xql: -------------------------------------------------------------------------------- 1 | xquery version "3.0"; 2 | 3 | module namespace app="http://syriaca.org/srophe-data/templates"; 4 | 5 | import module namespace templates="http://exist-db.org/xquery/templates" ; 6 | import module namespace config="http://syriaca.org/srophe-data/config" at "config.xqm"; 7 | 8 | (:~ 9 | : This is a sample templating function. It will be called by the templating module if 10 | : it encounters an HTML element with an attribute: data-template="app:test" or class="app:test" (deprecated). 11 | : The function has to take 2 default parameters. Additional parameters are automatically mapped to 12 | : any matching request or function parameter. 13 | : 14 | : @param $node the HTML node with the attribute which triggered this call 15 | : @param $model a map containing arbitrary data - used to pass information between template calls 16 | :) 17 | declare function app:test($node as node(), $model as map(*)) { 18 |

Dummy template output generated by function app:test at {current-dateTime()}. The templating 19 | function was triggered by the data-template attribute data-template="app:test".

20 | }; -------------------------------------------------------------------------------- /pre-install.xql: -------------------------------------------------------------------------------- 1 | xquery version "1.0"; 2 | 3 | import module namespace xdb="http://exist-db.org/xquery/xmldb"; 4 | 5 | (: The following external variables are set by the repo:deploy function :) 6 | 7 | (: file path pointing to the exist installation directory :) 8 | declare variable $home external; 9 | (: path to the directory containing the unpacked .xar package :) 10 | declare variable $dir external; 11 | (: the target collection into which the app is deployed :) 12 | declare variable $target external; 13 | 14 | declare function local:mkcol-recursive($collection, $components) { 15 | if (exists($components)) then 16 | let $newColl := concat($collection, "/", $components[1]) 17 | return ( 18 | xdb:create-collection($collection, $components[1]), 19 | local:mkcol-recursive($newColl, subsequence($components, 2)) 20 | ) 21 | else 22 | () 23 | }; 24 | 25 | (: Helper function to recursively create a collection hierarchy. :) 26 | declare function local:mkcol($collection, $path) { 27 | local:mkcol-recursive($collection, tokenize($path, "/")) 28 | }; 29 | 30 | (: store the collection configuration :) 31 | local:mkcol("/db/system/config", $target), 32 | xdb:store-files-from-pattern(concat("/system/config", $target), $dir, "*.xconf") -------------------------------------------------------------------------------- /TEI-Conversion.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | html5 13 | about:legacy-compat 14 | 15 | 1 16 | lang 17 | 18 | 19 | 20 | 21 | 22 | 23 | 35 | -------------------------------------------------------------------------------- /modules/view.xql: -------------------------------------------------------------------------------- 1 | (:~ 2 | : This is the main XQuery which will (by default) be called by controller.xql 3 | : to process any URI ending with ".html". It receives the HTML from 4 | : the controller and passes it to the templating system. 5 | :) 6 | xquery version "3.0"; 7 | 8 | import module namespace templates="http://exist-db.org/xquery/templates" ; 9 | 10 | (: 11 | : The following modules provide functions which will be called by the 12 | : templating. 13 | :) 14 | import module namespace config="http://syriaca.org/srophe-data/config" at "config.xqm"; 15 | import module namespace app="http://syriaca.org/srophe-data/templates" at "app.xql"; 16 | 17 | declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization"; 18 | 19 | declare option output:method "html5"; 20 | declare option output:media-type "text/html"; 21 | 22 | let $config := map { 23 | $templates:CONFIG_APP_ROOT := $config:app-root, 24 | $templates:CONFIG_STOP_ON_ERROR := true() 25 | } 26 | (: 27 | : We have to provide a lookup function to templates:apply to help it 28 | : find functions in the imported application modules. The templates 29 | : module cannot see the application modules, but the inline function 30 | : below does see them. 31 | :) 32 | let $lookup := function($functionName as xs:string, $arity as xs:int) { 33 | try { 34 | function-lookup(xs:QName($functionName), $arity) 35 | } catch * { 36 | () 37 | } 38 | } 39 | (: 40 | : The HTML is passed in the request from the controller. 41 | : Run it through the templating system and return the result. 42 | :) 43 | let $content := request:get-data() 44 | return 45 | templates:apply($content, $lookup, (), $config) -------------------------------------------------------------------------------- /controller.xql: -------------------------------------------------------------------------------- 1 | xquery version "3.0"; 2 | 3 | declare variable $exist:path external; 4 | declare variable $exist:resource external; 5 | declare variable $exist:controller external; 6 | declare variable $exist:prefix external; 7 | declare variable $exist:root external; 8 | 9 | if ($exist:path eq '') then 10 | 11 | 12 | 13 | 14 | else if ($exist:path eq "/") then 15 | (: forward root path to index.xql :) 16 | 17 | 18 | 19 | else if (ends-with($exist:resource, ".html")) then 20 | (: the html page is run through view.xql to expand templates :) 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | (: Resource paths starting with $shared are loaded from the shared-resources app :) 31 | else if (contains($exist:path, "/$shared/")) then 32 | 33 | 34 | 35 | 36 | 37 | else 38 | (: everything else is passed through :) 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |

Generated page

5 |
6 |

This is the TEI data repository for Syriaca.org.

7 |

This repository includes TEI data for Syriaca.org. Data uses a modified TEI schema, found here: http://syriaca.org/documentation/syriaca-tei-main.rnc

8 |

This is an informational page only. To interact with this TEI data please install the 9 | Sryiaca.org eXist app [https://github.com/srophe/srophe-eXist-app] or get started coding your own application. 10 |

11 |

To add your own template functions, start by editing the XQuery module 12 | app.xql.

13 |

Data Uses/Reuse Statement

14 |

TBA

15 |
16 |
17 |
18 |

The page template uses the Bootstrap 19 | CSS library for the page layout.

20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |

Application Info

28 |
29 |
30 |
-------------------------------------------------------------------------------- /templates/page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | App Title 5 | 6 | 7 | 8 | 9 | 10 |