Giter Club home page Giter Club logo

hydra-pcdm's People

Contributors

acoburn avatar atz avatar awead avatar barmintor avatar blancoj avatar botimer avatar carolyncole avatar cbeer avatar cjcolvar avatar dlpierce avatar elrayle avatar escowles avatar flyingzumwalt avatar grosscol avatar hectorcorrea avatar jcoyne avatar jenlindner avatar jeremyf avatar jrgriffiniii avatar kevinreiss avatar mark-dce avatar mjgiarlo avatar njaffer avatar rotated8 avatar scherztc avatar tpendragon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hydra-pcdm's Issues

setup service architecture

create the following directory structure in Hydra::PCDM

\lib\hydra\pcdm\services
     \collection
     \object
     \file

Add contains files to Hydra::PCDM::Interfaces::Object

Hydra::PCDM::Interfaces::Object (this is a module)
Should be able to contains pcdm:File using the pcdm:hasFile (eg Hydra::PCDM::GenericFile)

  • The files should live at a sub uri of the pcdm:Object (This is AF::Base contains)
  • There should be a pcdm:has_file assertion on the object that points at the file (This is AF::Base:has_and_belongs_to_many)
  • This task should figure out how to combine the behaviors above
  • There can be zero to many files
  • the path to the file subnode can be auto generated

Set rdf:type on Collection

I saw this code in the collection:

# configure :type => RDFVocabularies::PCDMTerms.Collection  # FIX: This is how ActiveTriples sets type, but doesn't work in ActiveFedora

It can now be written as:

  type RDFVocabularies::PCDMTerms.Collection 

Generate CollectionInterface

Create modules
Hydra::PCDM::Interfaces::CollectionInterface (this is a module)
Should be able to aggregate pcdm:Objects using the pcdm:hasMember (eg Hydra::PCDM::GenericWork)
Should be able to aggregate pcdm:Collection using the pcdm:hasMember (eg Hydra::PCDM::Collection)

  • Should not be able to contain files
  • There can be zero to many Objects
  • There can be zero to many Collections

Refactor Aggregates Method signature

The aggregates method signature should handle classnames, predicates, etc in ways that conform to the ActiveModel Associations options and defaults and (where applicable) ActiveFedora::Associations options and defaults

Examples

aggregates :objects, :class_name => Hydra::PCDM::Object, :predicate => “hasMember”
  • objects = the generated method that will be used like… collection1.objects = [pcdm_object1, pcdm_object2]
  • pcdm_object1 and pcdm_object2 are expected to be of type Hydra::PCDM::Object or a subclass

In Fedora, the predicate hasMember will be used to connect collection1 with pcdm_object1 and pcdm_object2

For Hydra::PCDM::Collection, this will allow the following statements

aggregates :collections, :class_name => Hydra::PCDM::Collection, :predicate => "hasMember"
aggregates :objects, :class_name => Hydra::PCDM::Object, :predicate => "hasMember"

For Hydra::Works::Collection, this will allow the following statements

aggregates :collections, :class_name => Hydra::Works::Collection, :predicate => "hasMember"
aggregates :generic_works, :class_name => Hydra::Works::GenericWork, :predicate => "hasMember"

Background (from lynette):

Currently, activefedora-aggregation's aggregates method takes a symbol representation of a classname. Ex. From association_spec, in the statement aggregates :generic_files, :generic_files is the symbol for the GenericFile class. This creates a new method on the class called generic_files so that you can do the following: image.generic_files = [generic_file1, generic_file2] where generic_file1 and generic_file2 are instances of GenericFile.

BUG: I was not aware the parameter to aggregates was a class symbol when I began writing the code, so you will see in my code the use of the symbol as the relationship :members. Obviously, this doesn’t work because there is not a Member class.

Challenge: I was not able to find a way in Ruby to convert a classname with modules to a simple symbol. For ex., what is the symbol for Hydra::PCDM::Object?

Complete the Hydra::PCDM::Bread

Include the Hydra::PCDM::Interfaces::Object

Should be able to aggregate Meat & Cheese
Should not be able to contain Condiments
Should not be able to aggregate Bread
(future) Should be able to aggregate Bread

Make validation callable from other classes

Need: ability to validate a collection or object from services and tests

Recommendation:

  • change Collection's collection? method to a class method
  • move Collection's object? method to PCDM::Object and make it a class method
  • have all validations call the class methods

setup service architecture

create the following directory structure in Hydra::Works

\lib\hydra\works\services
     \collection
     \generic_work
     \generic_file
     \file

service: upload to generic file

# Upload a file to a generic file, optionally running auto-generation services to create variants.
#
# @param [Hydra::Works::GenericFile] :generic_file into which to upload the file
# @param [String] :path_to_file path to the file being uploaded
# @param [Hash] :auto_gen_services info for auto-generating files from the uploaded content file
#
# @return [Hydra::Works::GenericFile] the updated generic file

