ckanext-spatial
ckanext-spatial copied to clipboard
Add support for collection column in pycsw db
Recently we added filtering support in pycsw configuration, so CSW endpoint can actually "hide" records similar to what is done with CKAN collections.
In order to be able to replicate this functionality through ckanext-spatial, this fix is needed in order to create an extra boolean field in pycsw db.
@amercader @kindly is this line supposed to be True or False? https://github.com/kalxas/ckanext-spatial/commit/bb4eaae1c03d16fc674ef135479ee854ce302d4c#diff-69a5d5b748545cec489e0254d24fb307R91 My guess is that extras_collection_package_id exists as a parent identifier type thing. The assumption is that collection_package_id means that the record is NOT a collection. Can you please confirm?
Thanks.
if a dataset has an collection_package_id attribute with value, then it is a child record of a particular collection, and these need to be excluded from CSW endpoint which just need to display highlevel records.
thanks @kvuppala this is exactly how this works now.
This fits nicely with pycsw's repository filter feature: http://pycsw.org/docs/latest/repofilters.html
@kalxas Apologies for the really late answer
Just to understand how this works, (sorry if I'm a bit slow), is your goal:
- hide the parent "collection records" from the CSW endpoint
- hide the children datasets that belong to a collection from the CSW endpoint
(This change is specific for data.gov, but I guess that if it is a minor one and still works for default users of ckanext-spatial we can sneak it in. If it's a major change perhaps we need to copy this file over to ckanext-geodatagov where you guys can tweak it as necessary)
@amercader hi,
The goal here is to be able to use the filtering mechanism available in recent pycsw through ckanext-spatial. Both 1 and 2 are now possible. If the collections feature is just for data.gov and nobody else will use it, no problem.
Also, I believe the api query with extras_collection_package_id will work even if this key is missing.
Hello, I know this issue is very old. If we wanted to do this today, is there a way to do it without adding an extra database column and only using pycsw's repository filters?