Sha256: 7a75e9deaf1e200e8ef572ff1816d9ddb66427e040c01fd2d1c7ee06e9dc5d04
Contents?: true
Size: 1.15 KB
Versions: 64
Compression:
Stored size: 1.15 KB
Contents
module Ddr module Datastreams class DescriptiveMetadataDatastream < MetadataDatastream class_attribute :vocabularies self.vocabularies = [RDF::DC, Ddr::Vocab::DukeTerms].freeze def self.default_attributes super.merge(:mimeType => 'application/n-triples') end def self.indexers # Add term_name => [indexers] mapping to customize indexing {} end def self.default_indexers [:stored_searchable] end def self.indexers_for(term_name) indexers.fetch(term_name, default_indexers) end # Add terms from the vocabularies as properties vocabularies.each do |vocab| Ddr::Vocab::Vocabulary.property_terms(vocab).each do |term| term_name = Ddr::Vocab::Vocabulary.term_name(vocab, term) property term_name, predicate: term do |index| index.as *indexers_for(term_name) end end end # Override ActiveFedora::Rdf::Indexing#apply_prefix(name) to not # prepend the index field name with a string based on the datastream id. def apply_prefix(name) name end end end end
Version data entries
64 entries across 64 versions & 1 rubygems