Questions:

  • A generic_file is defined as one content file + variants that are auto-generated. Do others agree?
  • If the generic_file already has files, is the new file considered a new version of the existing content file?
  • What predicate should be used for identifying the purpose of the uploaded content file and each auto-gen file? (e.g. use - what is the full URI?)
  • What values should be used for the 'purpose' predicate? (e.g. file.use = "content" | "thumbnail" | "extracted_text")

Optimize solrization of members

Get member_ids of each collection and object, which doesn't instantiate the objects, and classify them (Object vs. Collection) by querying solr for their types.

Complete the Hydra::PCDM::Sandwich

Include the Hydra::PCDM::Interfaces::Collection

Should be able to aggregate Bread
Should not be able to contain Condiments
Should not be able to aggregate Meat & Cheese
(future) Should be able to aggregate Sandwich

Complete the Hydra::PCDM::Meat

Include the Hydra::PCDM::Interfaces::Object

Should be able to contain Condiments
Should not be able to aggregate Sandwich
Should not be able to aggregate Bread

Fix append tests

<< works at active fedora level and is implemented correctly in pcdm. The tests do not test it correctly.

coll1.collections << coll2 # not supported
coll1.objects << obj1 # not supported
coll1 << coll2 # is supported
coll1 << obj1 # is supported

This may not be as clear to the end user. But it is operational now. Tests are being updated to reflect what is supported.

Make Gem

run bundle gem hydra-pcdm
change license to Apahce2
Add contributor document

Create Concrete Model classes

Create the following Model Classes:
Hydra::PCDM::Condiment (will be an Non RDF source)
Hydra::PCDM::Cheese (will include PCDM::Object)
Hydra::PCDM::Meat (will include PCDM::Object)
Hydra::PCDM::Bread (will include PCDM::Object)
Hydra::PCDM::Sandwich (will include PCDM::Collection)

They should inherit from active fedora base

Should aggregating members mean /members and not /files?

In Hydra::PCDM::CollectionBehavior, with aggregates :members produces a URI like:

/fedora/rest/test/09/27/90/91/09279091-559f-4505-89af-93ae9216949c/files

Shouldn't this be:
http://localhost:8983/fedora/rest/test/09/27/90/91/09279091-559f-4505-89af-93ae9216949c/members ?

Complete the Hydra::PCDM::Cheese

This will be similar to Meat, but should allow us to test just getting the Meat, or just getting the Cheese that is between the bread on a sandwich.

It should include Hydra::PCDM::Interfaces::ObjectInterface

Should related objects be solrized?

See test hydra/pcdm/services/collection/add_related_object_spec.rb test: it 'should solrize member ids'
See test hydra/pcdm/services/object/add_related_object_spec.rb test: it 'should solrize member ids'

Those tests currently check that the objects and collections were solrized, and that related objects are not part of the objects and collections index. Should there be a related_objects index?

Files don't appear to have ids and therefore are not tested for inclusion in an index. Is that correct?

pcdm:Collections, pcdm:Objects and pcdm:Files enforce behavior rules

Note: If it's not possible to enforce these rules on Files for some reason, call it out on the scrum.

Object Behavior Rules

  • Hydra::PCDM::Object can aggregate (pcdm:hasMember) Hydra::PCDM::Object
  • Hydra::PCDM::Object can aggregate (ore:aggregates) Hydra::PCDM::Object (Object related to the Object)
  • Hydra::PCDM::Object can contain (pcdm:hasFile) Hydra::PCDM::File
  • Hydra::PCDM::Object can contain (pcdm:hasRelatedFile) Hydra::PCDM::File
  • Hydra::PCDM::Object can NOT aggregate Hydra::PCDM::Collection
  • Hydra::PCDM::Object can NOT aggregate non-PCDM object
  • Hydra::PCDM::Object can have descriptive metadata
  • Hydra::PCDM::Object can have access metadata

File Behavior Rules

  • N/A - PCDM::File can NOT aggregate anything (no aggregation, so nothing to test)
  • N/A - PCDM::File can NOT contain PCDM::File (no contains association defined, so nothing to test)
  • PCDM::File can have technical metadata about one uploaded binary file

Collection Behavior Rules

  • Hydra::PCDM::Collection can aggregate (pcdm:hasMember) Hydra::PCDM::Collection
  • Hydra::PCDM::Collection can aggregate (pcdm:hasMember) Hydra::PCDM::Object
  • Hydra::PCDM::Collection can aggregate (ore:aggregates) Hydra::PCDM::Object (Object related to the Collection)
  • Hydra::PCDM::Collection can NOT aggregate non-PCDM object
  • Hydra::PCDM::Collection can NOT contain Hydra::PCDM::File
  • Hydra::PCDM::Collection can have descriptive metadata
  • Hydra::PCDM::Collection can have access metadata

Supported ruby versions

At present, Travis is testing multiple Ruby versions 1.9 through 2.1, as well as jruby. Are all those needed? Perhaps we can just to 2.1 and 2.2? @jcoyne @elrayle ?

implement << operator on collections

ideally the << operator would work like...

coll1.collections << coll2
coll1.objects << obj1

But collections is a method and not a ruby object. A method cannot have the << operator.

Alternative is...

coll1 << coll2
coll1 << obj1

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.