Modify

Opened 5 months ago

Last modified 5 months ago

#18541 new enhancement

Obtain tagging descriptions from OpenStreetMap Wiki item

Reported by: simon04 Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: wikidata wiki Cc: nyurik

Description (last modified by simon04)

  1. Hover row/key opening_hours in PropertiesDialog
  2. JOSM queries https://wiki.openstreetmap.org/w/api.php?action=wbgetentities&format=json&languagefallback=1&languages=en&origin=*&sites=wiki&titles=Locale%3Aen%7CKey%3Aopening%20hours which is the structured data from https://wiki.openstreetmap.org/wiki/Item:Q1667
  3. JOSM extracts "Describes when something is open or closed. …"

Screenshot in iD:

Attachments (1)

screenshot_id.png (57.4 KB) - added by simon04 5 months ago.

Download all attachments as: .zip

Change History (8)

Changed 5 months ago by simon04

Attachment: screenshot_id.png added

comment:1 Changed 5 months ago by simon04

Description: modified (diff)

comment:2 Changed 5 months ago by simon04

Description: modified (diff)

comment:3 Changed 5 months ago by Klumbumbus

related to #17842

comment:4 Changed 5 months ago by simon04

Cc: nyurik added

The following SPARQL query may be used via https://sophox.org/

SELECT ?osmd ?key ?tag ?description WHERE {

  VALUES ?key_or_tag { osmd:Q7 osmd:Q2 }
  ?osmd osmdt:P2 ?key_or_tag.
  OPTIONAL { ?osmd osmdt:P16 ?key }.
  OPTIONAL { ?osmd osmdt:P19 ?tag }.

  ?osmd schema:description ?desc.

  BIND(STR(?desc) AS ?description)
  BIND(LANG(?desc) AS ?lang)
  FILTER (?lang = 'de')
}

However, https://github.com/Sophox/sophox/issues/14 is somewhat critical since the request for all German description transfers >700 KB and does not use gzip.

comment:5 Changed 5 months ago by nyurik

I would rather suggest you use a dedicated label service to get description in a specific language:

SELECT ?osmd ?key ?tag ?osmdDescription WHERE {

  VALUES ?key_or_tag { osmd:Q7 osmd:Q2 }
  ?osmd osmdt:P2 ?key_or_tag.
  OPTIONAL { ?osmd osmdt:P16 ?key }.
  OPTIONAL { ?osmd osmdt:P19 ?tag }.

  SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en". }
}

comment:6 Changed 5 months ago by simon04

I've already tried this variant. However, this query also returns many rows w/o a description. For German the number of results increases from 2k to 20k, and the size from 0.74 MB to 4.91 MB.

comment:7 Changed 5 months ago by nyurik

ah, makes perfect sense, thanks. I will have to look into data compression - I am not sure if Blazegraph supports it, so either i will have to wrap it into yet another proxy, or see if Trafik proxy supports it.

Version 0, edited 5 months ago by nyurik (next)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to simon04
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.