Skip to content

v8.0.0

Compare
Choose a tag to compare
@dchandekstark dchandekstark released this 14 Jan 17:23
· 1578 commits to main since this release

RDF module renamed (#616)

ActiveFedora::Rdf has been renamed to ActiveFedora::RDF. Deprecated submodules of ActiveFedora::Rdf have been removed (see below). For the most part, this is a transparent change, since classes like ActiveFedora::RDFDatastream do not use the ActiveFedora::RDF namespace.

Fcrepo3 and ProjectHydra RDF vocabularies added (#616)

Change to RDFDatastream resource class implementation (#500)

ActiveFedora::Rdf::ObjectResource was removed in favor of permitting an RDFDatastream to use any ActiveTriples::Resource subclass as its resource class, provided that it includes ActiveFedora::RDF::Persistence.

If you have overridden #resource_class in your RDF datastream subclass, you should change your resource class from:

class MyDatastreamResource < ActiveFedora::Rdf::Resource
  # stuff
end

to:

class MyDatastreamResource < ActiveTriples::Resource
  include ActiveFedora::RDF::Persistence
  # stuff
end

AND, in your datastream, change:

class MyRDFDatastream < NtriplesRDFDatastream # or, < RdfxmlRDFDatastream
  def resource_class
    MyDatastreamResource
  end
end

to:

class MyRDFDatastream < NtriplesRDFDatastream # or, < RdfxmlRDFDatastream
  resource_class MyDatastreamResource
end

Change NtriplesRDFDatastream.config to NtriplesRDFDatastream.properties

Change to default datastream "prefix" (prepended to solr field names):

  • ActiveFedora::Datastream#prefix returns "#{dsid.underscore}__" by default (was empty string) -- e.g. "desc_metadata__" for dsid "descMetadata". In AF 7.x a deprecation warning prompted overriding of #prefix to maintain the 7.x behavior (no prefix) in version 8. If you chose to override #prefix to implement the version 8 behavior, you should be able to remove the override.

Change to attribute setters

The previous (deprecated) behavior permitted attribute setters to receive arrays or scalar regardless of their definitions as "multiple" or "unique" (multiple: false). The new behavior required the sent value to conform to the attribute definition:

  • The setter for an attribute defined with multiple: true raises ArgumentError when given a scalar value:
has_attributes :title, datastream: "descMetadata", multiple: true

obj.title = "Test" # => ArgumentError
obj.title = ["Test"] # OK
  • The setter for an attribute defined with multiple: false (a.k.a. "unique") raises ArgumentError when given an enumerable value (Array):
has_attributes :description, datastream: "descMetadata", multiple: false

obj.description = ["Testing ActiveFedora 8.0.0"] # => ArgumentError
obj.description = "Testing ActiveFedora 8.0.0." # OK
  • The #attributes= method behaves consistently with the attribute setters -- i.e., raising ArgumentError when setting an attribute value inappropriately as outlined above.

Change to attributes reader

The #attributes reader method behaves consistently with the attribute readers -- i.e., returning scalar values for multiple: false and arrays for multiple: true attributes.

Optional fedora.yml configuration options added as comments to generator template (#618)

# timeout: 60
# open_timeout: nil
# ssl_client_cert: <ssl certificate>
# ssl_client_key:  <ssl key>
# validateChecksum: false

Removed deprecated methods

  • ActiveFedora::SolrService.escape_uri_for_query (use Rsolr.escape)
  • ActiveFedora::SemanticNode.pids_from_uris
  • ActiveFedora::RDF::Indexing#prefix (use #apply_prefix)
  • ActiveFedora::RDF::Indexing.prefix
  • ActiveFedora::SolrDigitalObject#new? (use #new_record?)
  • ActiveFedora::Querying#quote_for_solr (use RSolr.escape)
  • ActiveFedora::Persistence#new? and #new_object? (use #new_record?)

Removed deprecated RDF modules

  • ActiveFedora::Rdf::Resource (use ActiveTriples::Resource)
  • ActiveFedora::Rdf::Term (use ActiveTriples::Term)
  • ActiveFedora::Rdf::List (use ActiveTriples::List)
  • ActiveFedora::Rdf::Configurable (use ActiveTriples::Configurable)
  • ActiveFedora::Rdf::Properties (use ActiveTriples::Properties)
  • ActiveFedora::Rdf::Repositories (use ActiveTriples::Repositories)
  • ActiveFedora::Rdf::NodeConfig (use ActiveTriples::NodeConfig)
  • ActiveFedora::Rdf::NestedAttributes (use ActiveTriples::NestedAttributes)