Skip to content

Instantly share code, notes, and snippets.

View jcoyne's full-sized avatar

Justin Coyne jcoyne

  • Stanford University Libraries
  • Minneapolis, MN
View GitHub Profile
select DISTINCT ?t where {?s a ?t }
"address_name": [{
"names": {
"count": 2,
"name": [{
"seq_no": 1,
"role": "author",
"full_name": "Wilson, Jennifer L.",
"reprint": "Y",
"addr_no": 1,
"last_name": "Wilson",
@jcoyne
jcoyne / query.sparql
Created August 3, 2018 21:48
Query for authors/editors
PREFIX vivo: <http://vivoweb.org/ontology/core#>
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
SELECT ?y ?z
WHERE {
<http://example.com/book1> ?p ?o .
?o vivo:relates ?v .
?o rdf:type ?z .
?v vcard:hasName ?t .
?t vcard:value ?y .
@jcoyne
jcoyne / update.sparql
Created August 3, 2018 21:28
Rialto Sparql update sample
PREFIX bibo: <http://purl.org/ontology/bibo/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX vivo: <http://vivoweb.org/ontology/core#>
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
INSERT DATA
{
<http://example.com/book1> a bibo:Document;
dct:Title "My Book";
vivo:relatedBy <http://example.com/authorship1>, <http://example.com/editorship1> .
@jcoyne
jcoyne / curl trouble.txt
Created June 8, 2018 19:01
Problem trying to build the curb gem.
$ ssh etd@sul-hydra-etd-uat
The authenticity of host 'sul-hydra-etd-uat (171.67.23.97)' can't be established.
RSA key fingerprint is SHA256:3tNHvrnni9Gh7pBtjtRT27N2oh7sil8JnEYpzdRLSMw.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'sul-hydra-etd-uat' (RSA) to the list of known hosts.
Last login: Thu May 17 15:47:39 2018 from dn2lk5ea6.stanford.edu
[etd@sul-hydra-etd-uat ~]$ gem install curb -v '0.9.6'
Fetching: curb-0.9.6.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing curb:
@jcoyne
jcoyne / autoupdate.sh
Last active September 11, 2018 23:25
A script to submit dependency update pull requests for infrastructure projects
#!/bin/bash
cd $TMPDIR
mkdir -p $TMPDIR/.autoupdate
cd $TMPDIR/.autoupdate
listOfProjects="argo
assembly
common-accessioning
dor-services-app
dor_indexing_app
@jcoyne
jcoyne / test.txt
Created May 29, 2018 19:28
Vitro test failures
mvn test
...
Results :
Failed tests: configFilePathCantBeTranslated(edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.ObjectPropertyTemplateModel_PropertyListConfigTest): no real path(..)
Tests run: 1142, Failures: 1, Errors: 0, Skipped: 28
@jcoyne
jcoyne / test.txt
Created May 29, 2018 19:28
Vitro test failures
Results :
Failed tests: configFilePathCantBeTranslated(edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.ObjectPropertyTemplateModel_PropertyListConfigTest): no real path(..)
Tests run: 1142, Failures: 1, Errors: 0, Skipped: 28
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
@jcoyne
jcoyne / request1.json
Created April 13, 2018 21:24
Taco Script 4
{
"$comment": "This is a fixture used for testing. It was derived from create-bs646cd8717.json",
"@context": "http://sdr.sul.stanford.edu/contexts/taco-base.jsonld",
"@type": "http://sdr.sul.stanford.edu/models/sdr3-collection.jsonld",
"citation": "Leon Kolb Collection of Portraits. https://purl.stanford.edu/bs646cd8717",
"depositor": {
"name": "DOR",
"sunetID": "DOR"
},
"label": "Leon Kolb Collection of Portraits",
@jcoyne
jcoyne / foo.go
Created April 6, 2018 20:38
Cast version to an integer
// The version is json.Number, but we want it as an integer:
if dataMap["version"] != nil {
i64, err := dataMap["version"].(json.Number).Int64()
if err != nil {
panic(err)
}
dataMap["version"] = int(i64)
}