data.gov icon indicating copy to clipboard operation
data.gov copied to clipboard

Geoplatform data link

Open jbrown-xentity opened this issue 4 years ago • 15 comments

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.

jbrown-xentity avatar Oct 13 '21 22:10 jbrown-xentity

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 avatar Nov 02 '23 18:11 rshewitt

@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.

dlennox24 avatar Nov 02 '23 19:11 dlennox24

@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 avatar Dec 04 '23 17:12 dlennox24

@dlennox24 thanks for the update!

rshewitt avatar Dec 04 '23 17:12 rshewitt

Screenshot 2023-12-04 at 2 24 22 PM

new "Other Data Resources" section on dataset page with link to dataset on geoplatform

rshewitt avatar Dec 04 '23 21:12 rshewitt

this section is under "Metadata Source" but appears to be under "Dates" because of some conditions not being met in the test environment.

rshewitt avatar Dec 04 '23 21:12 rshewitt

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. image

jbrown-xentity avatar Dec 06 '23 16:12 jbrown-xentity

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.

Image

rshewitt avatar Dec 06 '23 22:12 rshewitt

closing original pr in response to change in approach. no longer having ckan make the request in favor of having client make it instead.

rshewitt avatar Dec 07 '23 19:12 rshewitt

geoplatform link grabber function isn't be called leading to the section remaining hidden on a dataset page where it should be visible. Image

rshewitt avatar Dec 12 '23 15:12 rshewitt

It is because some other script bundled in the js was causing error. image 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.

FuhuXia avatar Dec 12 '23 16:12 FuhuXia

I see this issue as closed on the board, should it be closed as a GitHub Issue @rshewitt @btylerburton ?

jbrown-xentity avatar Jan 31 '24 04:01 jbrown-xentity

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.

FuhuXia avatar Feb 16 '24 18:02 FuhuXia

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

btylerburton avatar Feb 20 '24 17:02 btylerburton

@chris-macdermaid says there could be a release of a new/fixed api this week

rshewitt avatar Mar 25 '24 17:03 rshewitt

@rshewitt is there an additional update?

gujral-rei avatar Apr 11 '24 20:04 gujral-rei

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

rshewitt avatar Apr 12 '24 16:04 rshewitt

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

Image

jbrown-xentity avatar Apr 18 '24 13:04 jbrown-xentity