Skip to content

Instantly share code, notes, and snippets.

View kefo's full-sized avatar

Kevin Ford kefo

View GitHub Profile
@kefo
kefo / kefo-test.pdath
Last active September 16, 2016 13:50
@prefix fedora : <http://fedora.info/definitions/v4/repository#>
@prefix pcdm : <http://pcdm.org/models#>
@prefix ore : <http://www.openarchives.org/ore/terms/>
@prefix iana : <http://www.iana.org/assignments/relation/>
@prefix acl : <http://www.w3.org/ns/auth/acl#>
@prefix dcterms : <http://purl.org/dc/terms/>
id = . :: xsd:string ;
created = fedora:created :: xsd:dateTime ;
#!/bin/bash
# This will fetch mongo and install it within a virtualenv.
rm -fr mongodb
rm bin/mongodb
curl -O https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.2.8.tgz
mkdir -p mongodb
DEBUG 15:52:22.828 (SessionFactory) Returning an authenticated session in the default workspace
TRACE 15:52:22.832 (SessionProvider) Providing new session Session 996731ada to workspace 'default
DEBUG 15:52:22.870 (FedoraBaseResource) setting baseURL = https://localhost/fcrepo/rest/
TRACE 15:52:23.027 (TransactionServiceImpl) Unable to retrieve current transaction ID from session: There is no namespace with prefix "fcrepo4.tx.id"
TRACE 15:52:23.028 (NamespaceConverter) Converting identifier /prod from internal to external...
TRACE 15:52:23.180 (NamespaceConverter) Replacing namespace: http://www.jcp.org/jcr/1.0 with: http://fedora.info/definitions/v4/repository#
TRACE 15:52:23.180 (NamespaceConverter) Converted identifier /prod from internal to external /prod...
TRACE 15:52:23.213 (TransactionServiceImpl) Unable to retrieve current transaction ID from session: There is no namespace with prefix "fcrepo4.tx.id"
TRACE 15:52:23.244 (TransactionServiceImpl) Unable to retrieve current transaction ID from session: T
@kefo
kefo / transitive-closure-with-paths.xqy
Created January 12, 2015 22:38
ML Semantics - transitive closure, with path AND labels.
(:
The bulk of this comes from this gentleman's masterful work found here:
https://github.com/freshie/ml-semantics/blob/master/transitive-closure-with-paths.xqy
I have made it so that the prefLabel (assuming SKOS) comes along with the URI of the node.
This code was taken from the marklogic Semantics functions and was rework in order to have paths shown
:)
xquery version "1.0-ml";
@kefo
kefo / sample-mods-with-xsd.xml
Created October 9, 2014 16:29
Sample MODS with XSD
<?xml version="1.0"?>
<mods:mods version="3.5"
xsi:schemaLocation="http://www.loc.gov/mods/v3 http://3windmills.com/lsc615/xml-edit-validate/xsd/mods-3-5.xsd"
xmlns:mods="http://www.loc.gov/mods/v3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<mods:titleInfo>
<mods:nonSort>The </mods:nonSort>
<mods:title>Atlantic polka</mods:title>
</mods:titleInfo>
<mods:name>
@kefo
kefo / validation-links.html
Last active August 29, 2015 14:07
Validation Notes
@kefo
kefo / sample-marc-with-xsd.xml
Created October 9, 2014 14:56
Sample MARC/XML with XSD
<record
xmlns="http://www.loc.gov/MARC21/slim"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd">
<leader>01147cam a2200265 a 4500</leader>
<controlfield tag="001">15219373</controlfield>
<controlfield tag="005">20090831121301.0</controlfield>
<controlfield tag="008">080314s2008 nyu b 001 0 eng </controlfield>
<datafield tag="010" ind1=" " ind2=" ">
<subfield code="a"> 2008011507</subfield>
@kefo
kefo / parse-PMYK.xqy
Created September 16, 2014 22:02
parse-PMYK.xqy
xquery version "3.0";
(:
to run:
zorba --serialize-html -f -q parse-PYMK.xqy -e pymkhtml:=file:///home/kefo/workspaces/li/litest.html > out.html
:)
(: IMPORTED MODULES :)
import module namespace http = "http://zorba.io/modules/http-client";
import module namespace file = "http://expath.org/ns/file";
@kefo
kefo / test.html
Created July 15, 2014 15:25
zorba outputting variable unexpectedly
<?xml version="1.0" encoding="UTF-8"?>
<div class="row">hollowayemory1885whitmanwalt18191892leavesofgrassengworktext
<div>
<h4>hollowayemory1885whitmanwalt18191892leavesofgrassengworktext (3)</h4>
<div class="panel-group" id="hollowayemory1885whitmanwalt18191892leavesofgrassengworktext">
<div class="panel panel-default">
<div class="panel-heading">
<a data-toggle="collapse" data-parent="#hollowayemory1885whitmanwalt18191892leavesofgrassengworktext" href="#hollowayemory1885whitmanwalt18191892leavesofgrassengworktext-2">5922543</a>
</div>
<div id="hollowayemory1885whitmanwalt18191892leavesofgrassengworktext-2" class="panel-collapse collapse">
@kefo
kefo / marcTxt-2-marcXML.xqy
Last active August 29, 2015 14:02
MARC/TXT to MARC/XML
declare namespace marcxml = "http://www.loc.gov/MARC21/slim";
let $mtexts := ('000 02018nas a2200433Ia 450
001 8277786
005 20140505165744.0
008 140505c198u9999cc uu p 0 e0chi d
035 __ |a (OCoLC)ocn879220545
040 __ |a CSt-H |b eng |c PULEA |d OCLCQ |d PULEA
035 __ |a (OCoLC)879220545
043 __ |a a-cc---