<commit_before>module Bplmodels
  class ObjectBase < ActiveFedora::Base
    # To change this template use File | Settings | File Templates.
    include ActiveFedora::Auditable
    include Hydra::AccessControls::Permissions
    include Hydra::ModelMethods

    has_many :exemplary_image, :class_name => "Bplmodels::File", :property=> :is_exemplary_image_of

    has_many :image_files, :class_name => "Bplmodels::ImageFile", :property=> :is_image_of

    has_many :audio_files, :class_name => "Bplmodels::AudioFile", :property=> :is_audio_of

    has_many :document_files, :class_name => "Bplmodels::DocumentFile", :property=> :is_document_of

    has_many :files, :class_name => "Bplmodels::File", :property=> :is_file_of



    belongs_to :institution, :class_name => 'Bplmodels::Institution', :property => :is_member_of

    belongs_to :collection, :class_name => 'Bplmodels::Collection', :property => :is_member_of_collection

    belongs_to :organization, :class_name => 'Bplmodels::Collection', :property => :is_member_of_collection

    belongs_to :admin_set, :class_name => 'Bplmodels::Collection', :property => :administrative_set

    has_and_belongs_to_many :members, :class_name=> "Bplmodels::Collection", :property=> :hasSubset

    has_metadata :name => "descMetadata", :type => ModsDescMetadata
    has_metadata :name => "workflowMetadata", :type => WorkflowMetadata

    # Uses the Hydra Rights Metadata Schema for tracking access permissions & copyright
    has_metadata :name => "rightsMetadata", :type => Hydra::Datastream::RightsMetadata

    has_attributes :abstract, :datastream=>'descMetadata', :at => [:mods, :abstract], :multiple=> false
    has_attributes :title, :datastream=>'descMetadata', :at => [:mods, :title],  :multiple=> true
    has_attributes :supplied_title, :datastream=>'descMetadata', :at => [:mods, :title_info, :supplied],  :multiple=> true
    has_attributes :note_value, :datastream=>'descMetadata', :at => [:mods, :note],  :multiple=> true
    has_attributes :workflow_state, :datastream=>'workflowMetadata', :at => [:item_status, :state],  :multiple=> true
    has_attributes :creator_name, :datastream=>'descMetadata', :at => [:mods, :name, :namePart],  :multiple=> true
    has_attributes :creator_type, :datastream=>'descMetadata', :at => [:mods, :name, :type],  :multiple=> true
    has_attributes :creator_role, :datastream=>'descMetadata', :at => [:mods, :name, :role, :text],  :multiple=> true
    has_attributes :resource_type, :datastream=>'descMetadata', :at => [:mods, :type_of_resource],  :multiple=> true
    has_attributes :manuscript, :datastream=>'descMetadata', :at => [:mods, :type_of_resource, :manuscript],  :multiple=> true
    has_attributes :genre, :datastream=>'descMetadata', :at => [:mods, :genre_basic],  :multiple=> true
    has_attributes :identifier, :datastream=>'descMetadata', :at=>[:mods, :identifier],  :multiple=> true<commit_msg>Changed the relationship definition to allow hydra to pick up the mutliple collections<commit_after>module Bplmodels
  class ObjectBase < ActiveFedora::Base
    # To change this template use File | Settings | File Templates.
    include ActiveFedora::Auditable
    include Hydra::AccessControls::Permissions
    include Hydra::ModelMethods

    has_many :exemplary_image, :class_name => "Bplmodels::File", :property=> :is_exemplary_image_of

    has_many :image_files, :class_name => "Bplmodels::ImageFile", :property=> :is_image_of

    has_many :audio_files, :class_name => "Bplmodels::AudioFile", :property=> :is_audio_of

    has_many :document_files, :class_name => "Bplmodels::DocumentFile", :property=> :is_document_of

    has_many :files, :class_name => "Bplmodels::File", :property=> :is_file_of



    belongs_to :institution, :class_name => 'Bplmodels::Institution', :property => :is_member_of

    has_and_belongs_to_many :collection, :class_name => 'Bplmodels::Collection', :property => :is_member_of_collection

    has_and_belongs_to_many :organization, :class_name => 'Bplmodels::Collection', :property => :is_member_of_collection

    belongs_to :admin_set, :class_name => 'Bplmodels::Collection', :property => :administrative_set

    has_and_belongs_to_many :members, :class_name=> "Bplmodels::Collection", :property=> :hasSubset

    has_metadata :name => "descMetadata", :type => ModsDescMetadata
    has_metadata :name => "workflowMetadata", :type => WorkflowMetadata

    # Uses the Hydra Rights Metadata Schema for tracking access permissions & copyright
    has_metadata :name => "rightsMetadata", :type => Hydra::Datastream::RightsMetadata

    has_attributes :abstract, :datastream=>'descMetadata', :at => [:mods, :abstract], :multiple=> false
    has_attributes :title, :datastream=>'descMetadata', :at => [:mods, :title],  :multiple=> true
    has_attributes :supplied_title, :datastream=>'descMetadata', :at => [:mods, :title_info, :supplied],  :multiple=> true
    has_attributes :note_value, :datastream=>'descMetadata', :at => [:mods, :note],  :multiple=> true
    has_attributes :workflow_state, :datastream=>'workflowMetadata', :at => [:item_status, :state],  :multiple=> true
    has_attributes :creator_name, :datastream=>'descMetadata', :at => [:mods, :name, :namePart],  :multiple=> true
    has_attributes :creator_type, :datastream=>'descMetadata', :at => [:mods, :name, :type],  :multiple=> true
    has_attributes :creator_role, :datastream=>'descMetadata', :at => [:mods, :name, :role, :text],  :multiple=> true
    has_attributes :resource_type, :datastream=>'descMetadata', :at => [:mods, :type_of_resource],  :multiple=> true
    has_attributes :manuscript, :datastream=>'descMetadata', :at => [:mods, :type_of_resource, :manuscript],  :multiple=> true
    has_attributes :genre, :datastream=>'descMetadata', :at => [:mods, :genre_basic],  :multiple=> true
    has_attributes :identifier, :datastream=>'descMetadata', :at=>[:mods, :identifier],  :multiple=> true
{'fraction_non_alphanumeric': 0.14963688566120587, 'fraction_numerical': 0.0, 'mean_word_length': 6.449056603773585, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 127, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5507016', 'n_tokens_mistral': 1914, 'n_tokens_neox': 1870, 'n_words': 425}