Skip to content

Instantly share code, notes, and snippets.

View mathias-goebel's full-sized avatar
🎠
black pony

Mathias mathias-goebel

🎠
black pony
View GitHub Profile
@mathias-goebel
mathias-goebel / register.html
Last active August 29, 2015 14:16
tg-sade-usr-mgmt
<!--
to be placed in /[PROJECTS]/[PROJECT-NAME]/templates/tmpl1/
requires: module and sign-up.html
-->
<div data-template="templates:init">
<div data-template="templates:surround" data-template-with="page_index.html" data-template-at="content-container">
<div data-template="usr:new"/>
</div>
</div>
@mathias-goebel
mathias-goebel / final.xsl
Last active August 29, 2015 14:18
sort zones with xslt
<?xml version="1.0" encoding="UTF-8"?>
<!-- Stylesheet imporved by hriebl! -->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="2.0"
exclude-result-prefixes="xs tei"
xpath-default-namespace="http://www.tei-c.org/ns/1.0">
<xsl:output method="xml" indent="yes" />
@mathias-goebel
mathias-goebel / selected XQuery snippets
Last active August 29, 2015 14:19
selected XQuery snippets
several useful XQuery snippets, mainly used with eXist-db
@mathias-goebel
mathias-goebel / list.html
Last active August 29, 2015 14:22
Queries on "TextGrid Digitale Bibliothek"
<!DOCTYPE html>
<html>
<head>
<title>TG Rep - Publikationsliste</title>
</head>
<body>
<ol>
<li>Bierbaum, Otto Julius  Stilpe. Ein Roman aus der Froschperspektive 
(1865 - 1910)</li>
xquery version "3.0";
import module namespace console="http://exist-db.org/xquery/console" at "java:org.exist.console.xquery.ConsoleModule";
declare namespace rdfs="http://www.w3.org/2000/01/rdf-schema#";
declare namespace ps="http://www.wikidata.org/prop/statement/";
declare namespace wdt="http://www.wikidata.org/prop/direct/";
declare namespace rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
declare option exist:serialize "method=xhtml media-type=application/vnd.google-earth.kml+xml highlight-matches=none";
@mathias-goebel
mathias-goebel / TEI-JSON.xq
Created March 8, 2016 10:59
sunburst tree for TEI data
xquery version "3.0";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare option exist:serialize "method=text media-type=text/plain omit-xml-declaration=yes";
declare function local:recurse($node as node()*) as xs:string* {
for $n in $node
return(
'{' ||
string-join(
('"name": "', $n/local-name(), '"',
if( not($n/*) )
@mathias-goebel
mathias-goebel / MainArtists.xq
Last active March 9, 2016 18:53
DHd2016.XQuery
xquery version "3.0";
let $url := xs:anyURI('https://www.conftool.pro/dhd2016/sessions.php'),
$persist:= false(),
$request-headers := (),
$node as node() := httpclient:get($url, $persist, $request-headers)//httpclient:body/*,
$origList := tokenize(
string-join(
$node//*[contains(@class, 'paper_author')]/
@mathias-goebel
mathias-goebel / lb-handling.xquery
Created May 18, 2016 12:13
TEI:lb and other empty elements in XQuery
xquery version "3.0";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare function local:magic($nodes as node()*) {
(:let $test:= console:log($nodes/local-name()):)
(:return:)
for $node in $nodes return
typeswitch($node)
case element(*)
@mathias-goebel
mathias-goebel / query.xq
Created May 30, 2016 21:08
TextGrid Agg Names
xquery version "3.0";
declare namespace ore="http://www.openarchives.org/ore/terms/";
declare namespace rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
declare namespace tgmd="http://textgrid.info/namespaces/metadata/core/2010";
let $seq:= ("textgrid:jfsm.0",
"textgrid:jg0m.0",
"textgrid:jk7p.0",
"textgrid:jkhw.0",
@mathias-goebel
mathias-goebel / TextGrid-CRUD.xq
Created October 7, 2016 13:23
Store nodes in the TextGrid Repository
xquery version "3.0";
declare namespace tei="http://www.tei-c.org/ns/1.0";
(: TextGrid CRUD
: Store nodes in the TextGrid Repository
: https://textgridlab.org/doc/services/submodules/tg-crud/docs/index.html#create
: :)
(: ESX-2 = productive :)