Skip to content

Instantly share code, notes, and snippets.

@grosscol
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grosscol/07222972f833bcabefc9 to your computer and use it in GitHub Desktop.
Save grosscol/07222972f833bcabefc9 to your computer and use it in GitHub Desktop.
ActiveFedora9 persisting to Fedora4 beta
# Simple ActiveFedora9 (Fedora4) Example
# Make sure hyda-jetty, using the fedora-4/edge branch, is running (rake jetty:start)
require "active_fedora"
class Dum < ActiveFedora::Base
# The Hydra convention is to minimally have descriptive and rights metadata.
# The Fedora4 paradigm is to define properties directly on the object as opposed to the datastreams of Fedora3
property :title, predicate: ::RDF::DC.title
property :creator, predicate: ::RDF::DC.creator
end
# Check the version of ActiveFedora
ActiveFedora.version # 9.0.0.pre1
# Create new fedora object
d = Dum.new
d.title = "lorem"
d.creator = "ipsum"
# Save to repository
d.save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment