Wikidata:Property proposal/OpenStreetMap node ID

OpenStreetMap node ID edit

Originally proposed at Wikidata:Property proposal/Place

DescriptionOpenStreetMap node ID
RepresentsOpenStreetMap node (Q42375175)
Data typeExternal identifier
Allowed values[1-9][0-9]{0,10}
Example 1Mount Everest (Q513)8827029797
Example 2Switzerland (Q39)1504546320
Example 3Embassy of Switzerland, Stockholm (Q10663823)372823595
Planned usetransfer all existing OpenStreetMap node IDs from Property:P10689 immediately after property creation
Number of IDs in source8275903044+
Formatter URLhttps://www.openstreetmap.org/node/$1
Single-value constraintyes
Distinct-values constraintyes

Motivation edit

While one of the three types of OpenStreetMap element, namely the OpenStreetMap relation, has their IDs stored in one property that doesn't store an additional prefix, the two other types, namely OpenStreetMap node and OpenStreetMap way, have their IDs stored in a combined property that stores the additional prefixes "node/" or "way/".

The current setup makes data management including querying, preventing wrong data (e.g. via constraint checks) and comparing with external data sets more difficult and requires more storage space.

Moving the OpenStreetMap node IDs to a dedicated property:

  1. results in mapping the IDs of the three subclasses of OpenStreetMap elements to one property each
  2. saves storage space
  3. makes it easier to extract the IDs, e.g. without the need to split strings, and to sort them numerically
  4. allows for an easier statement of the external quantity of IDs in the property page
  5. allows for easier reporting of the quantity of property usage, especially as main statement and easier tracking where not used as main statement
  6. makes it easier to perform constraint checks
    1. e.g. on items of which type an OpenStreetMap node ID can be used (maybe items about roads, streets and rivers shall store only way IDs and those for mountain peaks only node IDs)
    2. e.g. implement a single value constraint check - there should probably be only one node for each item in Wikidata, while there can be several OpenStreetMap ways for e.g. a street.

While in OpenStreetMap more nodes than ways exist, in Wikidata currently fewer node IDs than way IDs are stored. As is currently recommended at Property:P10689 "OpenStreetMap element" to store OpenStreetMap relation IDs instead, if available, the page for the OpenStreetMap node ID could recommend to store OpenStreetMap way IDs instead, if available.

Two lists of all current pairs of items and OpenStreetMap way or node IDs containing the prefix can be obtained via WDQS:

OpenStreetMap related items and properties - names, sources, statistics (OSM: 2023-03-14 00:00:06 UTC, [1])
Item label Item ID Property label Property ID Property usage OSM documentation OSM statistics
OpenStreetMap numeric user ID Q116153645 OpenStreetMap numeric user ID P8754 10 123 236
OpenStreetMap element Q114733246 https://wiki.openstreetmap.org/wiki/Elements 9 214 533 524
OpenStreetMap relation Q100320716 OpenStreetMap relation ID P402 245 977 https://wiki.openstreetmap.org/wiki/Relation 10 755 657
OpenStreetMap way Q100320715 (OpenStreetMap way ID) (P10689) (~16 300) https://w.wiki/6Sgq https://wiki.openstreetmap.org/wiki/Way 927 874 823
OpenStreetMap node Q42375175 (OpenStreetMap node ID) (P11...) (~8 900) https://w.wiki/6Sgv https://wiki.openstreetmap.org/wiki/Node 8 275 903 044
(OpenStreetMap way or node) - OpenStreetMap element P10689 25 301 9 203 777 867

After transfer of values the current Property:P10689 "OpenStreetMap element" (actually "OpenStreetMap way or node ID") can be restricted to way IDs, be renamed to "OpenStreetMap way ID" and the prefix "way/" can be removed.

GeoGQL (talk) 13:02, 14 March 2023 (UTC)[reply]

Differences between the OpenStreetMap element types "node" and "way"
Property node way
single value constraint probably yes not for some types, e.g. streets can consist of multiple "ways"
conflicts with OpenStreetMap relation ID not for some types, e.g. countries probably yes
Wikidata item type probably not for streets and rivers maybe any type is possible
format string probably more digits since more values exist in OSM probably fewer digits since fewer values exist in OSM
reference for coordinates of a point possible less likely since a way may contain coordinates for several points

GeoGQL (talk) 07:21, 16 March 2023 (UTC)[reply]

Discussion edit