You can find all datasets in a socrata site like this:
/data/?tags=parking
How can you find datasets that match one of several tags (OR
)? This doesn't work:
/data/?tags=parking&tags=footpaths
This undocumented method seems to get really close:
/data?search=tags%3Aparking+OR+tags%3Afootpath
That is, you can search for "tags:parking OR tags:footpath". It's "close" because Socrata applies stemming, so it also finds datasets with tags such as "park", but it ranks exact matches higher.
It seems that Socrata has removed boolean queries from more recent deployments, however.
I'm guessing tags are comma separated, because This search returns results with parking and sensors tags: https://data.melbourne.vic.gov.au/data?tags=parking,sensors
Didn't use your example, because there is only one set tagged with footpaths, and it doesn't also have a parking tag.
EDIT: comma separated doesn't do SQL's OR
, but adding &OR
between tag declarations seems to work, like so https://data.melbourne.vic.gov.au/data?tags=parking&OR&tags=sensors
EDIT Two:
this solution shows only sets matching all requirements, not all sets with one requirement. solution provided by @Steve Bennett is the desired OR
solution.
&OR&
method doesn't seem to work. There are 7 datasets tagged "parking", so combining that with sensors should yield more than that. This works better: data.melbourne.vic.gov.au/…
Commented
Oct 4, 2016 at 22:27
No need to use the secret parameters on our /data.json
feed, you can actually use our actually-not-secret Discovery API now!: http://docs.socratadiscovery.apiary.io/#reference/0/searching-particular-categoriestags/category/tag-search-api
Edit: I now understand better what you're looking for. I thought you were looking for an API, but it really looks like you're just looking for options for our data catalog interface.
The tags
parameter can be repeated on that page to AND
together multiple tags. Does that do the job?
https://data.seattle.gov/browse?tags=crime&tags=police%20report
/browse
or /data
catalogs can be filtered is dependent on how that particular customer's site is configured. But they're powered by the Discovery API, so I'd start there to get an idea how they work, or just use the Discovery API directly.
Commented
Oct 11, 2016 at 17:45
?tags=
. For instance data.melbourne.vic.gov.au/data?tags=parking