Closed saumier closed 1 year ago
@troughc I went ahead a did this experimental merge of 2 events. Let me know if you have any issues. This one was tricky because there were 2 dates from 2023 and 3 dates from 2024. We can discuss how to handle this moving forward for the next events. I think it is better to keep separate events when they are spread out like this. But in this case, since it was confusing and already existed with 2 Artsdata IDs, I went ahead and merged them in CMS so I could learn if the code will support a single CMS event with 2 Artsdata IDs.
@troughc I am assigning this to you just to make sure you saw this incase Isabelle asks about it. I normally NEVER touch the live data but this one was really troubling me and I also wanted to see if my solution of adding 2 Artsdata Ids to the same CMS event would cause a problem with Aggregator. I still have to check on this.
@saumier thanks for letting me know. I will be interested to hear how it goes.
@sahalali Hi. Do you think there is any problem if an event like one "Christine Morency" has 2 Artsdata URIs in sameAs?
The event in CMS has the dates from both events in Artsdata. So I added both Artsdata URIs and my expectation is that both events from Artsdata will not create a new event because they both already exist in CMS https://api.footlight.io/events/645b93f27db98f0065dc623f
@saumier Yes, Currently we expect only a single Artsdata URI in the sameAs. Nothing going to break in the backend. But the comparison of entities is done with any of the artsdata URL within the sameAs values. We will need to modify the comparison with Artsdata URI to make sure everything works as expected.
@sahalali I propose we add a unit test for this case. Let me know,
@sahalali Can I close this?
@saumier
@dev-aravind is adding unit test for this.
@saumier I wrote a unit test for this issue which was failing, so made some changes to the updateEvent API to fix this. It's up in staging right now.
@sahalali @dev-aravind I am having trouble running the API Docker and the tests locally. Please see issue https://github.com/culturecreates/footlight-calendar-api/issues/651.
Regarding the test, I added 2 comments to the code.
@dev-aravind I went through both of your comments and replied to them in the commit thread and also made changes to the code to address the issues you mentioned.
@dev-aravind I have 2 questions:
@saumier
The datatype for the property type was initially wrong in the CMS. So when I asked @sahalali about it, he suggested me to fix the test case and remove the type property as it was not necessary for Events.
The Artsdata URIs are actually different. The first one that I used to define the event was http://kg.artsdata.ca/resource/K23-193, and the second one that I pushed for that specific test was http://kg.artsdata.ca/resource/K23-194. I think you didn't notice it because it was a minor change maybe? I'll try to make the tests more easier to comprehend as I learn more about Jest.
Also I discussed with @sahalali about the unit tests not running for you and I think it's probably a node version issue. @sahalali will follow up on that with you.
@dev-aravind Great! Thanks for the explanations. Indeed I see that the Artsdata URIs are different now.
I merged these 2 events in CMS. I am experimenting with the idea of an event having 2 sameAs Artsdata IDs K23-840 and K23-345.
I added the 2 extra dates in 2023 to the currently published event with 3 dates in 2024. I also deleted the unpublished event.