Created
April 3, 2015 17:43
-
-
Save tpendragon/dec4650c27f2c362d0b3 to your computer and use it in GitHub Desktop.
n_triples_export
This file contains 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
module OregonDigital | |
module SolrNTripleExtension | |
def self.extended(document) | |
document.will_export_as(:nt, "application/n-triples") | |
end | |
def export_as_nt | |
graph = CleanRepository.new(ActiveFedora.fedora.connection, GenericAsset).find(self["id"]) | |
graph = OregonDigital::GraphMutators::SubjectChanger.call(graph, GenericAsset.id_to_uri(self["id"]), RDF::URI("http://oregondigital.org/resource/#{self["id"]}")) | |
graph.dump(:ntriples) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment