-
Notifications
You must be signed in to change notification settings - Fork 1
PCDM Modeling
Ensure the following runs green:
git checkout day1/pcdm/start
bundle
bundle exec rspec
The product owner has prioritized the following story from the backlog:
As a researcher, I need to find sheet music works for a project investigating their cover images. I want to be able to facet materials by the subjects depicted on their cover.
In the next sprint, we write a feature test and come up with a demo implementation that we think minimally addresses the requirements.
git checkout day1/pcdm/step1-feature_test
bundle exec rspec
Pre-written tests for this exercise are in day1/pcdm/step1-tests
This new feature is a huge success but introducing it, far from satisfying the user base, has made the collections usable to a new community of researchers interested in sheet music covers. A range of new use cases has emerged.
To start, covers need:
- Creator
- Description
- Subject
The collection maintainers are also starting to anticipate the need for higher quality scans of cover pages. They would like us to support covers as first class works. We realize this puts us firmly in modeling space.
MusicalWork.ancestors
A few notable ancestors:
- Hyrax::BasicMetadata
- Hyrax::WorkBehavior
- Hyrax::Works::Metadata
- Hydra::PCDM::PcdmBehavior
- Hydra::PCDM::ObjectBehavior
- Hydra::Works::WorkBehavior
bundle exec rake hydra:server
bundle exec rails c
col = Hydra::PCDM::Collection.create
obj1, obj2 = [Hydra::PCDM::Object.create, Hydra::PCDM::Object.create]
col.members = [obj1, obj2]
file = Hydra::PCDM::File.new
file.content = StringIO.new('moomin')
file.file_name = 'moomin.txt'
file.save
obj1.files = [file]
obj1.save
Hydra::PCDM projects PCDM onto LDP:
puts col.resource.dump :ttl
puts obj1.resource.dump :ttl
puts file.metadata.dump :ttl
What about MusicalWork
?
work = MusicalWork.create(title: ['Home on the Range'])
work.resource # => #<MusicalWork::GeneratedResourceSchema:0x2af6...>
puts work.resource.dump :ttl
work.resource.class.ancestors
work.ldp_source