Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changed example enrichment profile to new "Revised Standard" profile

See the current Enrichment Profiles.

Code Block
languageruby
titleEnrichment Queue
# a typical enrichment specification: 
enrichment_profile = {
  'Krikri::Enrichments::SplitAtDelimiterDedupNodes' => {
    input_fields: [:all]
  },
  'Krikri::Enrichments::SplitProvidedLabelAtDelimiter' => {
    input_fields: [:rights{ sourceResource: :subject },
                    { dataProvidersourceResource: :providedLabelspatial },
                   { sourceResource: :creator }]
  },
  { sourceResource: :identifier },
 'Krikri::Enrichments::CreatePrefLabelFromProvided' => {
    input_fields: [:all]
  },
  'Krikri::Enrichments::SplitAtDelimiter' => {
    input_fields: [:rights,
                   { sourceResource: :titleidentifier },
                    { sourceResource: :rights },
                    { sourceResource: :extent },
                    { sourceResource: :dcformat },

                   { sourceResource: :genre },

                   { sourceResource: :dctype }]
  },
  'Krikri::Enrichments::RemoveEmptyFieldsStripHtml' => {
     input_fields: [:all]
  },
  'Krikri::Enrichments::StripHtmlStripLeadingColons' => {
     input_fields: [:all{ sourceResource: :title }]
  },
  'Krikri::Enrichments::StripLeadingColonsStripLeadingPunctuation' => {
    input_fields: [{ sourceResource: { creator:title}] :prefLabel } },
         'Krikri::Enrichments::StripLeadingPunctuation' => {          { sourceResource: { contributor: :prefLabel } },
                  input_fields: [{ sourceResource: { creatorpublisher: :providedLabelprefLabel } },
                    { sourceResource: { contributorsubject: :providedLabelprefLabel } },
                    { sourceResource: :dcformat },
                   { publishersourceResource: :providedLabelgenre } }]
  },
  'Krikri::Enrichments::StripEndingPunctuation' => {
     input_fields: [{ sourceResource: :title },

                   { sourceResource: { creator: :providedLabelprefLabel } },
                    { sourceResource: { contributor: :providedLabelprefLabel } },
                   { sourceResource: { publisher: :prefLabel } },
                   { sourceResource: { publisher subject: :prefLabel } },
                   { sourceResource: :providedLabeldcformat },
                   { sourceResource: :genre }]
  },
  'Krikri::Enrichments::StripWhitespace' => {
    input_fields: [{sourceResource: :title}:all]
  },
  'Krikri::Enrichments::ParseDate' => {
    input_fields: [{ sourceResource: { date: :begin } },
                   { sourceResource: { date: :end } }]
  },	
  'Krikri::Enrichments::TimespanSplit' => {
    input_fields: [{ sourceResource: :date }]
  },
  'Krikri::Enrichments::DcmiTypeMap' => {
    input_fields: [{ sourceResource: :dctype }]
  },
  'Krikri::Enrichments::GenreFilter' => {
    input_fields: [{ sourceResource: :genre }]
  }
 ,
  'Krikri::Enrichments::LanguageToLexvo' => {
    input_fields: [{ sourceResource: :language }]
  },
  'Krikri::Enrichments::DcmiEnforcer' => {
    input_fields: [{ sourceResource: :dctype }]
  },
  'Krikri::Enrichments::TimespanLabel' => {
    input_fields: [{ sourceResource: :date }]
  },
  'Krikri::Enrichments::RemoveEmptyFields' => {
    input_fields: [:all]
  }
}
# Queue enrichment
activity_uri = Krikri::Activity.find(activity_id).rdf_subject
Krikri::Enricher.enqueue({:generator_uri => activity_uri, :chain => enrichment_profile})
  


To Test Enrichments Manually (w/o save)

...