Modify

Opened 5 years ago

Last modified 5 years 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 years ago.

Download all attachments as: .zip

Change History (8)

by simon04, 5 years ago

Attachment: screenshot_id.png added

comment:1 by simon04, 5 years ago

Description: modified (diff)

comment:2 by simon04, 5 years ago

Description: modified (diff)

comment:3 by Klumbumbus, 5 years ago

related to #17842

comment:4 by simon04, 5 years ago

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 by nyurik, 5 years ago

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 by simon04, 5 years ago

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 by nyurik, 5 years ago

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 Traefik proxy supports it.

Last edited 5 years ago by nyurik (previous) (diff)

Modify Ticket

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

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.