Allow to upload COG in WB#6073
Conversation
Triggered by f1aa17c on branch refs/heads/issue-5418
Triggered by 79a2adc on branch refs/heads/issue-5418
emenslin
left a comment
There was a problem hiding this comment.
- Ensure you can disambiguate related records when there is more than one potential match
- Ensure that matched records do not count as "New Cells"
- Create a record set with the uploaded results, and ensure that all data is uploaded correctly
- Ensure that all created records are deleted and all independent relationships (for example, CO -> cojo if assigning an existing CO to a new/existing COG) are reverted to their state prior to the upload
- Ensure CollectionObjects can be added to existing COGs via the WorkBench
- Ensure that COGs can be created as part of the upload process for a CO and that COs can be associated with
- Ensure a COJO can not be created with both a childCo and childCog
- Ensure a COJO can not be created without a childCo and childCog
- Ensure the
precedenceof the COJO records are automatically set based on the order they are added
Cannot disambiguate
01-16-2025_12-58.mp4
Can upload a COJO without any children and can upload a COJO with both a childCO and childCOG
01-16-2025_13-28.mp4
Triggered by 1d14140 on branch refs/heads/issue-5418
|
Hey guys!
From #6073 (review) These Issues have been fixed. You should now be able to properly disambiguate. The businessrules to prevent saving when a COJO had had neither a childCO or childCOG or both a childCO and childCOG were disabled in fc85009, but have been re-enabled! The actual content of the error message can likely be modified/improved in whichever PR tackles #6073 (comment). Now, remote one-to-one relationships are instead parsed as a toMany relationship. What this means is that Before as_toOne.movNow as_toMany.movThis decision is the result of the discussion in #6073 (comment) (thank you for the insightful replies, Also, I've included a fix for #1835. You should now longer longer receive the error message for a successful validation, upload, or rollback. |
emenslin
left a comment
There was a problem hiding this comment.
- Ensure you can disambiguate related records when there is more than one potential match
- Ensure that matched records do not count as "New Cells"
- Create a record set with the uploaded results, and ensure that all data is uploaded correctly
- Ensure that all created records are deleted and all independent relationships (for example, CO -> cojo if assigning an existing CO to a new/existing COG) are reverted to their state prior to the upload
- Ensure CollectionObjects can be added to existing COGs via the WorkBench
- Ensure that COGs can be created as part of the upload process for a CO and that COs can be associated with
- Ensure a COJO can not be created with both a childCo and childCog
- Ensure a COJO can not be created without a childCo and childCog
- Ensure the
precedenceof the COJO records are automatically set based on the order they are added
Can successfully disambiguate now and errors are caught with COJO!

I know this is a little different so maybe this won't be fixed here but sometimes I get a validation error (that you physically have to press close on) but then it says it successfully validates, this could be just a data set error but I'm not sure.
chrome_01-21_10.11.mp4
Not sure if precedence is being set correctly, when querying it shows mutliple children under the same COG with a precedence of zero but I'm not sure if this has to do with it being an existing COG or not.
Were the mappings for this data set from before the recent changes? You will get the error message shown in the video when the upload plan contains either Is this the New Data Set Thu Jan 16 2025 (2) in the Fossil Invertebrates collection for user spadmin? For testing the changes after #6073 (comment), I would recommend creating a new Data Set, or if working on pre-existing data sets: unmap and remap any I've updated the example If you do encounter the same problem again, can you include the upload plan of the Data Set in the message? (You can copy the contents shown in
Do you know if these children were associated with the parent CollectionObjectGroup while on this branch? Precedence should be set for any newly created or saved CollectionObjectGroupJoin records on this branch. The change is not applied retroactively which means that any existing CollectionObjectGroupJoin records will not have their precedence set until they are saved. Additionally, the precedence is automatically only set if a precedence is not explicitly set for the CollectionObjectGroupJoin record being saved: this means that if the user manually specifies each CollectionObjectGroupJoin's precedence (e.g., setting them all to 0), then it's possible for there to be multiple CollectionObjectGroupJoin records with the same precedence in the same parent. |
|
I cannot recreate the issue, but I know I had updated the mappings before testing that data set so I'm not sure what happened. I did notice though that the current workbench naming convention makes uploading COGs pretty confusing. This is probably out of the scope of this pr but is there anything we can do to fix this? I just feel like this isn't super clear Upload plan: I also noticed that querying on the COG table then going to collection object group join -> parent -> name, the heading is 'Arent' instead of 'Parent' It does seem like precedence is being correctly set for newly created COGs so maybe someone else edited some of the ones with multiple zeros that I was seeing. Based on how it's been described to me, I think it would make more sense to have unique precedence for each CollectionObjectGroupJoin record, however, I can see letting users decide what they want the precedence to be, including letting multiple have the same number. @grantfitzsimmons what do you think? Will users want to have the same precedence for multiple CollectionObjectGroupJoin records or will they want a unique one for each? |
this is fixed in prod |
Triggered by 05eafa2 on branch refs/heads/issue-5418
They will likely want something unique, but I don't think we should rule out the possibility of having the same precedence. |
|
Thanks for your contributions to the PR everyone! We will merge this PR for now, so here's a comment to wrap things up:
From #6073 (comment) I think the Issue you found probably has the same cause as #6099, so I have re-opened the Issue and left your findings as a comment: #6099 (comment)
Could you expand more on what you mean by this? Do you think the actual labels for the fields/relationships should be changed, the auto-generated column names for some mapping path should be changed, or something else entirely? Regardless, it will need to be a new Bug/Feature Request: anything to formalize/specify the requirements of the expected behavior is beneficial! |
Issues in the review have been addressed, see #6073 (comment)



Fixes #5418
Fixes #1835
Written with @melton-jason
Sets the following required relationships as optional for WorkBench mappings:
Adds a businessrule to automatically set the
precedencefield of CollectionObjectGroupJoin records if not set on the backendAllows uploading through 'remote'
to-onerelationships (where the Foreign Key is on the other side of a relationship) through the WorkBench.cog_cojo_wb.mov
cog-cojo-rollback.mov
Data and upload plan as shown in the above videos:
upload_plan.json
COG Data Set.csv
Checklist
self-explanatory (or properly documented)
Testing instructions
Create a WorkBench data set with a base table of CollectionObjectGroup (COG)
cojo -> parentCogparentCog, you will be uploading a COG which is already a child of another COGchildren -> childCorelationshipchildren -> childCogrelationshipcojo -> parentCogcojo -> parentCogrelationshipchildren -> childCochildren -> childCoCreate a WorkBench data set with a base table of CollectionObject (CO)
When uploading any CollectionObjectGroupJoin (COJO) via the WorkBench