Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Panel
panelIconIdatlassian-info
panelIcon:info:
bgColor#B3D4FF

This tutorial assumes that you generated a work type name GenericWork. If you used a different name, substitute that name for all occurrences of GenericWork and generic_work.

...

For an current list of metadata fields for the latest version of Hyrax, see the Metadata Application Profile.

Basic metadata

Basic metadata properties are defined in app/models/concerns/hyrax/basic_metadata.rb

Property

Predicate

Multiple

label

ActiveFedora::RDF::Fcrepo::Model.downloadFilename

FALSE

relative_path

::RDF::URI.new(‘http://scholarsphere.psu.edu/ns#relativePath’)

FALSE

import_url

::RDF::URI.new(‘http://scholarsphere.psu.edu/ns#importUrl’)

FALSE

part_of

::RDF::Vocab::DC.isPartOf

TRUE

resource_type

::RDF::Vocab::DC.type

TRUE

creator

::RDF::Vocab::DC11.creator

TRUE

contributor

::RDF::Vocab::DC11.contributor

TRUE

description

::RDF::Vocab::DC11.description

TRUE

keyword

::RDF::Vocab::DC11.relation

TRUE

rights

::RDF::Vocab::DC.rights

TRUE

rights_statement

::RDF::Vocab::EDM.rights

TRUE

publisher

::RDF::Vocab::DC11.publisher

TRUE

date_created

::RDF::Vocab::DC.created

TRUE

subject

::RDF::Vocab::DC11.subject

TRUE

language

::RDF::Vocab::DC11.language

TRUE

identifier

::RDF::Vocab::DC.identifier

TRUE

based_near

::RDF::Vocab::FOAF.based_near

TRUE

related_url

::RDF::RDFS.seeAlso

TRUE

bibliographic_citation

::RDF::Vocab::DC.bibliographicCitation

TRUE

source

::RDF::Vocab::DC.source

TRUE

Core metadata

Core metadata properties (that should never be removed) are defined in app/models/concerns/hyrax/required_metadata.rb

Property

Predicate

Multiple

depositor

::RDF::URI.new(‘http://id.loc.gov/vocabulary/relators/dpt’)

FALSE

title

::RDF::Vocab::DC.title

TRUE

date_uploaded

::RDF::Vocab::DC.dateSubmitted

FALSE

date_modified

::RDF::Vocab::DC.modified

FALSE

Extend the model

To add a new single-value property

...

Code Block
# Generated via
#  `rails generate hyrax:work GenericWork`
class GenericWork < ActiveFedora::Base
  include ::Hyrax::WorkBehavior
  include ::Hyrax::BasicMetadata
  # Change this to restrict which works can be added as a child.
  # self.valid_child_concerns = []
  validates :title, presence: { message: 'Your work must have a title.' }

  property :contact_email, predicate: ::RDF::Vocab::VCARD.hasEmail, multiple: false do |index|
    index.as :stored_searchable
  end

  property :contact_phone, predicate: ::RDF::Vocab::VCARD.hasTelephone do |index|
    index.as :stored_searchable
  end

  property :department, predicate: ::RDF::URI.new("http://lib.my.edu/departments"), multiple: false do |index|
    index.as :stored_searchable, :facetable
  end
end

...