-
Notifications
You must be signed in to change notification settings - Fork 4
Distinct Search in ODH Tourism api
https://tourism.api.opendatahub.com/v1/Distinct (currently available on the Test instance, slow due to the DB on testing with little ressources)
-
fields
--> (String) Pass one or more fields. The standard notation is used here Common parameters, fields, language, searchfilter, excludenulloremptyvalues, updatefrom] -
type
--> (String) Pass the type where the search should be done. Documentation about the Type A valid type should be passed otherwise the api returns an Error.
Known Generic ODH parameters:
-
fields
--> (String) odh fieldsfilter Dinstict over this selected fields -
rawfilter
--> (String) odh rawfilter -
rawsort
--> (String) odh rawsort, the only constraint here is that we have to sort on selected fields -
excludenulloremptyvalues
--> (Boolean) remove empty and null values from output default: false
using on a simple string field
https://tourism.api.opendatahub.com/v1/Distinct?type=webcam&fields=Source
https://tourism.api.opendatahub.com/v1/Distinct?type=webcam&fields=_Meta.Source
https://tourism.api.opendatahub.com/v1/Distinct?type=odhactivitypoi&fields=Source
using on arrays
https://tourism.api.opendatahub.com/v1/Distinct?type=webcam&fields=PublishedOn.[*]
https://tourism.api.opendatahub.com/v1/Distinct?type=odhactivitypoi&fields=HasLanguage.[*]
using on arrays of objects (with array fields only one field is allowed)
https://tourism.api.opendatahub.com/v1/Distinct?type=odhactivitypoi&fields=Tags.[*].Id
Multiple Distinct fields (only with non-array fields)
https://tourism.api.opendatahub.com/v1/Distinct?type=webcam&fields=Source,OdhActive
https://tourism.api.opendatahub.com/v1/Distinct?type=odhactivitypoi&fields=Type,Source
Sorting
https://tourism.api.opendatahub.com/v1/Distinct?type=webcam&fields=Source&rawsort=Source
https://tourism.api.opendatahub.com/v1/Distinct?type=webcam&fields=Source&rawsort=-Source
https://tourism.api.opendatahub.com/v1/Distinct?type=odhactivitypoi&fields=Tags.[*].Id&rawsort=Tags.[*].Id
Multiple Sorting
https://tourism.api.opendatahub.com/v1/Distinct?type=odhactivitypoi&fields=Source,SyncSourceInterface&rawsort=Source,-SyncSourceInterface
result
[
{
"PublishedOn.[*]": "idm-marketplace"
},
{
"PublishedOn.[*]": "suedtirol.info"
}
]
paged result By adding pagenumber=1 the result is available paged and wrapped into the standard Result object.
{
"TotalResults": 2,
"TotalPages": 1,
"CurrentPage": 1,
"PreviousPage": null,
"NextPage": null,
"Seed": null,
"Items": [
{
"PublishedOn.[*]": "idm-marketplace"
},
{
"PublishedOn.[*]": "suedtirol.info"
}
]
}
By Adding the parameter getasarray=true
the result is added into an Array without fieldnames.
Example Response
[
"noicommunitycategory",
"eventlocation",
"cuisinecodes",
"idmredactionalcategory",
"ltscategory",
"eventtopic",
"seattype",
"technologyfields",
"dishcodes",
"customtagging",
"categorycodes",
]
This wiki contains additional information about the Open Data Hub alongside the Open Data Hub - Official Documentation 🔗 .