Giter VIP home page Giter VIP logo

hydra-works's Introduction

Hydra::Works

Version Build Status Coverage Status Code Climate Apache 2.0 License Contribution Guidelines API Docs Stories in Ready

The Hydra::Works gem implements the PCDM Works data model using ActiveFedora-based models. In addition to the models, Hydra::Works includes associated behaviors around the broad concept of describable "works" or intellectual entities, the need for which was expressed by a variety of Hydra community use cases. The PCDM Works domain model includes the following high-level entities:

  • Collection: a pcdm:Collection that indirectly contains zero or more Works and zero or more Collections
  • Work: a pcdm:Object that holds zero or more FileSets and zero or more Works
  • FileSet: a pcdm:Object that groups one or more related pcdm:Files, such as an original file (e.g., PDF document), its derivatives (e.g., a thumbnail), and extracted full-text

Behaviors included in the model include:

  • Characterization of original files within FileSets
  • Generation of derivatives from original files
  • Virus checking of original files
  • Full-text extraction from original files

Check out the Hydra::Derivatives README for additional dependencies.

Installation

Add these lines to your application's Gemfile:

gem 'hydra-works', '~> 0.1'

And then execute:

$ bundle install

Or install it yourself:

$ gem install hydra-works

Usage

Usage involves extending the behavior provided by this gem. In your application, you can create Hydra::Works-based models like so:

class Collection < ActiveFedora::Base
  include Hydra::Works::CollectionBehavior
end

class Book < ActiveFedora::Base
  include Hydra::Works::WorkBehavior
end

class Page < ActiveFedora::Base
  include Hydra::Works::FileSetBehavior
end

collection = Collection.create
book = Book.create
page = Page.create

collection.members << book
collection.save

book.members << page
book.save

file = page.files.build
file.content = "The quick brown fox jumped over the lazy dog."
page.save

Virus Detection

To turn on virus detection, install clamav on your system and add the clamav gem to your Gemfile

gem 'clamav'

Then include the VirusCheck module in your FileSet class:

class Page < ActiveFedora::Base
  include Hydra::Works::FileSetBehavior
  include Hydra::Works::VirusCheck
end

Access controls

We are using Web ACL as implemented by hydra-access-controls.

How to contribute

If you'd like to contribute to this effort, please check out the contributing guidelines

Development

Testing with the continuous integration server

You can test Hydra::Works using the same process as our continuous integration server. To do that, run the default rake task which will download Solr and Fedora, start them, and run the tests for you.

rake

Testing manually

If you want to run the tests manually, follow these instructions:

solr_wrapper -d solr/config/

To start FCRepo, open another shell and run:

fcrepo_wrapper -p 8984

Now you’re ready to run the tests. In the directory where hydra-works is installed, run:

rake spec

hydra-works's People

Contributors

jcoyne avatar mjgiarlo avatar grosscol avatar flyingzumwalt avatar escowles avatar awead avatar elrayle avatar jeremyf avatar scherztc avatar carolyncole avatar tampakis avatar atz avatar blancoj avatar kevinreiss avatar hectorcorrea avatar dchandekstark avatar eliotjordan avatar

Watchers

James Cloos avatar anukat2015 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.