Skip to content

Instantly share code, notes, and snippets.

View no-reply's full-sized avatar

tamsin woo no-reply

  • UC Santa Barbara Library
  • United States
View GitHub Profile
@no-reply
no-reply / DPLAvalidation.md
Created September 4, 2014 22:31
DPLA Validation Levels

Validation Use Cases

Basic Validation

  • Presence of Required Fields
  • Cardinality of Fields with Max Values
  • Domain & Range Restrictions on Properties
  • Controlled Vocabulary Compliance
require 'spec_helper'
require 'mongoid'
describe 'Mongoid integration' do
before do
class Person
include Mongoid::Document
include ActiveTriples::Identifiable
configure :base_uri => 'http://example.org/mongoid/'
@no-reply
no-reply / errors.txt
Created September 11, 2014 14:46
Akara module_config
In [10]: DplaGeonamesGeocoder().enrich_place(place)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-10-346d292dde39> in <module>()
----> 1 DplaGeonamesGeocoder().enrich_place(place)
/home/tjohnson/src/dpla/ingestion/ENV/lib/python2.7/site-packages/dplaingestion/akamod/geocode.pyc in enrich_place(self, place)
295 hierarchy = self.reverse_geocode_hierarchy(lat, lng, ["PCLI", # Country
296 "ADM1", # State
--> 297 "ADM2"]) # County
@no-reply
no-reply / CHODatastream.rb
Last active August 29, 2015 14:06
Hydra Connect RDF Workshop Walkthrough
# lib/models/datastream.rb
class CHODatastream < ActiveFedora::NtriplesRDFDatastream
property :title, predicate: RDF::DC.title
property :creator, predicate: RDF::DC.creator
property :date, predicate: RDF::DC.date
property :location, predicate: RDF::DC.spatial
end
@no-reply
no-reply / error.py
Created September 16, 2014 15:54
What is this error about?
{ 'sourceResource': { 'DIFFERENT VALUES': { 'CURRENT DICT: ': { u'spatial': [ { u'coordinates': u'39.95233, -75.16379',
u'country': u'United States',
u'county': u'Philadelphia County',
u'name': u'Philadelphia, PA',
u'state': u'Pennsylvania'},
{ u'coordinates': u'37.77493, -122.41942',
u'country': u'United States',
u'county': u'San Francisco County',
u'name': u'San Francisco, CA',
@no-reply
no-reply / error.txt
Created September 16, 2014 16:47
unicode error
Sep 16 09:35:38 akara[8157]: [ERROR] Uncaught exception from 'geocode' ('http://purl.org/la/dp/geocode')
Traceback (most recent call last):
File "/home/tjohnson/src/dpla/ingestion/ENV/lib/python2.7/site-packages/akara/multiprocess_http.py", line 304, in _wsgi_application
result = service.handler(environ, start_response_)
File "/home/tjohnson/src/dpla/ingestion/ENV/lib/python2.7/site-packages/akara/services.py", line 417, in wrapper
result = func(*args, **kwargs)
File "/home/tjohnson/src/dpla/ingestion/ENV/lib/python2.7/site-packages/dplaingestion/akamod/geocode.py", line 63, in geocode
place.enrich_geodata(DplaGeonamesGeocoder())
File "/home/tjohnson/src/dpla/ingestion/ENV/lib/python2.7/site-packages/dplaingestion/akamod/geocode.py", line 526, in enrich_geodata
coded_place = geocoder.enrich_place(self)
@no-reply
no-reply / annotation.ttl
Created September 19, 2014 17:38
Annotation Demo
<http://purl.org/dc/dcmitype/Image> a <http://www.w3.org/2000/01/rdf-schema#Class> .
<http://vocab.getty.edu/aat/300132472> a <http://vocab.getty.edu/ontology#Concept> .
[
a <http://www.w3.org/ns/oa#Annotation>;
<http://www.w3.org/ns/oa#annotatedAt> "2014-09-19T10:33:56-07:00"^^<http://www.w3.org/2001/XMLSchema#dateTime>;
<http://www.w3.org/ns/oa#hasBody> [
a <http://www.w3.org/2011/content#ContentAsText>;
<http://purl.org/dc/elements/1.1/format> "text/plain";
@no-reply
no-reply / proposal.md
Last active August 29, 2015 14:06
Code4Lib 2015 Preconference Proposal: DPLA API Workshop

DPLA API Workshop & Hackfest

'''Half Day'''

Abstract:

@no-reply
no-reply / post.java
Created September 26, 2014 15:20
Marmotta SPARQL Direct Post Queries
/**
* Single endpoint for direct post queries (not yet implemented)
*
* @param request
* @return
*/
@POST
public Response post(@Context HttpServletRequest request) {
//String query = CharStreams.toString(request.getReader());
//TODO: introspect the query to determine the operation type
@no-reply
no-reply / gist:5f81b48faa2f2f1d5df1
Created September 26, 2014 18:55
ansible error
TASK: [postgresql | Make sure our databases exist] ****************************
failed: [webapp1] => (item=dpla_portal) => {"failed": true, "item": "dpla_portal"}
msg: Database query failed: encoding UTF8 does not match locale en_US
DETAIL: The chosen LC_CTYPE setting requires encoding LATIN1.