sul-dlss / dor-services-app

A Rails application exposing Digital Object Registry functions as a RESTful HTTP API
https://sul-dlss.github.io/dor-services-app/
Other
3 stars 2 forks source link

Report for visualization of descriptive metadata that distinguishes properties with a "value" #4522

Open ndushay opened 1 year ago

ndushay commented 1 year ago

As part of #4493, we need a report akin to "descriptive_shapes" from https://github.com/sul-dlss/dor-services-app/blob/main/app/reports/descriptive_shape.rb, which will feed visualizations in sul-dlss-labs/cocina-shapes.

The deltas needed

we still want the desire to select for ils catalog links present or absent, as is in the descriptive shapes report.

Refs:

Spec:

How to determine if a cocina descriptive property has a value:

DescriptiveBasicValue

QUESTION: Note that code property with a value is only ok if we know the source -- punting for now. Note that these are all defined as type DescriptiveValue in the openapi doc

DescriptiveValue

DescriptiveBasicValue with appliesTo property added

Treat as DescriptiveBasicValue

Cocina Description Top Level Values

Title

Treat as DescriptiveBasicValue

Contributor

only count value if direct children properties of name, note, or identifier have value per DescriptiveBasicValue

Event

only count value if

Form

Treat as DescriptiveBasicValue

Language

as DescriptiveBasicValue with script property added:

Note

Treat as DescriptiveBasicValue

Identifier

Treat as DescriptiveBasicValue

Subject

Treat as DescriptiveBasicValue

Geographic

has only form and subject properties as direct children -- treat these as you would top level subject or form

Purl

It's a string. count if value is not blank

Access

Treat all immediate children (url, physicalLocation, digitalLocation, accessContact, digitalRepository, note) as DescriptiveBasicValue

RelatedResource

count it for any "top level" properties under relatedResource e.g. relatedResource[].title[].structuredValue[].value - counts as a value per recursion but relatedResource[].status - does NOT count as a value

AdminMetadata

follow subproperties (note, event, contributor, identifier, language, metadataStandard) and use rules of indicated value, e.g.: adminMetadata.note[].value - count as value if present, but also add valueAt as a valid value

SUB-PROPERTIES

These should only be counted if the parent has a value per above

Standard

ValueLanguage

as Standard plus valueScript property, which should also count as a value

Encoding

exactly equivalent to Standard; treat same as Standard

Source

as Standard, but without source property ... so code cannot count

MarcEncodedData

If we weren't ignoring: treat as DescriptiveValue


DECISION: the below is probably more human hours than it gains in computing hours

paths we can SKIP when looking for presence of value per object (these are useful only if there is a value:

ndushay commented 1 year ago

So, I have a DRO that has 3 top level contributors with values. Am I counting ALL subvalues for each contributor with a value, for the report that counts all occurrences? And what am I counting for “presence of one or more values” ? Just the top level contributor fields? (How would I count presence or value for sub properties? Use all 3 occurrences with values to see if any of them use a sub property?)

If this spec is this hard ... that seems like a smell. This seems frighteningly complex for basic questions, like "does object A have a contributor in the desc metadata (that is a real value and isn't noise)?"

ndushay commented 1 year ago

@arcadiafalcone: event has a top level structuredValue, in addition to parallelEvent. Should that be allowed somehow?

Also, for event, if there is a top level subproperty of "contributor:" should it be treated as a descriptiveBasicValue, or as a contributor (only care about it if there is a name, note or identifier child property)?