Skip to content

Instantly share code, notes, and snippets.

# require the moab_versioning gem
require 'moab'
# Load an object to work with (in this case a Fedora object)
object = ActiveFedora::Base.find(your-object-id, {:cast => true})
# Set our version
version = 1
# Set up our MOAB directories
@hellbunnie
hellbunnie / gist:dfca37537a80ec698a4cf9c773e4566a
Last active November 28, 2018 15:01
Open Refine template for exporting tabular data to DRI-ready Dublin Core XML
{{forNonBlank(cells["Identifier"], v, "FILENAME "+v.value, "")}}
<qualifieddc xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:marcrel="http://www.loc.gov/marc.relators/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/marc.relators/ http://imlsdcc2.grainger.illinois.edu/registry/marcrel.xsd" xsi:noNamespaceSchemaLocation="http://dublincore.org/schemas/xmls/qdc/2008/02/11/qualifieddc.xsd">
{{forNonBlank(cells["id"], v, "<dc:identifier>"+v.value+"</dc:identifier>", "")}}
{{forNonBlank(cells["Title"], v, "<dc:title>"+v.value+"</dc:title>", "")}}
{{forNonBlank(cells["Creator"], v, "<dc:creator>"+v.value+"</dc:creator>", "")}}
{{forNonBlank(cells["Date"], v, "<dc:date>"+v.value+"</dc:date>", "")}}
{{forNonBlank(cells["Description"], v, "<dc:description>"+v.value+"</dc:description>", "")}}
{{forNonBlank(cells["Description2"], v, "<dc:description>"+v.value+"</dc:description>", "")}}
{{forNonBlank(cells["Rights"], v, "<dc:rights>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script>
$(function(){
$('#product_modal').on('show.bs.modal', function(e) {
@hellbunnie
hellbunnie / Open Refine Template for Anja
Last active November 20, 2019 14:14
This is the test Open Refine Export template for the first batch of AP data
{{forNonBlank(cells["filename"], v, "FILENAME "+v.value, "")}}
<qualifieddc xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:marcrel="http://www.loc.gov/marc.relators/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/marc.relators/ http://imlsdcc2.grainger.illinois.edu/registry/marcrel.xsd" xsi:noNamespaceSchemaLocation="http://dublincore.org/schemas/xmls/qdc/2008/02/11/qualifieddc.xsd">
{{forNonBlank(cells["identifier"], v, "<dc:identifier>"+v.value+"</dc:identifier>", "")}}
{{forNonBlank(cells["title"], v, "<dc:title>"+v.value+"</dc:title>", "")}}
{{forNonBlank(cells["type01"], v, "<dc:type>"+v.value+"</dc:type>", "")}}
{{forNonBlank(cells["type02"], v, "<dc:type>"+v.value+"</dc:type>", "")}}
{{forNonBlank(cells["description"], v, "<dc:description>"+v.value+"</dc:description>", "")}}
{{forNonBlank(cells["language"], v, "<dc:language>"+v.value+"</dc:language>", "")}}
{{forNonBlank(cells["creator01"], v, "<dc:creator>"+v.v
@hellbunnie
hellbunnie / gist:043851a8d4da99f9739be2a643a620a3
Last active June 4, 2020 10:32
Open Refine export template for use with the DRI Batch Metadata Template
{{forNonBlank(cells["Filename"], v, "FILENAME "+v.value, "")}}
<qualifieddc xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:marcrel="http://www.loc.gov/marc.relators/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/marc.relators/ http://imlsdcc2.grainger.illinois.edu/registry/marcrel.xsd" xsi:noNamespaceSchemaLocation="http://dublincore.org/schemas/xmls/qdc/2008/02/11/qualifieddc.xsd">
{{forNonBlank(cells["dc:Identifier"], v, "<dc:identifier>"+v.value+"</dc:identifier>", "")}}
{{forNonBlank(cells["dc:Title"], v, "<dc:title>"+v.value+"</dc:title>", "")}}
{{forNonBlank(cells["dcterms:Alternative"], v, "<dcterms:alternative>"+v.value+"</dcterms:alternative>", "")}}
{{forNonBlank(cells["dc:Creator"], v, "<dc:creator>"+v.value+"</dc:creator>", "")}}
{{forNonBlank(cells["dc:Date"], v, "<dc:date>"+v.value+"</dc:date>", "")}}
{{forNonBlank(cells["dcterms:Created"], v, "<dcterms:created>"+v.value+"</dcterms:created>", "")}}
{{for