Seeking Further Guidance: API for Dataset Count on Open Data Site

450
4
Jump to solution
12-05-2023 02:15 PM
JuneAcosta
Occasional Contributor III

Hello ArcGIS Hub community,

I hope this message finds you well. I've been exploring this forum for solutions, but unfortunately, I haven't come across a definitive answer to my specific query. We would like to show the current count of datasets on our Open Data site, and I've seen suggestions about using the API to retrieve a list of datasets.

However, what I'm specifically looking for is a way to programmatically obtain the count of datasets without having to parse through the entire list. It's crucial for us to keep this count updated in real-time to provide an accurate reflection of our Open Data offerings.

If any of you have experience or insights into achieving this, I would greatly appreciate your input. Additionally, if there are existing discussions or resources on this topic that I might have missed, please point me in the right direction.

Thank you all for your time and assistance.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
NFlourish
Occasional Contributor

We've done this - there are few options.

1. Use a Python Notebook to build the stats and save them to, for example, a hosted feature table.

2. Use the DCAT feed in Hub/OpenData and parse the resultant JSON to count things.

 

We built the Python Notebook approach to populate the stats for the Experience Builder embed at the bottom of this page: https://opdgig.dos.ny.gov/pages/engage

Screenshot 2023-12-05 at 5.30.04 PM.png

Reach out to @mhaley_stone_env if you need more deets than the general idea.

View solution in original post

0 Kudos
4 Replies
NFlourish
Occasional Contributor

We've done this - there are few options.

1. Use a Python Notebook to build the stats and save them to, for example, a hosted feature table.

2. Use the DCAT feed in Hub/OpenData and parse the resultant JSON to count things.

 

We built the Python Notebook approach to populate the stats for the Experience Builder embed at the bottom of this page: https://opdgig.dos.ny.gov/pages/engage

Screenshot 2023-12-05 at 5.30.04 PM.png

Reach out to @mhaley_stone_env if you need more deets than the general idea.

0 Kudos
JuneAcosta
Occasional Contributor III

This is exactly what I need. I reached out to you directly to get the details. Thank You!

0 Kudos
AndrewTurner
Esri Contributor

This is a great question! @NFlourish has a nice suggestion using the Python notebook to call the DCAT feed or the OGC API. 

 

That said, we should make this easier within Hub. And fortunately we're working on it! Let me share what we're thinking and see if it fits this need (and others).

We've been updating the Summary Statistic card. Currently you can see the new design and includes the long-standing "Dynamic Metrics" and "Static metrics".

We're working on more sources including what we're referring to as "Delegated Metrics". These are counts of statistics from other Items. This could include "count of items of type Dataset", but also "sum of downloads of type PDF" or "sum of views of Apps tagged 'trees'". 

Please let us know if this concept and terminology makes sense to you for this use case. 

And to @NFlourish screenshot - we can consider summary statistics on Groups / Users as well as "gallery" configuration that sorts by these attributes (most download, most viewed, ...)

JuneAcosta
Occasional Contributor III

All of this sounds good! The updates to the Summary Statistic card, especially the "Delegated Metrics," seem like they'll fit our needs. Count me in! Any idea when this cool functionality will be up and running?

0 Kudos