Changeset 34811 in osm for applications/editors


Ignore:
Timestamp:
2019-01-08T22:37:06+01:00 (6 years ago)
Author:
simon04
Message:

fix #josm16922 - tag2link: add support for *:wikidata

Location:
applications/editors/josm/plugins/tag2link
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/tag2link/resources/tag2link_sources.xml

    r34810 r34811  
    5454        </rule>
    5555        <rule>
    56             <condition k="wikidata" />
     56            <condition k="(operator:|network:|brand:|architect:|artist:|subject:|name:etymology:)?wikidata" />
    5757            <link name="View Wikidata page" href="https://www.wikidata.org/wiki/%v%" />
    5858        </rule>
  • applications/editors/josm/plugins/tag2link/test/unit/org/openstreetmap/josm/plugins/tag2link/Tag2LinkRuleCheckerTest.java

    r31910 r34811  
    1313
    1414    @BeforeClass
    15     public static void load() throws Exception {
     15    public static void load() {
    1616        Tag2LinkRuleChecker.init();
    1717    }
    1818
    1919    @Test
    20     public void testImageCommons() throws Exception {
     20    public void testImageCommons() {
    2121        final Collection<Link> links = Tag2LinkRuleChecker.getLinks(new Tag("image", "File:Witten Brücke Gasstraße.jpg"));
    2222        assertEquals(1, links.size());
    2323        assertEquals("https://commons.wikimedia.org/wiki/File%3AWitten_Br%C3%BCcke_Gasstra%C3%9Fe.jpg", links.iterator().next().url);
    2424    }
     25
     26    @Test
     27    public void testBrandWikidata() {
     28        final Collection<Link> links = Tag2LinkRuleChecker.getLinks(new Tag("brand:wikidata", "Q259340"));
     29        assertEquals(1, links.size());
     30        assertEquals("https://www.wikidata.org/wiki/Q259340", links.iterator().next().url);
     31    }
    2532}
Note: See TracChangeset for help on using the changeset viewer.