Geoplatform data link
User Story
In order to provide the best data usage experience for geospatial users, geospatial users want a link to their data represented on Geoplatform.
Acceptance Criteria
[ACs should be clearly demoable/verifiable whenever possible. Try specifying them using BDD.]
- [ ] GIVEN a geospatial dataset exists on data.gov
AND that record has been harvested by geoplatform
WHEN data.gov makes an API call with the package/dataset name to Geoplatform
THEN we get back the necessary information to link the user to the Geoplatform dataset page \
Background
Geoplatform does data display, investigation, and analysis way better than data.gov for geospatial data, but all their metadata comes from data.gov. Creating a link to Geoplatform on data.gov will help data providers find data more quickly, provide better understanding of the geospatial part of the data for users, and show that the Geoplatform and data.gov teams can coordinate to provide value to the public together.
Security Considerations (required)
None
Sketch
Geoplatform is testing an API on their staging site to validate if a package name or ID exists on their side. We would inject this in ckanext-datagovtheme, and it would hit the API to check if a 200 response is returned. If so, use the redirect that has been given (or the response payload, whichever is easier).
From Geoplatform (subject to change): GET https://sit-api.geoplatform.info/v3/public/lookups/data-gov/dataset you can provide one of these query params: id name will respond with either 404 400 - if you didn't include one of the above 200 {"geoplatform_url":"https://sit.geoplatform.info/metadata/13cc2d3c-ad6c-5605-aa5a-1ae484ec66a5"} redirect - doesn't need a value, will send back a HTTP 302 with appropriate Location header set
Working example: https://sit-api.geoplatform.info/v3/public/lookups/data-gov/dataset?name=tiger-line-shapefile-2019-state-alaska-current-alaska-native-regional-corporation-anrc-state-ba
Code changes (sketch)
- [ ] Add section "Other data resources" (near metadata Source section)
- [ ] Add helper function to check if dataset exists on Geoplatform (via API calls above)
- [ ] Add "View this on Geoplatform" link (dependant upon passing helper function)
- [ ] Stylize/add icons if desired.
the geoplatform catalog system is actively being migrated from geonetwork to a custom aws solution so the sit endpoint will often respond with a 500. @dlennox24 mentioned he would provide a link to a working dataset when available
@rshewitt I spoke with the GP team. They are aware and actively working on this. It is a current permission issue with the new infrastructure so I'm not expecting the fix to take too long but don't have a finite ETA at the moment. I'll let you know when they have a solution in place.
@rshewitt This should be more stable now. Though I would recommend doing testing against https://stg-api.geoplatform.gov/v3/public/lookups/data-gov/dataset as sit is an active dev environment and is much more likely to break/go down.
@dlennox24 thanks for the update!
new "Other Data Resources" section on dataset page with link to dataset on geoplatform
this section is under "Metadata Source" but appears to be under "Dates" because of some conditions not being met in the test environment.
I would put this under a unique header between Access & Use and Downloads and Resources, see image. If that's too difficult, you can put it around the Metadata Source.
here's what the "Other Data Resources" section looks like on catalog-dev. @hkdctol what do you think? my browser is configured to dark mode so it'll look different. I used a static link as a placeholder.
closing original pr in response to change in approach. no longer having ckan make the request in favor of having client make it instead.
geoplatform link grabber function isn't be called leading to the section remaining hidden on a dataset page where it should be visible.
It is because some other script bundled in the js was causing error.
The solution is to find and fix the error in the other script, or move the geoplatform.js up in the bundle list to avoid being affected by the other script's error. But do create issue for the other script.
I see this issue as closed on the board, should it be closed as a GitHub Issue @rshewitt @btylerburton ?
The geoplatform server has been broken for a while, all geoplatform links on catalog page return 404. We may ned to consider hide the link until things are fixed on their end.
The work to get the link on a valid dataset was complete, but we should consider reaching out the geoplatform to confirm the status of their server.
This link should be working AFAIK but it's not:
- https://catalog.data.gov/dataset/ncdc-storm-events-database2
- https://api.geoplatform.gov/v3/public/lookups/data-gov/dataset?name=ncdc-storm-events-database2
@chris-macdermaid says there could be a release of a new/fixed api this week
@rshewitt is there an additional update?
new api url: https://api.geoplatform.gov/v3/public/lookups/data-gov/dataset
test example: https://api.geoplatform.gov/v3/public/lookups/data-gov/dataset?name=walkability-index1 api return: https://geoplatform.gov/metadata/4f9b5918-6ca6-43e3-8f9b-dfacb3caa54c
test example2: https://api.geoplatform.gov/v3/public/lookups/data-gov/dataset?name=smart-location-database1 api return: https://api.geoplatform.gov/v3/public/lookups/data-gov/dataset?name=smart-location-database1
This is complete, and live in the wild:
- https://github.com/GSA/ckanext-datagovtheme/pull/194
- https://github.com/GSA/catalog.data.gov/pull/1313
See example here: https://catalog.data.gov/dataset/u-s-daily-climate-normals-1981-20101 Redirects to https://www.geoplatform.gov/metadata/c5f3ba9e-cd2e-43f9-a401-1aba17ee1e73