This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
prefix cwrc: <http://sparql.cwrc.ca/ontologies/cwrc#> | |
prefix dcterms: <http://purl.org/dc/terms/> | |
prefix lawd: <http://lawd.info/ontology/> | |
prefix person: <https://www.w3.org/ns/person> | |
prefix skos: <http://www.w3.org/2004/02/skos/core#> | |
prefix snap: <http://data.snapdrgn.net/ontology/snap#> | |
prefix syriaca: <http://syriaca.org/schema#> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
prefix lawd: <http://lawd.info/ontology/> | |
prefix skos: <http://www.w3.org/2004/02/skos/core#> | |
prefix dcterms: <http://purl.org/dc/terms/> | |
SELECT ?source ( count(?source) as ?sourceCount ) | |
WHERE { | |
?s dcterms:source ?source; | |
dcterms:isPartOf <http://syriaca.org/spear>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
prefix lawd: <http://lawd.info/ontology/> | |
prefix skos: <http://www.w3.org/2004/02/skos/core#> | |
prefix dcterms: <http://purl.org/dc/terms/> | |
SELECT ?uri (SAMPLE(?l) AS ?label) (SAMPLE(?uriSubject) AS ?subjects) (SAMPLE(?uriCitations) AS ?citations) | |
{ | |
?uri rdfs:label ?l | |
FILTER (?uri IN ( <http://syriaca.org/person/782>,<http://syriaca.org/person/552>,<http://syriaca.org/person/684>,<http://syriaca.org/person/492>)). | |
FILTER ( langMatches(lang(?l), 'en')). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.1"; | |
(:~ | |
: Webhook endpoint for tcadrt.com data repository, /master/ branch: | |
: XQuery endpoint to respond to Github webhook requests. Query responds only to push requests from the master branch. | |
: The EXPath Crypto library supplies the HMAC-SHA1 algorithm for matching Github secret. | |
: | |
: Secret can be stored as environmental variable. | |
: Will need to be run with administrative privileges, suggest creating a git user with privileges only to relevant app. | |
: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* eXist Open Source Native XML Database | |
* Copyright (C) 2001-2015 The eXist Project | |
* http://exist-db.org | |
* | |
* This program is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Lesser General Public License | |
* as published by the Free Software Foundation; either version 2 | |
* of the License, or (at your option) any later version. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.1"; | |
declare function local:strip-diacritics($string as xs:string) as xs:string { | |
let $normalized := normalize-unicode($string, 'NFD') | |
let $stripped := replace($normalized, '\p{M}', '') | |
return | |
$stripped | |
}; | |
declare function local:inspect-diacritics($string as xs:string) as element() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.0"; | |
(:~ | |
: Partial facet implementation for eXist-db based on the EXPath specifications (http://expath.org/spec/facet) | |
: | |
: Uses the following eXist-db specific functions: | |
: util:eval | |
: request:get-parameter | |
: request:get-parameter-names() | |
: | |
: @author Winona Salesky |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let $list := ("http://syriaca.org/person/1631", "http://syriaca.org/person/1442") | |
for $item in $list | |
let $uri := $item | |
return | |
for $idno in fn:collection('/db/apps/srophe-data/data/persons/tei')//tei:person[tei:idno[. = $uri]] | |
let $name := $idno/tei:persName[@xml:lang="en"][contains(@syriaca-tags,"#syriaca-headword")] | |
let $newName := | |
<persName xmlns="http://www.tei-c.org/ns/1.0" xml:id="{concat('name',substring-after($idno,'/person/'),'-a')}" | |
xml:lang="en" syriaca-tags="#syriaca-headword">Anonymi {substring-after($idno,'/person/')}</persName> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.0"; | |
declare namespace tei = "http://www.tei-c.org/ns/1.0"; | |
declare function local:download-xml($node, $filename) { | |
response:set-header("Content-Disposition", concat("attachment; | |
filename=", $filename)) | |
, | |
response:stream( | |
$node, | |
'indent=yes' (: serialization :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.0"; | |
import module namespace functx="http://www.functx.com"; | |
declare namespace tei = "http://www.tei-c.org/ns/1.0"; | |
declare function local:parse-name($name){ | |
if($name/child::*) then | |
string-join(for $part in $name/child::* | |
order by $part/@sort ascending, string-join($part/descendant-or-self::text(),' ') descending | |
return $part/text(),' ') | |
else $name/text() |