Skip to content

Instantly share code, notes, and snippets.

Avatar
🎠
black pony

Mathias mathias-goebel

🎠
black pony
View GitHub Profile
View register.html
<!--
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 Aug 29, 2015
sort zones with xslt
View final.xsl
<?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" />
View selected XQuery snippets
several useful XQuery snippets, mainly used with eXist-db
@mathias-goebel
mathias-goebel / list.html
Last active Aug 29, 2015
Queries on "TextGrid Digitale Bibliothek"
View list.html
<!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>
View WikipediaCategory2KML.xql
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 Mar 8, 2016
sunburst tree for TEI data
View TEI-JSON.xq
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/*) )
View MainArtists.xq
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
TEI:lb and other empty elements in XQuery
View lb-handling.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
TextGrid Agg Names
View query.xq
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 Oct 7, 2016
Store nodes in the TextGrid Repository
View TextGrid-CRUD.xq
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 :)