paleobot / pbot-dev

Codebase and initial design documents for pbot client
MIT License
2 stars 2 forks source link

Preservation mode needs multiselect #123

Closed doricon closed 1 year ago

doricon commented 1 year ago

Preservation mode should allow for multiple select in the drop down list

NoisyFlowers commented 1 year ago

Is this on Specimen or Collection or both?

Also, refresh my memory, why do we have it on both?

ecurrano commented 1 year ago

It needs to be on collection because PBDB requires it. There may be fossils with different modes of preservation within the same collection. We want it for specimens because the mode of preservation often informs which schema to use to describe a fossil, and to enable easy searching of similarly preserved specimens.

doricon commented 1 year ago

On specimen. This is a PBot specific field that tells us exactly what the preservation of the specimen is.

The Collection preservation mode field is a requirement of PBDB and is already multiselect, so we're good there. However, pursuant to issue #147, we will have to revise the options in the dropdown menu to match PBDB's options. This field tells us the range of preservation types that are present in the collection/at the sampling locality.

ecurrano commented 1 year ago

Hahaha, Dori and my messages crossed. We will have the revised list of options to you asap. for issue #147 .

NoisyFlowers commented 1 year ago

So, to be clear, we expect there to be individual specimens that are preserved in multiple ways. Correct?

NoisyFlowers commented 1 year ago

Also, to be clear, Specimen and Collection currently share the same set of preservation modes, each defined by a PreservationMode node. This will continue, correct?

ecurrano commented 1 year ago

Yes, individual specimens can be preserved in multiple ways.

ecurrano commented 1 year ago

I thought that we had decided PreservationMode would be a node, which complicates things from the PBDB side. Can I have a reminder on why we decided to make this a node vs. a field for other nodes?

aazaff commented 1 year ago

I do not recall why it was a node as opposed to a property. Can it stay a node for specimens but a property for collections?

NoisyFlowers commented 1 year ago

This was the first enum-ish sort of thing we implemented. It makes sense to keep enum-ish things in the db, so they can be updated without code changes. In a graph db, the obvious way to do this is with nodes, so that's what we did. But there's a lot of infrastructure that goes into that. It's a pain. So, for everything else, I just stuck arrays of values into a file in the client, figuring we'd look into a better implementation later.

IMO, implementing this as both relationships for one use and fields for another sounds kind of lame. I'm not in favor of that. If one use, in Collection, is supposed to be a collection of values from the other use, that Collection's Specimens, they should be the same list, with one source, wherever that is.

Side note: Shouldn't we look into building the list in a Collection from its constituent Specimen's preservationModes rather than having the user enter them twice?

This is no longer a low-hanging fruit. I'm tabling it until I get back.

ecurrano commented 1 year ago

Good idea on tabling this. I think we need to chat about it.

What does enum-ish mean?

NoisyFlowers commented 1 year ago

https://en.wikipedia.org/wiki/Enumerated_type

doricon commented 1 year ago

Oh crap I forgot that Preservation mode was a node type! Keeping it as-is would indeed mean that we need the options to be identical between the specimen and collection fields, and thus we need to go with the PBDB short list. That may be the best pre-hackathon option (so no major back end changes are needed). I am fine with that, and it's possible for later search purposes that having identical lists is better.

Doug - We do expect for some specimens there will be multiple preservation modes contained in a single specimen. Partly permineralized and partly charcoalified. Part permineralized and part impression. These are just a couple examples of specimens I have sitting out right now!

We chose not to populate the collection field as an aggregate of what's recorded in specimens for 2 main reasons: 1) collection records are entered before specimens, and the preservation mode field is required. 2) the collection's preservation mode field is meant to indicate ALL the preservation modes at a sampling site. Not all of those may be represented by the subset of specimens entered in PBot.

NoisyFlowers commented 1 year ago

There's too much crosstalk between this issue and #147. I'm going to ignore that issue wrt this one.

Preservation mode is now multiselect for Specimens. This is in:

paleobot/pbot-api@1be83e5ba0ef2ce0acc0d899a95a1988dff60f84 paleobot/pbot-client@e207f52dbf31db93eacea066295f505a09e41fe4