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"; | |
<cities>{ | |
let $names := | |
"Adelaide | |
Adelaide | |
Adelaide and Windsor | |
Adelaide Station | |
Agangarrive Hill | |
Aghadovey | |
Aghadowey |
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"; | |
(:~ | |
: A facet library module | |
: | |
: Builds facets from nodes passed by search or browse modules. | |
: Uses group by | |
: Built for use with eXistdb, if using with eXistdb be sure to define your range | |
: indexes in your collectio.xconf file for best performance. | |
: | |
: @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
# Load libraries | |
library(ggplot2) | |
library(Quandl) | |
# Load datasets from Quandl | |
USA <- Quandl("WORLDBANK/USA_NY_GDP_MKTP_KD_ZG", authcode="[TOKEN") | |
China <- Quandl("WORLDBANK/CHN_NY_GDP_MKTP_KD_ZG", authcode="[TOKEN") | |
# Merge datasets into single table | |
Comp <- China |
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 ruby | |
require 'bundler/setup' | |
require 'lbp' | |
puts "welcome to the scta index loader" | |
puts "i'm going to help you load git repos into the existdb database" | |
local_load_dir = "/Volumes/db-1/apps/scta/" | |
remote_load_dir = "/Volumes/db/apps/scta/" | |
use_load_dir = remote_load_dir |
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-ml"; | |
import module namespace search="http://marklogic.com/appservices/search" | |
at "/MarkLogic/appservices/search/search.xqy"; | |
declare namespace kml = "http://www.opengis.net/kml/2.2"; | |
(:White to red color scale in BBGGRR format :) | |
declare variable $COLOR_SCALE := |
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
<target name="xar-build-upload" > | |
<buildnumber file="build.version"/> | |
<property name="project.version" value="${version.major}.${build.number}"/> | |
<property name="xar-location" value="${dir.project}/${dir.build}/${project.abbrev}-${project.version}.xar"/> | |
<property name="repo.url" value="http://${host.local}:8080/exist/apps/public-repo/public/"/> | |
<property name="repo.update" value="http://${host.local}:8080/exist/apps/public-repo/modules/update.xql"/> | |
<property name="xar-file" value="${project.abbrev}-${project.version}.xar"/> | |
<echo>project.version: ${project.version}</echo> | |
<antcall target="deployment-folder"/> |
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
module namespace page = 'http://library.vanderbilt.edu/dpla'; | |
(: Just a quick example of searching the DPLA API | |
and returning a simple webpage. :) | |
declare | |
%rest:path("dpla/{$search}") | |
%rest:query-param("key", "{$key}") | |
%output:method("html") | |
function page:html($search as xs:string, $key as xs:string) |
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
module namespace tei2="http://exist-db.org/xquery/app/tei2html"; | |
import module namespace console="http://exist-db.org/xquery/console"; | |
declare namespace tei="http://www.tei-c.org/ns/1.0"; | |
declare function tei2:tei2html($nodes as node()*) { | |
for $node in $nodes | |
return | |
typeswitch ($node) | |
case text() return |
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
declare function local:milliseconds-since-epoch($dateTime as xs:dateTime) as xs:integer | |
{ | |
let $epoch := xs:dateTime("1970-01-01T00:00:00Z") | |
let $duration := xs:duration($dateTime - $epoch) | |
let $days := fn:days-from-duration($duration) * 8.64e+7 | |
let $hours := fn:hours-from-duration($duration) * 3.6e+6 | |
let $minutes := fn:minutes-from-duration($duration) * 60000 | |
let $seconds := fn:seconds-from-duration($duration) * 1000 | |
return xs:integer($days + $hours + $minutes + $seconds) | |
}; |
OlderNewer