Fwd: [hydra-tech] Title property as a single value instead of a multi-valued field

2 views
Skip to first unread message

James R. Griffin III

unread,
Mar 18, 2016, 4:11:39 PM3/18/16
to hydra-gis-working-group
Dear Darren, Eliot, and John,

This seemed appropriate given some of the concerns which were raised during the call held today (particularly those addressing the external metadata extraction in issue #83).

As Tom Johnson states:

The reason for this is that the underlying data model (RDF) doesn't have a concept of property cardinality.

Unfortunately, I (incidentally) found this to be the case within a number of architectural issues which I've been trying to conceptually approach from the initial sprint.  I believe that this also may relate to the cardinality-based validation which must be imposed between Image/Raster and Raster/Vector Work resources.  While Justin Coyne did assure me that this could be implemented at the level of ActiveFedora, it still could not be imposed at the level of the RDF tuples themselves (I suspect that this would require something along the lines of SHACL).

Hopefully this proves to be useful in the progress being made on these issues.

Sincerely,
James

---------- Forwarded message ----------
From: Tom Johnson <johns...@gmail.com>
Date: Fri, Mar 18, 2016 at 3:39 PM
Subject: Re: [hydra-tech] Title property as a single value instead of a multi-valued field
To: "<hydra...@googlegroups.com>" <hydra...@googlegroups.com>


Hi Dave,

Adding to what Mike said: Curation Concerns has a preference for multivalued fields in general. The reason for this is that the underlying data model (RDF) doesn't have a concept of property cardinality.

RDF is "Open World", meaning the non-presence of a data point is not considered to declare it to be false. Other titles (e.g. translations) may be asserted by other data providers, and RDF tries to be flexible about this.

More practically speaking, you can insert additional titles manually, for example: (`my_item << RDF::Statement(my_item, RDF::Vocab::DC.title, 'second title')`; or you could import data from an outside source. In this case, a single-valued field would return only one title; which one it returns is random. The result is data loss in simple cases like form submissions: `my_item.title = my_item.title` causes data to be deleted from the underlying representation!

I think Mike's suggestion of using custom forms and presenters to handle business requirements around value cardinality is the prevailing view. You could also use ActiveModel::Validations to handle restrictions in a way that degrades gracefully when unexpected data pops up underneath the ActiveFedora/ActiveTriples layer.

Hope this helps!

- Tom

On Fri, Mar 18, 2016 at 12:20 PM, Mike Giarlo <mjgi...@stanford.edu> wrote:

Howdy, Dave.


To clarify, is this a modeling requirement or a business logic/display requirement? If the latter, I'd suggest handling this via custom form and presenter objects rather than changing the model. (We added the form and presenter objects to allow exactly this sort of flexibility.) That way, your app could display the title as single-valued both on show pages and in edit forms even though it happens to be serialized to Solr and Fedora as a multi-valued type.


-- 
Michael J. Giarlo

Technical Manager, Hydra-in-a-Box project

Software Architect, Digital Library Systems & Services

Stanford University Libraries

mjgi...@stanford.edu

+1 (206) 402-4473




From: hydra...@googlegroups.com <hydra...@googlegroups.com> on behalf of Dave Goldstein <brit...@gmail.com>
Sent: Friday, March 18, 2016 11:10
To: Hydra-Tech
Subject: [hydra-tech] Title property as a single value instead of a multi-valued field
 
Folks,

The curation concerns gem I am using (0.6.0) assumes that title property is a multi-valued field and setting it to "multiple: false" (which we require) conflicts with additional creation concerns code (curation_concerns-models-0.6.0/app/actors/curation_concerns/file_set_actor.rb) which has the following:

def create_content(file)
      # Assign label and title of File Set is necessary.
      file_set.label ||= file.respond_to?(:original_filename) ? file.original_filename : ::File.basename(file)
      file_set.title = [file_set.label] if file_set.title.blank?

Is there a domain specific reason why title must be multi-valued or is this something I am missing (or a coding oversight)?

Thanks in advance...

Dave

--
You received this message because you are subscribed to the Google Groups "Hydra-Tech" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hydra-tech+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Hydra-Tech" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hydra-tech+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-Tom Johnson

--
You received this message because you are subscribed to the Google Groups "Hydra-Tech" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hydra-tech+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
James R. Griffin III
Digital Library Developer
Digital Scholarship Services
111C Technical Services
David B. Skillman Library
Lafayette College
Easton, PA 18042
Reply all
Reply to author
Forward
0 new messages