teamdigitale / dati-semantic-backend

Backend for the NDC semantic repository
GNU Affero General Public License v3.0
4 stars 5 forks source link

[BE] API in Vocabolari controllati: problem for API related to agency_id:ISTAT & key_concept:cities vocabulary #61

Closed vintra73 closed 11 months ago

vintra73 commented 1 year ago

Comportamento atteso

  1. l'utilizzo del path /vocabularies/{agency_id}/{key_concept} dovrebbe restituire il vocabolario
  2. l'utilizzo del path /vocabularies/{agency_id}/{key_concept}/{id} dovrebbe restituire una specifica voce del vocabolario

Comportamento attuale

in ambedue i casi ottengo HTTP response status codes 404 con messaggio

{
  "title": "Unable to find vocabulary data for : istat.cities",
  "type": "https://www.schema.gov.it/tech/errors/VocabularyDataNotFoundException",
  "status": 404,
  "timestamp": "2022-12-05T19:20:32.533748"
}
vintra73 commented 1 year ago

lo stesso comportamento errato si rileva per:

giufus commented 1 year ago

Confermo, sarebbe utile poter usare questa API o variazioni della stessa (in particolare immagino che lo use case "ricerca per substring del nome comune" sarebbe un' API molto gettonata).

gnespolino commented 1 year ago

seems to work:

https://schema.gov.it/api/vocabularies/agid/service-input-output?limit=10&offset=0

@CreaIstat can be closed.

giorgialodi commented 1 year ago

@gnespolino there exist APIs in production that return 404. For instance, for the provinces vocabulary (see https://schema.gov.it/api/vocabularies/agid/provinces?limit=10&offset=0)

Clou-dia commented 1 year ago

@gnespolino agree with Giorgia. There area several vocabularies API, can we have a general check on all of them? Or do you prefer that we open an issue for every API that doesn't work?

giufus commented 1 year ago

If someone interested, I developed a little poc. Even if just a poc it runs quite well and can be extended to your liking. The goal is performing full text searches on that archive.

https://github.com/giufus/belfiore-search

https://github.com/giufus/belfiore-search-vite-fe

gnespolino commented 1 year ago

@gnespolino agree with Giorgia. There area several vocabularies API, can we have a general check on all of them? Or do you prefer that we open an issue for every API that doesn't work?

@giorgialodi @Clou-dia I've looking at the code trying to understand what's the difference between service-input-output and provinces. As far as I can say, "provinces" was never indexed. What the code in the harvester does is index in "that" way (the way it's used in the controller you're saying has an issue) only when the controlled vocabulary has an associated CSV file. AFAIK it has been like that since ever. The code seems to create a specific index like "agid.provinces" (which index is used in the controller object of this issue) only when there's a CSV file associated with the controlled vocabulary. Now I am just a developer, and I'm not really and expert of Ontologies and Controlled Vocabularies, so I might be wrong, but these seems to be implemented like this exactly as result of a funcional requirement. What I would kindly ask is to make some order in the issues, discuss about it, verify functional behaviour, and only when ideas are clear reach a developer to fix it.

giorgialodi commented 1 year ago

@gnespolino @Clou-dia indeed testing other vocabularies in OntoPiA, the vocabularies that do not work are those for which a CSV is not available (this may happen if someone creates only an RDF version of it which is perfectly admitted). I personally need to re-read the handover document: probably it contains some info about this.

Clou-dia commented 1 year ago

@gnespolino @Clou-dia indeed testing other vocabularies in OntoPiA, the vocabularies that do not work are those for which a CSV is not available (this may happen if someone creates only an RDF version of it which is perfectly admitted). I personally need to re-read the handover document: probably it contains some info about this.

In any case is a KO for the user, so we need to handle this differently probably

gnespolino commented 1 year ago

@gnespolino @Clou-dia indeed testing other vocabularies in OntoPiA, the vocabularies that do not work are those for which a CSV is not available (this may happen if someone creates only an RDF version of it which is perfectly admitted). I personally need to re-read the handover document: probably it contains some info about this.

In any case is a KO for the user, so we need to handle this differently probably

@Clou-dia then we should understand what to return when the user asks for a resource that is not indexed.

Clou-dia commented 1 year ago

Well we are actually trying to prove the hypothesis that without csv the API for vocabularies are not available, if yes then we could create the csv (from the available formats) for all the vocabularies that doesn't have, to make the service work, without giving a KO to to end user. We should either change the rules for new assets.

Clou-dia commented 11 months ago

@gnespolino as tryed in [issue] #232 (https://github.com/italia/daf-ontologie-vocabolari-controllati/pull/232) adding the csv extention to a vocabulary that doen't have one, solve the problem of 404.

I closed this issue and open a new one to solve the problem for all the vocabularies. Cities still don't have the csv file