usc-isi-i2 / t2wml

Table to Wikidata Mapping Language
MIT License
22 stars 11 forks source link

Error 500 for suggest annotations endpoint #646

Closed g1eb closed 2 years ago

g1eb commented 2 years ago

I'm getting this error 500 using the suggest annotations endpoint:

error: {
  errorCode: 500,
  errorDescription: "invalid literal for int() with base 10: 'undefined'",
errorTitle: "ValueError"

I've tried it with different files and latest version of t2wml and t2wml-api.

devowit commented 2 years ago

are you passing data_start to the endpoint now? but not including a value?

g1eb commented 2 years ago

I thought we decided to have suggest annotations only return annotations without the layers - and call a different endpoint for the layers separately? Is that still the case?

devowit commented 2 years ago

I didn't realize that was what we decided -- I can go ahead and make that change now, if the frontend is already making the request to the other endpoint?

g1eb commented 2 years ago

I'm not getting this error 500 any more and the guess-blocks endpoint returns just the annotations (not including the layers) - which is what we discussed IIRC.

We then do a separate request to wikify_region to wikify the countries and that request returns the layers with qnode entries in them, it also takes a lot longer. Do we need to send the start and end index to that endpoint?

PS. there was this wikifierError in the response:

"Failed to wikify: Middle East & North Africa (excluding high income),Post-demographic dividend,Late-demographic dividend,High income,IDA & IBRD total,Low & middle income,IDA total,IBRD only,IDA only,IDA blend,Low income,Middle East & North Africa (IDA & IBRD countries),OECD members,Other small states,Pacific island small states,Early-demographic dividend,Middle East & North Africa,Central Europe and the Baltics,Small states,Europe & Central Asia (excluding high income),Middle income,Europe & Central Asia (IDA & IBRD countries),Sub-Saharan Africa (excluding high income),Lower middle income,Upper middle income,Pre-demographic dividend,East Asia & Pacific,East Asia & Pacific (excluding high income),Not classified,East Asia & Pacific (IDA & IBRD countries),Fragile and conflict affected situations"
devowit commented 2 years ago

yes, you should send start/end if you don't want qnodes for the entire sheet to be returned

the wikifierError indicates which cells were not wikified to countries in the causx country dictionary and therefore I just automatically created custom nodes for them. I am not sure if this is something causx cares about, since I'm not sure whether they actually use the Qnodes for anything later on in the pipeline.

devowit commented 2 years ago

(but in any case the wikifier request is expected to take longer than suggest annotations...)

g1eb commented 2 years ago

gotcha, thanks for clarifying! I'll add the start and end indices to the wikifier request.