User:Danysan

From OpenStreetMap Wiki
Jump to navigation Jump to search

User icon 2.svgDanysan (Danysan95 on osm, edits, contrib, heatmap, chngset com.)

Daniele
osm traces map
Country Italy
Region Emilia-Romagna
City Imola
I use or have experience with the Android and Garmin Edge GPS devices.
I use or have experience with the iD and JOSM editors.
Babel
it Questo utente parla italiano come lingua madre.
en-3 This user is able to contribute with an advanced level of English.
About Me

My website

JOSM Danysan submits data to OpenStreetMap using JOSM.
iD Danysan submits data to OpenStreetMap using iD.
Danysan uses MAPS.ME
OsmAnd icon Danysan uses OsmAnd, mobile map viewing & navigation app.


Hiker Danysan
is a hiker.
Bike Danysan
is a bicyclist.
Hot logo.svg Danysan volunteers at Humanitarian OSM Team.
Mapillary Danysan takes photos for Mapillary as danysan.

My projects

Open Etymology Map

Web map that shows the etymology of names of objects on the map, based on OpenStreetMap and Wikidata:

Emergency assembly point map

App that shows emergency assembly points of the Italian civil protection agency, based on OpenStreetMap:

My proposals

Assembly point purpose

Proposal page: Proposed features/assembly point:purpose

Status: Approved

Affected tags:

LOADING TAG LIST... (If you do not see this tag list, you need to enable Javascript)

This table is auto-generated. See Template:Taglist for a documentation on it.

Top up

Proposal page: Proposed features/Top up

Status: Abandoned

Manufacturer and model

Proposal page: Proposed features/Manufacturer and Model

Status: Proposed

Affected tags:

LOADING TAG LIST... (If you do not see this tag list, you need to enable Javascript)

This table is auto-generated. See Template:Taglist for a documentation on it.

Useful Sophox SPARQL queries

Model inside wikidata=* instead of model:wikidata=*

Query to find historic=* elements where the model of an aircarft/vehicle/... is erroneously linked with wikidata=* instead of model:wikidata=* (problem described in Proposed features/Manufacturer and Model#Current_situation).

#defaultView:Map
SELECT
  ?osm
  ?model
  ?modelLabel
  ?wikipedia
  (GROUP_CONCAT(DISTINCT ?classLabel; SEPARATOR=", ") AS ?classLabels)
  (?type AS ?layer)
  ?coordinates
WHERE {
  hint:Query hint:optimizer "None" . # Prevent optimizer from querying for everything tagged with wikidata=* before querying the service.
  
  # Filter for historic=*
  VALUES ?type { "tank" "vehicle" "aircraft" "ship" "locomotive" "railway_car" "cannon" }
  ?osm osmt:historic ?type;
      osmm:loc ?coordinates.

  {
    ?osm osmt:wikidata ?model.
  } UNION {
    ?osm osmt:wikipedia ?wikipedia.
    SERVICE <https://query.wikidata.org/sparql> {
      ?wikipedia schema:about ?model.
    }
  }

  SERVICE <https://query.wikidata.org/sparql> {
    ?model wdt:P279 ?class. # Filter for subclasses ( => representing a class, not a single object)
    SERVICE wikibase:label {
      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
      ?model rdfs:label ?modelLabel. # Get model name
      ?class rdfs:label ?classLabel. # Get class name
    } 
  }
}
GROUP BY ?osm ?type ?model ?modelLabel ?wikipedia ?coordinates

Run it (edit query)

Bad values for wikidata=*:

SELECT DISTINCT ?model
WHERE {
  VALUES ?type { "tank" "vehicle" "aircraft" "ship" "locomotive" "railway_car" "cannon" }
  ?osm osmt:historic ?type;
       osmm:loc ?coordinates;
       osmt:wikidata ?model.

  SERVICE <https://query.wikidata.org/sparql> {
    ?model wdt:P279 ?class. # Filter for subclasses ( => representing a class, not a single object)
  }
}
ORDER BY ?model

Run it (edit query)

Bad values for wikipedia=*:

SELECT DISTINCT ?wikipedia
WHERE {
  VALUES ?type { "tank" "vehicle" "aircraft" "ship" "locomotive" "railway_car" "cannon" }
  ?osm osmt:historic ?type;
       osmm:loc ?coordinates;
       osmt:wikipedia ?wikipedia.

  SERVICE <https://query.wikidata.org/sparql> {
    ?wikipedia schema:about ?model.
    ?model wdt:P279 ?class. # Filter for subclasses ( => representing a class, not a single object)
  }
}
ORDER BY ?wikipedia

Run it (edit query)

Brand inside wikidata=* instead of brand:wikidata=*

Restaurants and fast foods

Query to find restaurants and fast foods where the brand is erroneously linked with wikidata=* instead of brand:wikidata=* (inspired by Sophox#Current_Challenges).

#defaultView:Map
SELECT DISTINCT ?osm ?chain ?chainLabel ?wikipedia ?loc (?type AS ?layer)
WHERE {
  SERVICE <https://query.wikidata.org/sparql> {
    VALUES ?chainClass { wd:Q18509232 wd:Q18534542 wd:Q76220181 } # Fast food chain / Restaurant chain / Ice cream chain
    ?chain wdt:P31 ?chainClass.

    SERVICE wikibase:label {
      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
      ?chain rdfs:label ?chainLabel.
    }
  }

  VALUES ?type { "bar" "cafe" "restaurant" "fast_food" "food_court" "ice_cream" }
  ?osm osmt:amenity ?type;
       osmm:loc ?loc .

  {
    ?osm osmt:wikidata ?chain.
  } UNION {
    ?osm osmt:wikipedia ?wikipedia.
    SERVICE <https://query.wikidata.org/sparql> {
      ?wikipedia schema:about ?chain.
    }
  }
}

Run it (edit query)

Banks and ATMs

Query to find banks and ATMs where the brand is erroneously linked with wikidata=* instead of brand:wikidata=*. If the wikidata object for the bank has the position set (with P625) the query correctly prevents the headquarters of the bank from showing in the result.

#defaultView:Map
SELECT DISTINCT ?osm ?bank ?bankLabel ?wikipedia ?coordinates (?type AS ?layer)
WHERE {
  VALUES ?type { "bank" "atm" }
  ?osm osmt:amenity ?type;
       osmm:loc ?coordinates.

  {
    ?osm osmt:wikidata ?bank.
  } UNION {
    ?osm osmt:wikipedia ?wikipedia.
    SERVICE <https://query.wikidata.org/sparql> {
      ?wikipedia schema:about ?bank.
    }
  }

  SERVICE <https://query.wikidata.org/sparql> {
    VALUES ?bankClass { wd:Q650241 wd:Q22687 } # banks / Financial institutions
    ?bank wdt:P31 ?bankClass.
    
    OPTIONAL {
      {
        ?bank wdt:P625 ?bankHeadquarters.
      } UNION {
        ?bank p:P159/pq:P625 ?bankHeadquarters.
      }
    }
    
    SERVICE wikibase:label {
      bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
      ?bank rdfs:label ?bankLabel.
    }
  }
  
  BIND(geof:distance(COALESCE(?bankHeadquarters,"Point(0 0)"^^geo:wktLiteral), ?coordinates) AS ?distance).
  FILTER(?distance > 1). # Exclude the headquarters from the result
}

Run it (edit query)