#23283 closed defect (fixed)
Support "subject:wikipedia" and other secondary wikipedia links
Reported by: | mnalis | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 23.12 |
Component: | Core tag2link | Version: | |
Keywords: | template_report | Cc: |
Description
What steps will reproduce the problem?
- in the tags panel, one can right-click on
wikipedia
andwikidata
tags, and getView wikipedia article
andView Wikidata item
in the menu respectively, which is good - one can also right click on
subject:wikidata
and getView Wikidata item
, which is good - however, when one right clicks on
subject:wikipedia
, there is no menu item to visit wikipedia page
What is the expected result?
right clicking on subject:wikipedia
(or any of the secondary wikipedia tags like artist:wikipedia
, architect:wikipedia
, brand:wikipedia
etc. any other *:wikipedia
) should allow user to visit wikipedia link, just like it does for secondary *:wikidata
links (and *:url
, *:website
, etc.)
What happens instead?
No menu entry to visit wikipedia page is shown for subject:wikipedia
Please provide any additional information below. Attach a screenshot if possible.
Relative:URL: ^/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2023-08-29 13:38:40 +0200 (Tue, 29 Aug 2023) Revision:18822 Build-Date:2023-08-30 01:30:57 URL:https://josm.openstreetmap.de/svn/trunk Identification: JOSM/1.5 (18822 en) Linux Debian GNU/Linux 12 (bookworm) Memory Usage: 322 MB / 3936 MB (67 MB allocated, but free) Java version: 17.0.8+7-Debian-1deb12u1, Debian, OpenJDK 64-Bit Server VM Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel Screen: :0.0 1920×1080 (scaling 1.00×1.00) Maximum Screen Size: 1920×1080 Best cursor sizes: 16×16→16×16, 32×32→32×32 Environment variable LANG: hr_HR.UTF-8 System property file.encoding: UTF-8 System property sun.jnu.encoding: UTF-8 Locale info: en_US Numbers with default locale: 1234567890 -> 1234567890 Desktop environment: ICEWM Java package: openjdk-17-jre:amd64-17.0.8+7-1~deb12u1 libcommons-compress-java: libcommons-compress-java:- fonts-noto: fonts-noto:all-20201225-1 VM arguments: [-Djosm.home=<josm.pref>] Dataset consistency test: No problems found Last errors/warnings: - 00091.370 E: Failed to locate image '[[Image(pond.png)]]' - 00091.378 E: Failed to locate image '[[Image(oil-palm.png)]]'
Attachments (1)
Change History (10)
by , 13 months ago
Attachment: | subject_wikipedia.png added |
---|
comment:1 by , 12 months ago
Component: | Core → Core tag2link |
---|
I'm disinclined to special case wikipedia.
Please add the P8 ("formatter url") property to the relevant OSM wiki dataitems.
For example, if you query for Key:subject:wikipedia
on https://wiki.openstreetmap.org/wiki/Special:ItemByTitle/wiki, it will go to https://wiki.openstreetmap.org/wiki/Item:Q739 .
Once there:
- Log in to OSM wikipedia
add statement
(bottom of page)- In the
Property
field, enterP8
orformatter URL
and click on the dropdown - Enter the URL that the value should go to, e.g.
https://www.wikidata.org/entity/$1
--$1
is replaced by the key value. - Wait for us to update the tag2link information and do a JOSM release.
See https://wiki.openstreetmap.org/wiki/Data_items#API_access_and_querying on how to get the data item if you don't want to use the linked Special:ItemByTitle page.
comment:2 by , 12 months ago
Firstly, thanks for valuable feedback and instructions!
I'm disinclined to special case wikipedia.
Out of curiosity, why? Aren't the other similar tags special-cased too (e.g. *:wikidata
, *:website
, *:url
)? And if so, how does *:wikipedia
differs from them to qualify for different treatment?
- Log in to OSM wikipedia
Just to verify that you mean OSM wiki at https://wiki.openstreetmap.org/ (OSM MediaWiki instance) here, right (and not actual wikipedia.org)?
I'd like to verify is editing OSM Dataitems the preferred way to go? I'm asking because (although I know next to nothing about Dataitems use on OSM wiki) I've seen some discussions and edits that seem to deprecate those? I could be totally wrong, but I wanted to make sure you're aware of https://wiki.openstreetmap.org/wiki/Proposal:Remove_link_to_Wikidata_from_infoboxes and related activities, and they don't interfere with proposed solution, before I proceed further.
That being said, I'm willing to help and invest effort into it so it gets fixed; but note that I'm very beginner at wikidata.org (and not even that at OSM dataitems!) so this all looks a little over my head.
- Enter the URL that the value should go to, e.g. https://www.wikidata.org/entity/$1 -- $1 is replaced by the key value.
To make sure: In this specific example for Key:subject:wikipedia
(I've looked at https://wiki.openstreetmap.org/wiki/Item:Q828 for inspiration), I should set formatter URL
to https://wikipedia.org/wiki/$1
in https://wiki.openstreetmap.org/wiki/Item:Q739 (just like regular Key:wikipedia
does in Item:Q828
)? And that would (when merged) result in JOSM handling right-click on subject:wikidata
tag showing View wikipedia article
menu item which would correctly handle it (i.e. act in same manner as it does for base wikipedia
tag) ?
And then I repeat this procedure for all other documented Wikipedia links like architect:wikipedia
, brand:wikipedia
, name:etymology:wikipedia
, etc?
What should I do in cases when it is documented on https://wiki.openstreetmap.org/wiki/Key:wikipedia, but the OSM Dataitem search fails to return a result (e.g. Key:taxon:wikipedia
)? I just click create
and add items as similarly-functioning dataitem? Or do I also somehow link it in regular OSM wiki to that Dataitem or do something extra?
Sorry for all the extra questions, but I'd like to avoid creating a mess inadvertently :)
comment:3 by , 12 months ago
I just realized I got distracted before I left work -- I had a response mostly written for you. I'll try to redo that below.
Out of curiosity, why? Aren't the other similar tags special-cased too (e.g. *:wikidata, *:website, *:url)? And if so, how does *:wikipedia differs from them to qualify for different treatment?
These predate inclusion in JOSM core; I don't like special casing stuff since it means I have to special case all of it.
Just to verify that you mean OSM wiki at https://wiki.openstreetmap.org/ (OSM MediaWiki instance) here (and not actual wikipedia.org), right?
Yep.
I'd like to verify is editing OSM Dataitems the preferred way to go?
Yes. The project we use for the tag2link information reads the OSM data items and the main Wikidata source.
I've seen some discussions and edits that seem to deprecate those?
I think those are just deprecations of links between the data items and the osm wiki info boxes. If it is something else, I haven't heard about it.
I'm very beginner at wikidata.org
Everyone is at one point or another.
I should set formatter URL to https://wikipedia.org/wiki/$1
If the $1
is supposed to be replaced by the tag value (tag=foo
-> foo
replaces $1
), then yes.
right-click on subject:wikidata tag showing View wikipedia article menu item
It won't say View wikipedia article
, it will say something like Open wikipedia.org
.
And then I repeat this procedure for all other documented Wikipedia links like architect:wikipedia, brand:wikipedia, name:etymology:wikipedia, etc?
Yes.
What should I do in cases when it is documented on https://wiki.openstreetmap.org/wiki/Key:wikipedia, but the OSM Dataitem search fails to return a result (e.g. Key:taxon:wikipedia)? I just click create and add all items that the similarly-functioning dataitem has? Or do I also somehow link it in regular OSM wiki to that Dataitem, or do something extra?
See osmwiki:Data_items#Item_creation_process
Sorry for all the extra questions, but I'd like to avoid creating a mess inadvertently :)
It is always better to ask questions.
comment:4 by , 12 months ago
Ok, I have now added P8 (formatter URL)
to several dozen (documented on wiki, and undocumented but often used according to taginfo) *:wikipedia
OSM dataitems to point to https://wikipedia.org/wiki/$1
.
So I'll wait for you to update the tag2link information and do a JOSM release. Hopefully it'll work as advertised!
comment:5 by , 12 months ago
example if needed for test: https://wiki.openstreetmap.org/wiki/Item:Q527 (for operator:wikipedia
)
comment:6 by , 12 months ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
It looked good when I ran the update commands on my local copy of tag2link
. Your changes should be in the tag2link
version that will be released in a week or so. At that point, I just have to update the tag2link
dependency that JOSM uses.
comment:7 by , 11 months ago
Your changes should be in the tag2link version that will be released in a week or so. At that point, I just have to update the tag2link dependency that JOSM uses.
Hi @taylor.smock, should this been working in JOSM 18907 (released on 2023-12-07), then?
Because it does not seem to work for me. E.g. if I right click on species:wikipedia
for https://www.openstreetmap.org/way/311980666, I do not get an menu item to open it in wikipedia, even if its dataitem (https://wiki.openstreetmap.org/wiki/Item:Q4482) does seem to contain correct formatter URL.
Is something broken (i.e. I haven't correctly updated the dataitems?), or has there been some delays in the pipeline to include it and it will be included at some later JOSM release (and if the latter, will it happen automatically, or does it need manual action)?
comment:9 by , 11 months ago
Milestone: | → 23.12 |
---|
subject:wikipedia without "View Wikipedia article" in right-click menu