https://github.com/samvera/hydra-pcdm
Samvera implementation of the PCDM model
https://github.com/samvera/hydra-pcdm
core-components samvera-community
Last synced: about 1 year ago
JSON representation
Samvera implementation of the PCDM model
- Host: GitHub
- URL: https://github.com/samvera/hydra-pcdm
- Owner: samvera
- License: other
- Created: 2015-03-26T17:01:49.000Z (about 11 years ago)
- Default Branch: main
- Last Pushed: 2024-10-21T15:47:50.000Z (over 1 year ago)
- Last Synced: 2025-04-13T19:27:15.104Z (about 1 year ago)
- Topics: core-components, samvera-community
- Language: Ruby
- Homepage:
- Size: 409 KB
- Stars: 11
- Watchers: 60
- Forks: 9
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Support: SUPPORT.md
Awesome Lists containing this project
README
# Hydra::PCDM
Code:
[](http://badge.fury.io/rb/hydra-pcdm)
[](https://circleci.com/gh/samvera/hydra-pcdm)
[](https://coveralls.io/r/samvera/hydra-pcdm?branch=main)
Docs:
[](./CONTRIBUTING.md)
[](./LICENSE)
[](http://rubydoc.info/gems/hydra-pcdm)
Community Support: [](http://slack.samvera.org/)
# What is hydra-pcdm?
Samvera implementation of the Portland Common Data Model (PCDM)
## Product Owner & Maintenance
`hydra-pcdm` was a Core Component of the Samvera Community. Given a decline in available labor required for maintenance, this project no longer has a dedicated Product Owner. The documentation for what this means can be found [here](http://samvera.github.io/core_components.html#requirements-for-a-core-component).
### Product Owner
**Vacant**
_Until a Product Owner has been identified, we ask that you please direct all requests for support, bug reports, and general questions to the [`#dev` Channel on the Samvera Slack](https://samvera.slack.com/app_redirect?channel=dev)._
# Help
The Samvera community is here to help. Please see our [support guide](./SUPPORT.md).
## Installation
Add these lines to your application's Gemfile:
```ruby
gem 'active-fedora', '~> 9.3'
gem 'hydra-pcdm', '~> 0.9'
```
And then execute:
$ bundle install
Or install it yourself:
$ gem install hydra-pcdm
## Access Controls
We are using [Web ACL](http://www.w3.org/wiki/WebAccessControl) as implemented in [hydra-access-controls](https://github.com/samvera/hydra-head/tree/main/hydra-access-controls).
## Portland Common Data Model
Reference: [Portland Common Data Model](https://github.com/duraspace/pcdm/wiki)
### Model Definition

## Usage
Hydra::PCDM provides three core classes:
```
Hydra::PCDM::Object
Hydra::PCDM::Collection
Hydra::PCDM::File
```
A `Hydra::PCDM::File` is a NonRDFSource (in [LDP](http://www.w3.org/TR/ldp/) parlance) &emdash; a bitstream. You can use this to store content. A PCDM::File is contained by a PCDM::Object. A `File` may have some attached technical metadata, but no descriptive metadata. A `Hydra::PCDM::Object` may contain `File`s, may have descriptive metadata, and may declare other `Object`s as members (for complex object hierarchies). A `Hydra::PCDM::Collection` may contain other `Collection`s or `Object`s but may not directly contain `File`s. A `Collection` may also have descriptive metadata.
Typically, usage involves extending the behavior provided by this gem. In your application you can write something like this:
```ruby
class Book < ActiveFedora::Base
include Hydra::PCDM::ObjectBehavior
end
class Collection < ActiveFedora::Base
include Hydra::PCDM::CollectionBehavior
end
collection = Collection.create
book = Book.create
collection.members = [book]
# or: collection.members << book
collection.save
file = book.files.build
file.content = "The quick brown fox jumped over the lazy dog."
book.save
```
# Acknowledgments
This software has been developed by and is brought to you by the Samvera community. Learn more at the
[Samvera website](http://samvera.org/).
