Use Wikidata for place names and Wikipedia descriptions

iNat place IDs can now be stored in Wikidata:

https://www.wikidata.org/wiki/Property:P7471

This can be used to create links from iNat to Wikipedia articles in different languages - and to other related websites, information and media, for place names, widgets and other contexts.

A small Wikidata query https://w.wiki/EAz

to show German states on a map with iNat search URLs: https://w.wiki/BMa

1 Like

It looks like many of the places in Germany are well matched, but other countries are sparse. https://w.wiki/gcZ

Can someone point me to a list of iNat places, with IDs and names? If so, I can make a Mix’n’Match set to enable place name matching on a much wider scale.

3 Likes

maybe something could be done with the API? maybe @pisum or @bouteloua can help you

welcome to the Forum.

as far as i know, there’s not an easy way for regular folks to get a list of iNat place ids and names. the closest thing is that you can use the old API (see https://www.inaturalist.org/pages/api+reference#get-places) to get a list of places based on a parent place ID.

but it’s imperfect. for example, you can go to https://www.inaturalist.org/places.json?ancestor_id=1&place_type=state&per_page=100&page=1 to get a list of states in the United States, but then that returns a few additional places that aren’t actually states, except that someone set up a non-state place as a state. so you’ll have to separately filter on admin_level=1 to get just the real states. (the API itself won’t actually allow you to filter on admin_level, but it does provide admin_level in the results.)

i made something a while back that pulls back a list of countries in iNaturalist. so you could use that as a starting point for countries, and you could even adapt it to pull back states, etc.

page: https://jumear.github.io/stirfry/iNat_countries.html
code: https://github.com/jumear/stirfry/blob/gh-pages/iNat_countries.html

2 Likes

Thanks for the reply. So it looks like the API cannot provide the full list without a lot of coaxing. Per https://www.inaturalist.org/pages/api+recommended+practices, I’ll contact help@inat to see if they are willing to provide a bulk export.

1 Like

There are currently nearly 50,000 places on iNat, not sure how many would find a meaningful match to a place on wikidata. Extracting the continent>country>state>county info in manageable chunks with the API is certainly doable.

1 Like

Hi folks, just going to reply to @tobyyy here. We don’t have a good way to get all the iNat place IDs using the API, but we could publish a regularly updated archive of this data. We could just dump relevant data out of the database into a CSV file sans boundaries (~118,700 lines) if that would work. Or, if there’s some kind of standard format for publishing place data like this akin to DarwinCore, we could publish something like that. What would you prefer?

5 Likes

@kueda the CSV would be awesome. There’s no need for boundaries (for my purposes) since with the ID I can point to your place page to enable matching.

@lawnranger There are way more than 50,000 places on Wikidata. I expect that over half of the iNat ones have a direct match. Having matched a number of sets with tens of thousands of entries, I’m confident that it’s best to do the matching all in one place.

3 Likes

For comparison, the taxon matching has nearly reconciled 600k items. That task was easier because of systematic nomenclature, but gives a good sense of what can be done: https://mix-n-match.toolforge.org/#/catalog/238

3 Likes

Three days ago I created redirect pages on Wikipedia. Is this the wrong way?

https://www.inaturalist.org/places/nieuwegein-park-oudegein#abouttab
https://www.inaturalist.org/places/nieuwegein-ijsselbos#abouttab

1 Like

I want to connect

https://nl.wikipedia.org/wiki/Westpark_(Groningen)
About https://www.inaturalist.org/places/groningen-deheld-westpark (tab blad)
https://commons.wikimedia.org/wiki/Category:Westpark_(Groningen) Q100256456

https://nl.wikipedia.org/wiki/Eelderbaan
https://www.inaturalist.org/places/groningen-vinkhuizen-eelderbaan
https://commons.wikimedia.org/wiki/Category:Eelderbaan Q100257347

https://nl.wikipedia.org/wiki/Roege_Bos Q100257307
About https://www.inaturalist.org/places/groningen-deheld-roege-bos-eelderbaan (tabblad)
https://commons.wikimedia.org/wiki/Category:Roege_Bos Q100257307

Let me know if this works for you: http://www.inaturalist.org/places/inaturalist-places.csv.zip

Some of the columns need some explaining, so maybe this needs a metadata file in the zip, but for now it should provide you with a list of iNat place IDs. You can use the slug column to link to the place page on iNat, e.g. https://www.inaturalist.org/places/lonsdale-camp-bush

3 Likes

@ahospers here’s how to do it on Wikidata: https://www.wikidata.org/w/index.php?title=Q100256456&type=revision&diff=1291798322&oldid=1289730848 . That’s what I’m trying to do in bulk. Whether iNat can draw down that info yet for the “Wikipedia description” panel is the next step for others to say.

2 Likes

@ahospers actually it’s even better to use the id: https://www.wikidata.org/w/index.php?title=Q100256456&type=revision&diff=1291800427&oldid=1291798322

1 Like

@kueda Brilliant. The property was set up to use the IDs rather than the slugs, but I see that both work fine. I’ve now set up the Mix’n’Match set: https://mix-n-match.toolforge.org/#/catalog/3900 . In case anyone wants to help out, you’ll need a wiki account first.

3 Likes

Thank you…i will read and wait till ti happens automatically i hope. I have been there and did not understood wahat to do
What is a “Slug” ???
And “Mix’n’Match " ?
I do not know anything but i thought
Give “Eelderbaan” a “Q100257347” number (works for all languages i hope, use in WikiMedia??)
Give “Roege Bos” a " Q100257307)” number (works for all languages i hope)
"Westpark " has “Q100256456” number (works for all languages i hope, use in WikiMedia??)

It seems you know what to do. I know I need a number like Q100256456

https://www.wikidata.org/w/index.php?title=Q100256456&type=revision&diff=1291798322&oldid=1289730848 I need 3 red dots in stead of one image

SLUG: https://forum.inaturalist.org/t/creating-inaturalist-places-and-linking-to-wikidata-using-geojson/12220/17?u=ahospers It might be an idea to use WikiMedia photos of places in stead of Flickr files as Flicker is less popular nowadays i think

Now i am lost. I thought i had to add “Q100256456” to the photos to make them visible in any language. But know it seems there is a category
https://commons.wikimedia.org/wiki/Category:Westpark_(Groningen) Q100256456
without “Q100256456”
How does this work in multiplie languages, espacially Dutch and English (and German)

Can somebody tell me how this works ?
I did not know the parks itself where a seperate category (one week ago) ??

https://commons.wikimedia.org/wiki/Category:Eelderbaan Q100257347
https://commons.wikimedia.org/wiki/Category:Roege_Bos Q100257307

SLUG: https://forum.inaturalist.org/t/creating-inaturalist-places-and-linking-to-wikidata-using-geojson/
It might be an idea to use WikiMedia photos of places in stead of Flickr files as Flicker is less popular nowadays i think

@ahospers Wikidata currently doesn’t affect the Wikipedia descriptions for places in iNaturalist, as far as i know. there’s been some talk here and in other discussions about using Wikidata as way to link iNaturalist places, but i’m not aware of any serious steps toward thinking through pros and cons and what that would actually look like if implemented.

this is currently the right way to do it in iNaturalist, along with the option of changing the place name in iNaturalist to match an existing entry in Wikipedia.

it should be noted however, that there could be a lag of up to 30 days for changes in Wikipedia to be reflected in iNaturalist (see discussion starting from https://forum.inaturalist.org/t/creating-inaturalist-places-and-linking-to-wikidata-using-geojson/12220/16), although this may or may not be improved after this: https://forum.inaturalist.org/t/adding-wikipedia-links-when-an-article-is-created-about-a-taxon/9084/12.

1 Like

FWIW, one impediment is that I personally find the Wikidata SPARQL API pretty mystifying. If someone could provide a working example of how one uses it to, say, retrieve a Wikipedia page URL for a taxon given an iNat taxon ID (or s/taxon/place/ to keep it on-topic), that would help me out a lot. @tobyyy, maybe you could provide an example?

1 Like