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
(: Looking for Antony's longest speech in "Julius Caesar." Is there a better path? :) | |
//ab[parent::sp/speaker[w="ANTONY"]][count(.//w) eq max(//ab[parent::sp/speaker[w="ANTONY"]]/count(.//w))] | |
================================ | |
declare default element namespace "http://www.tei-c.org/ns/1.0"; | |
<speech>{ | |
for $sp in //sp | |
let $speaker := $sp/speaker |
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
(: Group all actors by Act and Scene :) | |
(: XQuery solution :) | |
declare namespace tei="http://www.tei-c.org/ns/1.0"; | |
<results>{ | |
for $actors in //tei:stage/@who | |
for $actor in $actors ! tokenize(., ' ') | |
group by $actor |
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
(: See http://stackoverflow.com/questions/17975306/aligning-fields-based-on-position-using-xslt :) | |
(: XML input :) | |
(: | |
<?xml version="1.0" encoding="UTF-8"?> | |
<collections> | |
<collection name="anyCollection"> | |
<record> | |
<field name="materia">comida; bebida; fiesta</field> |
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
<?xml-stylesheet type="text/xsl" href="http://localhost:8080/exist/apps/xsltforms/xsltforms.xsl"?><?css-conversion no?><?xsltforms-options debug="yes"?><?xml-model href="http://www.oxygenxml.com/1999/xhtml/xhtml-xforms.nvdl" schematypens="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"?> | |
<html | |
xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:bf="http://bibframe.org/vocab/" | |
xmlns:cwb="http://libserv6.princeton.edu/cwb/" | |
xmlns:ev="http://www.w3.org/2001/xml-events" | |
xmlns:xf="http://www.w3.org/2002/xforms" | |
xmlns:xs="http://www.w3.org/2001/XMLSchema"> | |
<head> | |
<meta |
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
<?xml-stylesheet href="../build/xsltforms.xsl" type="text/xsl"?><?xsltforms-options debug="no"?><?css-conversion no?><?xml-model href="http://www.oxygenxml.com/1999/xhtml/xhtml-xforms.nvdl" schematypens="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"?> | |
<html | |
xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:cwb="http://example.org/cwb/" | |
xmlns:ev="http://www.w3.org/2001/xml-events" | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" | |
xmlns:xf="http://www.w3.org/2002/xforms" | |
xmlns:xi="http://www.w3.org/2001/XInclude" | |
xmlns:xs="http://www.w3.org/2001/XMLSchema" |
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
<?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?><?xsltforms-options debug="no"?><?css-conversion no?><?xml-model href="http://www.oxygenxml.com/1999/xhtml/xhtml-xforms.nvdl" schematypens="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"?> | |
<html | |
xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:cwb="http://example.org/cwb/" | |
xmlns:ev="http://www.w3.org/2001/xml-events" | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" | |
xmlns:xf="http://www.w3.org/2002/xforms" | |
xmlns:xi="http://www.w3.org/2001/XInclude" | |
xmlns:xs="http://www.w3.org/2001/XMLSchema" |
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 "1.0" encoding "UTF-8"; | |
(: This file was generated on Sat Feb 13, 2016 20:32 (UTC-05) by REx v5.35 which is Copyright (c) 1979-2015 by Gunther Rademacher <[email protected]> :) | |
(: REx command line: turtle.ebnf -faster -xquery -tree :) | |
(:~ | |
: The parser that was generated for the turtle grammar. | |
:) | |
module namespace p="turtle"; | |
declare default function namespace "http://www.w3.org/2005/xpath-functions"; |
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
(:~ | |
: Anonymous inline function with asynchronous evaluation in BaseX 8.4.1 beta | |
: | |
: @param $query Asynchronously evaluated query | |
: @return XQuery expression, followed by result of async HTTP request. | |
: | |
: BaseX Async Module: | |
: http://docs.basex.org/wiki/Async_Module | |
: | |
: Dimitre Novatchev on recursion with anonymous inline functions in XPath 3.0: |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<turtleDoc> | |
<statement> | |
<directive> | |
<prefixID> | |
<TOKEN>@prefix</TOKEN> | |
<PNAME_NS>bf:</PNAME_NS> | |
<IRIREF><http://bibframe.org/vocab/></IRIREF> | |
<TOKEN>.</TOKEN> | |
</prefixID> |
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
#!/usr/bin/env python | |
# | |
# pymarc_disco.py - Mark Matienzo | |
# sample MapReduce tasks for Disco to get tag counts from MARC files/streams | |
# usage: python pymarc_disco.py <input1> [input2 ... inputN] | |
import sys | |
from disco.core import Disco, result_iterator | |
from disco.settings import DiscoSettings | |
import pymarc |
OlderNewer