Closed nichtich closed 4 years ago
Well, the issue is actually that the Skosmos API doesn't seem to be well-defined when it comes to the prefLabel
field. If you have multiple languages, it actually returns an array:
But in your example, there is only one language, and instead of an array with one object, it returns an object:
https://api.finto.fi/rest/v1/data?uri=http://www.yso.fi/onto/ysa/Y109755&format=application/json
I will add a check whether the field is an array and if not, wrap it in an array, so that both options are supported.
Fun fact: The same check was already included for altLabel
because the same thing happens there, but apparently I did not realize that it can happen with prefLabel
as well.
Tested with
Fails because at https://github.com/gbv/cocoda-sdk/blob/c70fea4e5ee7dcfea1e4741237bd9ddefa7e3470/providers/skosmos-api-provider.js#L90 the
prefLabel
field is an object instead an array. Same issue in line 114.