Use Wikidata to link to appropriate Wikipedia articles in all languages

I found this because of this issue with Seek (https://github.com/inaturalist/SeekReactNative/issues/258). Mapping with Wikidata could solve lots of problems, like having local names and Wikipedia links in the appropiate language. With iNaturalist this is important, but in Seek is vital, because most children in the world don’t understand English.

4 Likes

Sorry for the late reply, this fell off my radar.

See the examples below provided by @rdmpage and @andrawaag:

What’s the most efficient and robust mechanism we can give the iNat developers for programmatically looking up a Wikidata QID for a given iNat taxon ID?

A SPARQL query will do it, e.g.

SELECT * WHERE { ?qid wdt:P3151 "342395" . OPTIONAL { ?qid wdt:P225 ?wikidataTaxonName. } }

Where 342395 is the iNaturalist Taxon ID. See: query / query results

If you URL encode the SPARQL query and append it to the URL then you will get a SPARQL result with the init ID (if it exists): https://query.wikidata.org/bigdata/namespace/wdq/sparql?query= Note that the iNat developers will likely want JSON, in which case they’ll want to use content negotiation.

@andrawaag also noted:

I am currently working on a DOI resolver for my upcoming Wikicite talk next wednesday. Happy to create a iNaturalist equivalent. If next week is early enough and the developers don’t mind python, I can add iNat identifier lookup to the Wikidata Integrator like we currently do for PMID and DOI. This is the code that would enable that.

2 Likes

Note that you can also look up directly the list of existing articles in various Wikipedia language editions associated with that Wikidata QID, in a single query.

1 Like

i wonder if this discussion should be merged with https://forum.inaturalist.org/t/use-wikidata-for-place-names-and-wikipedia-descriptions/7702 at this point?

seems like they’re converging (see https://forum.inaturalist.org/t/use-wikidata-for-place-names-and-wikipedia-descriptions/7702/31).

2 Likes

i think this has been implemented in https://github.com/inaturalist/inaturalist/commit/29ec770e47dec9de4b9e65e1293cb4c1e49ab7de. can anyone confirm?

Not sure if it is a function of all mappings not being done between iNat taxon ID and Wikidata, but I’m not seeing it (universally)

‘Ingen matchende artikel fra Wikipedia’ means no matching article from Wikipedia.

It’s Danish if anyone wants to try and replicate.

The species has an English Wikipedia article -> https://en.wikipedia.org/wiki/Familiar_bluet

And the linkage exists in Wikidata -> https://www.wikidata.org/wiki/Q1633993

I switched over to Swedish (even if they spell everything funny :wink: which has a Swedish Wikipedia language article https://sv.wikipedia.org/wiki/Enallagma_civile and the Wikidata mapping, but still get the no matching article message.

So either mappings are not done or it cant resolve it on this taxon, which was literally the first one I opened this morning.

1 Like

Someone had unchecked the box to automatically retrieve Wikipedia articles for Enallagma civile.

image

I checked the box, saved, and get these results:

1 Like

5 posts were split to a new topic: EOL content on About tab