Hi Remy,
Yes, this is very helpful. Thank you!
My use case consists of looking through a list of providers, selecting one and then querying specific datasets and/or objects that are tied to that particular provider.
Now, the API documentation doesn't say as much, but your answer indicates that there are two possible roads you can take to implement this.
1/ Using facets:
Just start looking through all the available objects using this query:
The 'facets' parameter will also return the "PROVIDER" facet which holds an array or list of available providers. Using the value in the 'label' property of an item, you can drill down the results to a particular provider like this:
2/ Using providers.json and/or datasets.json
First you enumerate the available providers:
Then you select a particular provider and you retrieve the related dataset(s)
Finally, you can query for the specific objects in the dataset(s):
Remarks regarding both use cases:
If your use case consists of implementing a faceted search user interface, then the first approach is a good way of querying the API. You get all the data you need (objects, facets, etc.) and you can easily drill down. Suppose you don't implement a fully fledged faceted search UI, but instead you are building an UI that targets specific datasets directly, then this is a less desirable approach. Why?
- In the first call, you want to enumerate the list of available providers. You're using search.json but you are only using the data in the "facets" property. The default data in the "items" property is likely not going to be used in such an application and could be considered as "waste" in this context.
- The API reuses the "label" value as an argument to the PROVIDER qf in the second call. However, the value is just that: a name, not an unique identifier. Are there guarantees that this call would yield an exhaustive list of relevant results? For one, I've noticed that my organisation is denoted with various names in the API:
... which makes all the difference if you would inadvertently try to use the value from provider/<objectId>.json in the search.json call.
The second approach would be preferable here:
- Use a specific resource call to retrieve specific resource information (provider > datasets)
- Use of the unique ID of the dataset or provider to filter the data unambiguously using the europeanaCollectionName filter.
Anyhow, thanks for your response!
With regards,
Matthias Vandermaesen