Last active
August 29, 2015 14:09
-
-
Save grosscol/07222972f833bcabefc9 to your computer and use it in GitHub Desktop.
ActiveFedora9 persisting to Fedora4 beta
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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