Jump to content

WMDE Technical Wishes/Geoinformation/Geopoints via QID

From Meta, a Wikimedia project coordination wiki

Adding Geopoints via Wikidata QID

[edit]

This page is intended to document development progress, research and discussions around the project "Adding Geopoints via QID". Comments and questions are welcome on the talk page!

Description

[edit]

It was already possible to use a QID or a SPARQL query from Wikidata to add a geoline or a geoshape to a map. This is now possible for geopoints as well. (phab:T307695)

When creating a map with Kartographer, I can now use the Wikidata-QID to add a marker to a specific point on the map. More precisely, this means that I no longer have to specify the coordinates of the point, but instead I only have to use the QID of the object.

Example how to add a geopoint via QID

[edit]
Source code (example) Resulting visualization in the article
 <mapframe width="300" height="300" zoom="14" text="San Francisco Museum of Modern Art">
{
"type": "ExternalData",
"service": "geopoint",
"ids": "Q913672"
}
</mapframe>

Of course it is still possible to add a geopoint by using the coordinates of an object.

Adding a geopoint without QID

[edit]
Source code (example) Resulting visualization in the article
 <mapframe width="300" height="300" zoom="14" text="San Francisco Museum of Modern Art"> 
{
  "type": "Feature",
  "geometry": { "type": "Point", "coordinates": [-122.401, 37.7858] },
}
</mapframe>

Advantages and disadvantages

[edit]

The QID is less likely to cause errors because there is no need to enter the coordinates. In addition, the data is collected centrally on Wikidata and thus all changes to the marked object are automatically applied wherever it is used. This means that should the coordinates be changed, for example due to a change of location of an object, this change would automatically be applied on the wiki. However, this also means that once the item has been changed on Wikidata, it will also have changed wherever it is used. There is no automatic notification about the change on the wiki, but it is possible to turn on notifications about recent changes on Wikidata. If you want to undo the change, this must also be done on Wikidata.

What exactly is a QID and where can I find it?

[edit]

The QID is an identifier in the form of a number for a data object at Wikidata (letter "Q" followed by one or more digits, for example Q913672). I can use this number to access the data stored in Wikidata.

There are many different ways to access the QID. For example:

  • Via the Wikidata main page: Enter the name of the object you want to add a marker for in the search field. The QID is the number in brackets after the name of the object.
  • Via a Wikipedia-Article: On the top right of the article page on Wikipedia, next to View History, is the drop down menu Tools, where you will find the option Wikidata item. Clicking on this option will automatically redirect you to the object on Wikidata.

Status and next steps

[edit]

Yes September 26, 2022: Released on all wikis

Feedback

[edit]

Let us know what you think of this feature on the talk page.