Skip to content

Instantly share code, notes, and snippets.

View hcayless's full-sized avatar

Hugh A. Cayless hcayless

View GitHub Profile
@hcayless
hcayless / gist:0c99cb6af2b27239f397ca854e52e677
Created August 17, 2017 14:22
DCLP files with malformed dclp-hybrid idnos
grep -r "<idno type=\"dclp-hybrid\">" . | grep -E "^[^;]+$"
./106/105748.xml: <idno type="dclp-hybrid">P.Herc. 1120</idno>
./106/105749.xml: <idno type="dclp-hybrid">P.Herc. 1125</idno>
./106/105750.xml: <idno type="dclp-hybrid">P.Herc. 1464</idno>
./110/109360.xml: <idno type="dclp-hybrid">P.Herc. 200</idno>
./110/109375.xml: <idno type="dclp-hybrid">P.Herc. 1380</idno>
./113/112705.xml: <idno type="dclp-hybrid">P.Herc. 1491a</idno>
./118/117905.xml: <idno type="dclp-hybrid">P.Herc. 230</idno>
./118/117906.xml: <idno type="dclp-hybrid">P.Herc. 335</idno>
./118/117907.xml: <idno type="dclp-hybrid">P.Herc. 1039</idno>
<witness xml:id="G"><abbr type="siglum">G</abbr> = <title>Codex Gaddianus
pl. 90, 12 inf.</title>
<msDesc>
<msIdentifier>
<settlement>Florence</settlement>
<repository>Biblioteca Medicea Laurenziana</repository>
<idno>plut. 90, 12 inf.</idno>
</msIdentifier>
<msContents>
<p>Contains the twelve eclogues of Francesco Petrarch (ff.
(defn get-filename
"Resolves the filename of the local XML file associated with the given URL."
[url]
(try (if (.contains url "ddbdp/")
(let [identifier (.split (substring-before (substring-after url "http://papyri.info/ddbdp/") "/source") ";")]
(if (= (second identifier) "")
(str filepath "/DDB_EpiDoc_XML/" (first identifier) "/" (first identifier) "."
(.replace (.replace (.replace (.replace (last identifier) "," "-") "/" "_") "%2F" "_") "%2C" "-") ".xml")
(str filepath "/DDB_EpiDoc_XML/" (first identifier) "/" (first identifier) "." (second identifier)
"/" (first identifier) "." (second identifier) "."
INFO: An exception happened during JRuby-Rack startup
no such file to load -- lib/rxsugar/lib/jruby_helper
--- System
jruby 1.7.12 (1.9.3p392) 2014-04-15 643e292 on Java HotSpot(TM) 64-Bit Server VM 1.6.0_45-b06 [linux-amd64]
Time: 2014-05-13 08:50:13 -0400
Server: Apache Tomcat/7.0.16
jruby.home: file:/usr/local/tomcat-sosol/webapps/editor/WEB-INF/lib/jruby-stdlib-complete-1.7.12.jar!/META-INF/jruby.home
--- Context Init Parameters:
public.root = /
@hcayless
hcayless / gist:9911921
Last active August 29, 2015 13:57
EDH example SNAP mapping
@prefix cito: <http://purl.org/spar/cito> .
@prefix cnt: <http://www.w3.org/2011/content> .
@prefix dc: <http://purl.org/dc/terms> .
@prefix lawd: <http://lawd.info/ontology> .
<http://edh-www.adw.uni-heidelberg.de/resources/people/HD000001/1>
a lawd:Person ;
dc:publisher <http://edh-www.adw.uni-heidelberg.de> ;
lawd:hasName <http://edh-www.adw.uni-heidelberg.de/resources/people/HD000001/1#name> ;
lawd:hasAttestation <http://edh-www.adw.uni-heidelberg.de/resources/people/HD000001/1#attestation> .
@hcayless
hcayless / gist:9888394
Created March 31, 2014 09:10
example SNAP assertion
# Input Persons:
<http://www.trismegistos.org/person/412#this>
a lawd:Person ;
dc:publisher <http://www.trismegistos.org> ;
lawd:hasName <http://www.trismegistos.org/name/1#this> ;
lawd:hasAttestation <http://www.trismegistos.org/ref/1661#this> .
<http://data.snapdrgn.net/person/1231>
a lawd:Person ;
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix cito: <http://purl.org/spar/cito/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lawd: <http://lawd.info/ontology/> .
@prefix rels: <http://snapdrgn.org/relationships/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://www.trismegistos.org/name/1303#this>
lawd:attestation <http://www.trismegistos.org/ref/30558#name> ;
lawd:primaryExpression "Tasemis"@grc-latn, "Τασῆμις"@grc ;
@hcayless
hcayless / gist:9120829
Created February 20, 2014 19:03
RDF example for encoding TM data
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:cito="http://purl.org/spar/cito/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:lawd="http://lawd.info/ontology/"
xmlns:rels="http://snapdrgn.org/relationships/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<!-- Assumes:
the LAWD ontology defines the following types: Person, PersonalName,
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
xmlns:cito="http://purl.org/spar/cito/"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:lawd="http://lawd.info/ontology/"
xmlns:gawd="http://gawd.atlantides.org/terms/"
xmlns:lr="http://lawd.info/ontology/relationships/"
xmlns:s="http://lawd.info/snap"
xmlns:oa="http://www.openannotation.org/ns/"
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix cito: <http://purl.org/spar/cito/> .
@prefix dc: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lawd: <http://lawd.info/ontology/> .
@prefix gawd: <http://gawd.atlantides.org/terms/> .
@prefix lr: <http://lawd.info/ontology/relationships/> .
@prefix s: <http://lawd.info/snap> .
@prefix oa: <http://www.openannotation.org/ns/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .