Skip to content

Instantly share code, notes, and snippets.

View mjgiarlo's full-sized avatar
:shipit:
not updating my status

Michael J. Giarlo mjgiarlo

:shipit:
not updating my status
View GitHub Profile
@mjgiarlo
mjgiarlo / gist:11065998
Created April 18, 2014 21:50
F4 backtrace
1) ActiveFedora::Base.add_file_datastream should set the correct mime_type if :mime_type, :mimeType, or :content_type passed in and path d
oes not contain correct extension
Failure/Error: @test_object.save
NoMethodError:
undefined method `graph' for #<Ldp::Resource:0x00000002fc14d8>
# /home/mjg/.rvm/gems/ruby-2.0.0-p353@active-fedora/bundler/gems/ldp-6ea494811a9a/lib/ldp/orm.rb:25:in `block in graph'
# /home/mjg/.rvm/gems/ruby-2.0.0-p353@active-fedora/gems/activesupport-4.1.0/lib/active_support/notifications.rb:161:in `instrument'
# /home/mjg/.rvm/gems/ruby-2.0.0-p353@active-fedora/bundler/gems/ldp-6ea494811a9a/lib/ldp.rb:32:in `instrument'
# /home/mjg/.rvm/gems/ruby-2.0.0-p353@active-fedora/bundler/gems/ldp-6ea494811a9a/lib/ldp/orm.rb:24:in `graph'
# /home/mjg/.rvm/gems/ruby-2.0.0-p353@active-fedora/bundler/gems/ldp-6ea494811a9a/lib/ldp/orm.rb:30:in `value'

I'm not sure of the particulars of how Fedora 4's projection feature works, but conceptually it goes something like this:

  1. Start with a pile of content that is managed outside of Fedora
  2. An admin configures Fedora 4 to become aware of one or more directories on a filesystem to which it has access
  3. Fedora 4 crawls the directory, creating "nodes" within the repository that represent the folders and files it finds
  4. For each file that is found: a persistent, unique identifier is minted; an initial version is created (if configured); a checksum is generated (if configured)
  5. At that point, the directory is still managed outside of Fedora, but it's also accessible by Fedora. If the other system is editing or writing to files in that directory structure, Fedora will need to occasionally be made aware of these changes to regenerate checksums, create new versions, and so forth.

So, Fedora 4 could point at another app's file/folder structure, yes!

@mjgiarlo
mjgiarlo / etd.rb
Last active August 29, 2015 14:02
Modeling for etdflow (untested, draft, YMMV, etc.)
# app/vocabularites/etd.rb
module Etdflow::Vocabularies
class Etd < RDF::StrictVocabulary('http://opaquenamespace.org/etd/0.1/')
property :semester, label: 'Semester of paper submission'
property :year, label: 'Year of paper submission'
property :program, label: 'Disciplinary program'
property :degree, label: 'Degree affiliation'
property :status, label: 'Status of paper submission'
property :dateDefended, label: 'Date of paper defense'
@mjgiarlo
mjgiarlo / Vagrantfile.diff
Created July 16, 2014 21:07
sufia-vagrant changes
diff --git a/Vagrantfile b/Vagrantfile
index 71112db..af3ca3b 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -10,11 +10,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
- config.vm.box = "Ubuntu13Chef"
-

Keybase proof [41/186]

I hereby claim:

  • I am mjgiarlo on github.
  • I am mjgiarlo (https://keybase.io/mjgiarlo) on keybase.
  • I have a public key whose fingerprint is AF89 774A 1521 2E58 64A5 7DC9 E7BD A462 F97F 3A9B

To claim this, I am signing this object:

1) CurationConcern::GenericWorkActor#create valid attributes with a file authenticated visibility should stamp each file with the access r
ights
Failure/Error: expect(subject.create).to be true
NameError:
uninitialized constant EventJob::SufiaHelper
# /home/mjg/.rvm/gems/ruby-2.1.2@worthwhile/bundler/gems/sufia-0b21ef691e87/app/jobs/event_job.rb:6:in `<class:EventJob>'
# /home/mjg/.rvm/gems/ruby-2.1.2@worthwhile/bundler/gems/sufia-0b21ef691e87/app/jobs/event_job.rb:1:in `<top (required)>'
# /home/mjg/.rvm/gems/ruby-2.1.2@worthwhile/bundler/gems/sufia-0b21ef691e87/app/jobs/content_deposit_event_job.rb:1:in `<top (required)
>'
# /home/mjg/.rvm/gems/ruby-2.1.2@worthwhile/bundler/gems/sufia-0b21ef691e87/config/initializers/sufia_events.rb:2:in `block in <top (re
# spec failure
1) CurationConcern::GenericWorkActor#create valid attributes with a file authenticated visibility should stamp each file with t[1970/9118]
ights
Failure/Error: expect(generic_file.filename).to eq 'image.png'
expected: "image.png"
got: [""]
(compared using ==)
@mjgiarlo
mjgiarlo / gist:a15bc935ba26ab6723f2
Created January 2, 2015 03:52
Ldp::UnexpectedContentType on #reindex_everything
irb(main):008:0> ActiveFedora::Base.reindex_everything
Ldp::UnexpectedContentType: The resource http://127.0.0.1:8080/fedora/rest/prod/34/29/60/5c/3429605c-468b-41f4-81b0-ab6c0451b625/content is not an RDFSource
from /opt/druw/vendor/bundle/ruby/2.1.0/gems/ldp-0.2.0/lib/ldp/response.rb:112:in `graph'
from /opt/druw/vendor/bundle/ruby/2.1.0/gems/ldp-0.2.0/lib/ldp/resource/rdf_source.rb:29:in `graph'
from /opt/druw/vendor/bundle/ruby/2.1.0/gems/active-fedora-9.0.0.beta8/lib/active_fedora/indexing.rb:82:in `get_descendent_uris'
from /opt/druw/vendor/bundle/ruby/2.1.0/gems/active-fedora-9.0.0.beta8/lib/active_fedora/indexing.rb:85:in `block in get_descendent_uris'
from /opt/druw/vendor/bundle/ruby/2.1.0/gems/active-fedora-9.0.0.beta8/lib/active_fedora/indexing.rb:84:in `each'
from /opt/druw/vendor/bundle/ruby/2.1.0/gems/active-fedora-9.0.0.beta8/lib/active_fedora/indexing.rb:84:in `get_descendent_uris'
from /opt/druw/vendor/bundle/ruby/2.1.0/gems/active-fedo
Ride the MAX up to Washington Park and check out the rose garden and/or the Japanese garden up there. It's beautiful, peaceful, and only 10ish minutes away from downtown. On a sunny day you can catch glimpses of Mt. Hood! It may even get sunnyish towards Friday and Saturday.
There's also a cool Chinese garden in Chinatown, that I think has a little tea house on its grounds if you're up for some oolong.
If you're there on a Saturday, check out the Saturday market!
Get some local Portland-roasted coffee. Portland is a coffee town. Stumptown is the one I know best, but there are probably a dozen others that are also top-notch.
Get a weird donut at Voodoo donuts! The maple bacon is pretty good.
That's how I'm grokking it at the moment, yeah. So we'd have (all names provisional!):
* one Sufia::Work (a subclass of (Active)Fedora::Object) as the "thing" the user deposits (i.e., one-to-many files with one metadata record)
* containing one Sufia::LeafWork (a subclass of Sufia::Work, or directly of (Active)Fedora::Object) per submitted file
* each of which LeafWork in turn containing (via hasFile) one Sufia::File (a subclass of (Active)Fedora::Object) for the submitted blob and more Sufia::Files (via aggregates) for derivatives, FITS XML, full-text.
Like this:
/objects/work0 - the overarching "work," such as a multi-file ETD deposit (PDF, zipfile)
/objects/work0/members/work1 - the proxy to a "leaf work," wrapping the submitted PDF