gbv / jskos-server

Web service to access JSKOS data
https://coli-conc.gbv.de/api/
MIT License
6 stars 4 forks source link

Add properties parameter to concept endpoints #18

Closed stefandesu closed 6 years ago

stefandesu commented 6 years ago

Allow choosing properties to load with a comma-separated list in parameter properties (see also DANTE documentation). This is especially interesting for loading narrower concepts without the /narrower endpoint.

stefandesu commented 6 years ago

Properties narrower and ancestors are now handled for all concept endpoints. Because no other properties currently require any extra processing and are returned by default, I consider this issue closed.

With this feature, we could really improve loading times in Cocoda when a concept that is not yet integrated in the tree is chosen. By using the /ancestors endpoint with parameter &properties=narrower, we would need only one request to get all the information to be able to integrate the concept in the tree. Examples:

One scenario where this would be slower though (at least in DANTE) is when almost all of the ancestors and their children were already loaded. The currently implementation in Cocoda would only load children for those ancestors where the children were not yet loaded. This still requires more API requests than the examples above, so I'd suggest to use the request like above to reduce the number of requests and (on average) the loading times.