Page MenuHomePhabricator

Properties from external data (SPARQL) overwrite default properties (GeoJSON) even if the value is empty
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Create a map with both properties in the GeoJSON and a SPARQL query that gets properties from external. See example below.
  • Preview or save the map.

What happens?:
Empty external data properties overwrite the default ones. In this example: Some pins do not have any markers (see left side of screenshot below).

What should have happened instead?:
Only properties with values should overwrite the default ones. In this example: All markers should have a default marker (circle), that gets overwritten with the specific ones (museum) if applicable (see right side of screenshot below).

Other information (browser name/version, screenshots, etc.):

Screenshot from 2022-11-21 17-03-09.png (1×1 px, 524 KB)

Example that has default properties (GeoJSON) and properties via external data (SPARQL):

<mapframe text="Geopoints via sparql" width="300" height="300" zoom="13" align="left" latitude="43.735011" longitude="7.413197">
{
  "type": "ExternalData",
  "service": "geopoint",
  "query": "SELECT DISTINCT ?id ?geo (IF(?type = wd:Q33506, 'museum', '') AS ?marker_symbol) WHERE { ?id wdt:P17 wd:Q235; wdt:P31 ?type; wdt:P625 ?geo.} LIMIT 50",
  "properties": {
  "marker-size": "large",
  "marker-symbol": "circle",
  "marker-color": "#FF5733",
 }
}
</mapframe>

Event Timeline

We discussed this in story time and an alternative approach could also be to include the default value in the query itself and making the default value unnecessary. This would already be possible with the current implementation and lead to the wanted result.

<mapframe text="Geopoints via sparql" width="300" height="300" zoom="13" align="left" latitude="43.735011" longitude="7.413197">
{
  "type": "ExternalData",
  "service": "geopoint",
  "query": "SELECT DISTINCT ?id ?geo (IF(?type = wd:Q33506, 'museum', 'circle') AS ?marker_symbol) WHERE { ?id wdt:P17 wd:Q235; wdt:P31 ?type; wdt:P625 ?geo.} LIMIT 50",
  "properties": {
  "marker-size": "large",
  "marker-symbol": "circle",
  "marker-color": "#FF5733",
 }
}
</mapframe>

It appears like this is also relevant when the data source is a .map file. See https://www.mediawiki.org/wiki/Topic:X9housqzewy7d294.