comunica / jQuery-Widget.js

🖼 A jQuery widget to query heterogeneous interfaces using Comunica SPARQL
http://query.linkeddatafragments.org/
MIT License
18 stars 35 forks source link

Show geo-results on a map #85

Closed rubensworks closed 3 years ago

rubensworks commented 3 years ago

Every time we receive results containing WKT geo results, we should show them on a map. This map should only become visible, as soon as there is at least one WKT string present in the results.

We should show this map before the raw "Query results".

Technology-wise, we can use Leaflet.js, for which its documentation explains how to visualize WKT strings.

Concretely, we should do the following:

  1. [ ] Check results and find strings annotated with a WKT datatype (http://www.openlinksw.com/schemas/virtrdf#Geometry or http://www.opengis.net/ont/geosparql#wktLiteral)
  2. [ ] Once at least one WKT string is found in the results, display a Leaflet map above the query results (because it's hidden by default)
  3. [ ] For each incoming result (they come in in a streaming way), show it live on the map.
  4. [ ] As a next step, also allow custom labels to be added to points/shapes on the map. This could be done in a similar way to Yasgui's geo plugin. For example, if the WKT string was present in a variable ?wkt, then we should look for a variable ?wktLabel; and if it exists, use that as a label for displaying this result on the map.
  5. [ ] Figure out how to handle this for GraphQL-LD results instead of SPARQL results.

Query examples:

Inspired by https://triply.cc/docs/yasgui#geo