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 core:text-to-lines($text) { | |
let $lines := tokenize($text, '\n') | |
return $lines | |
}; |
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 core:get-filename($uri as xs:string) { | |
fn:tokenize($uri, "/")[last()] | |
}; |
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
<xf:submission id="s2" method="get" replace="instance" targetref="instance('list')"> | |
<xf:resource value="concat('/exist/rest/db/apps/stats21/views/report-view.xquery?t=',substring(string(digest( string( random( true ) ), 'MD5', 'hex' )), 1, 8))"/> | |
</xf:submission> |
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
<xf:select1 ref="instance('policeforce')/selectedforce" selection="closed" > | |
<xf:itemset nodeset="instance('report-transformed')/body//tr[not(td[3] = preceding-sibling::tr/td[3])]"> | |
<xf:label ref="td[3]" /> | |
<xf:value ref="td[3]" /> | |
</xf:itemset> | |
</xf:select1> |
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 option exist:serialize "method=xhtml media-type=text/xml indent=yes process-xsl-pi=no"; | |
let $attribute := request:set-attribute("betterform.filter.ignoreResponseBody", "true") | |
(: look at https://github.com/orbeon/eXist-1.4.x/blob/master/webapp/xforms/tasks/todo-list.xml :) | |
let $form := <html xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:ev="http://www.w3.org/2001/xml-events" | |
xmlns:xforms="http://www.w3.org/2002/xforms" | |
xmlns:xsd="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 "3.0"; | |
declare namespace xhtml="http://www.w3.org/1999/xhtml"; | |
declare function local:get-page($url){ | |
http:send-request(<http:request method='get' headers='false' status-only='false'/>, $url) | |
}; | |
declare function local:get-details($n as node()){ | |
for $h in $n/xhtml:div[@class="hit detailed"] | |
let $title := $h//xhtml:p[@class="summary"] |
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 functx = "http://www.functx.com"; | |
declare function functx:sort | |
( $seq as item()* ) as item()* { | |
for $item in $seq | |
order by $item | |
return $item | |
} ; |
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
import uuid | |
from scrapy.spider import BaseSpider | |
from scrapy.selector import HtmlXPathSelector | |
from scrapy.contrib.spiders import Rule, CrawlSpider | |
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor | |
from SG_2013_10_29.items import Sg20131029Item | |
from pybloom import BloomFilter | |
bloom = BloomFilter(capacity=500000, error_rate=0.000001) |
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 xsd: <http://www.w3.org/2001/XMLSchema#> | |
prefix gol: <http://cofog01.data.scotland.gov.uk/def/golspie/> | |
prefix qb: <http://purl.org/linked-data/cube#> | |
prefix buildingCode: <http://cofog01.data.scotland.gov.uk/id/facility/> | |
prefix fn: <http://www.w3.org/2005/xpath-functions#> | |
prefix util: <http://cofog01.data.scotland.gov.uk/def/golspie/> | |
prefix skos: <http://www.w3.org/2004/02/skos/core#> | |
select ?month (sum(?o) as ?val ) |
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 skos: <http://www.w3.org/2004/02/skos/core#> | |
PREFIX org: <http://www.w3.org/ns/org#> | |
PREFIX v: <http://www.w3.org/2006/vcard/ns#> | |
SELECT * WHERE { | |
SERVICE <http://cofog01.data.scotland.gov.uk/sparql> { | |
select distinct ?fn ?code { | |
graph ?g { |
OlderNewer