culturecreates / footlight-aggregator

A tool to inject entities from Artsdata to footlight
0 stars 0 forks source link

Aggregator contacts #30

Closed saumier closed 9 months ago

saumier commented 11 months ago

Support event contact info coming from Aggregator.

saumier commented 11 months ago

@sahalali Please confirm the payload needed by Aggregator https://docs.google.com/document/d/1AOUiZD3wh-J3M1UDpwBjMhBZm2HfhM_8_NgWCy74LLg/edit?disco=AAAAwUVoXxg

sahalali commented 11 months ago

Confirming the payload for the contact point. This should work from the footlight aggregator for Events.

saumier commented 11 months ago

@sahalali I have added contactPoint to the response from Artsdata.

"contactPoint": { "uri": "http://kg.footlight.io/resource/gatineau-cloud_43528#ContactPoint_0", "email": "girard.audrey@gatineau.ca", "name": { "fr": "Ville de Gatineau" }, "telephone": "311" }

Please check that this is being loaded in the CMS via the aggregator.

sahalali commented 10 months ago

Verified that the contact points are successfully getting loaded from the aggregator. However, I couldn't review the place or organization since I couldn't find any place or organization with a contact point linked.

Here are a few events that I verified:

Event ID Same as URL
6495d06195ffd60064aaeac5 {"uri":"http://kg.artsdata.ca/resource/K23-584"}, {"uri":"http://kg.footlight.io/resource/gatineau-cloud_43598"}
6495a91b95ffd60064aa96fa {"uri":"http://kg.artsdata.ca/resource/K23-586"}, {"uri":"http://kg.footlight.io/resource/gatineau-cloud_43609"}
6495a92095ffd60064aa9761 {"uri":"http://kg.artsdata.ca/resource/K23-588"}, {"uri":"http://kg.footlight.io/resource/gatineau-cloud_43600"}
6495a92495ffd60064aa97c8 {"uri":"http://kg.artsdata.ca/resource/K23-590"}, {"uri":"http://kg.footlight.io/resource/gatineau-cloud_43502"}
6495a92c95ffd60064aa986e {"uri":"http://kg.artsdata.ca/resource/K23-593"}, {"uri":"http://kg.footlight.io/resource/gatineau-cloud_43499"}
6495a92e95ffd60064aa98ad {"uri":"http://kg.artsdata.ca/resource/K23-594"}, {"uri":"http://kg.footlight.io/resource/gatineau-cloud_43602"}
troughc commented 10 months ago

Tested by checking the contacts on the source site - looks good to me. cc @saumier @sahalali

saumier commented 10 months ago

@sahalali Most look good but there are some events not getting through like this event that has 2 contacts. http://kg.footlight.io/resource/gatineau-cloud_43464

Since we don't support 2 contacts in the CMS, we can choose just 1 contact to load, until a later time when we support multiple contacts. It is a fairly rare case.

I looked into Datadog and there are lots of errors like this: Batch 1 :: (8/10). Error while adding Event [object Object]TypeError: Cannot read properties of undefined (reading 'length')

So I am setting this as a bug, and asking if you can fix the errors, even though I don't know if the error is related to "contacts" and/or other properties.

I suspect that the aggregator code should handle cases when the name-value pairs are sometimes lists and sometimes singletons. This is common in JSON-LD and hard for me to control in JSON because I am counting on JSON-LD which makes no difference between a singleton and a list array.

It is also hard to know which event is causing the error. I suggest you add the event id to the error message so we can trace the data back to the source.

You can see my Datadog search here: https://app.datadoghq.com/logs?query=service%3Afootlight-aggregator%20AND%20%28%22Successfully%20synchronised%22%20OR%20%22Fetch%20Events%20From%20Artsdata%22%20OR%20%22Fetching%20taxonomies%22%20OR%20%22Error%22%29%20&cols=host%2Cservice&event=AgAAAYomYnkZiq4z0wAAAAAAAAAYAAAAAEFZb21ZbmtaQUFCT2IwVWRpdXZSR2dBQQAAACQAAAAAMDE4YTI2NzktMmFiNy00OTQwLTlmNTQtYmI1Njc3ZGRmYWNk&index=%2A&messageDisplay=inline&saved-view-id=2004329&stream_sort=time%2Casc&viz=stream&from_ts=1692804494777&to_ts=1692890894777&live=true

Artsdata call for the above event: http://api.artsdata.ca/query?sparql=query_footlight_event_uri&uri=http://kg.footlight.io/resource/gatineau-cloud_43464&frame=event_footlight&format=json&source=http://kg.artsdata.ca/culture-creates/footlight/gatineau-cloud

sahalali commented 10 months ago

I’ve taken a look into this. Modified aggregator to load the first contact point if the contactPoint from artsdata is a list. Verified that the events with multiple contact points are handled in the aggregator. Reference:

Event URL :

  1. {"uri":"http://kg.artsdata.ca/resource/K23-671"}, {"uri":"http://kg.footlight.io/resource/gatineau-cloud_43464"}
  2. {"uri":"http://kg.artsdata.ca/resource/K23-680"}, {"uri":"http://kg.footlight.io/resource/gatineau-cloud_43539"}
saumier commented 9 months ago

@sahalali There are still many errors in the Aggregator log reported by Datadog that make it difficult to know why the aggregator does not seem to be working with event types or contact info.

An example error is Batch 16 :: (1/10). Error while adding Event [object Object]InternalServerErrorException: Some thing went wrong

This tells me nothing about which entity failed. Can you add the entity id. Thx.

saumier commented 9 months ago

@sahalali Thanks for adding the entity Id that has the error. I'll close this issue and check the messages the next time the aggregator runs.