Skip to content

Instantly share code, notes, and snippets.

@langsdlc
langsdlc / entities-ead.xqy
Last active August 18, 2017 16:10 — forked from CliffordAnderson/entities-ead.xqy
Entity Extraction with Rosette
xquery version "3.1";
declare namespace ead = "urn:isbn:1-931666-22-9";
declare namespace http = "http://expath.org/ns/http-client";
let $texts := fn:doc("https://raw.githubusercontent.com/HeardLibrary/finding-aids/master/rosenzweig.xml")//ead:item/text()
for $text in $texts
let $json := map {
"content" : fn:normalize-space($text),
"genre" : "social-media"
{
"features" : [
{
"attributes" : {
"FID" : 0,
"Id" : 0
},
"geometry" : {
"paths" : [
[