ad-freiburg / qlever-ui

A user interface for QLever
Apache License 2.0
21 stars 15 forks source link

Minor feature request: Map View (via a link to an already existing web app) #11

Closed hannahbast closed 4 years ago

hannahbast commented 4 years ago

There is now an instance on QLever for OSM data: http://qlever.informatik.uni-freiburg.de/OSM . Here is an example query (the predicate names are preliminary and will change in the very near future):

SELECT ?name ?geometry WHERE {
  ?x <wdt:P31> <osmwiki:node> .
  ?x <osmt:name> ?name .
  ?x <hasGeometry> ?geometry .
}

We have written a preliminary Map UI that can display the results on a map, assuming that the last column contains WKT literals (strings of the form "..."^^geo:wktLiteral). Here is how the Map UI can be called. It simply takes the SPARQL query and the backend URL as parameters:

http://qlever.cs.uni-freiburg.de/mapui/index.html?query=SELECT%20?name%20?geometry%20WHERE%20{?x%20%3Cwdt:P31%3E%20%3Cosmwiki:node%3E%20.%20?x%20%3Cosmt:is_in%3E%20%22Freiburg%20im%20Breisgau%22%20.%20?x%20%3ChasGeometry%3E%20?geometry%20.%20?x%20%3Cosmt:name%3E%20?name%20}%20LIMIT%20100&backend=http://qlever.informatik.uni-freiburg.de/api/osm

Here is the (minor) feature request. Could you add a feature to the QLever UI, so that:

  1. It checks whether the first row of the result contains a literal in its last column that matches "wktLiteral".

  2. If so, provide a button "Map view" (a good position would be to the right of the button that says "Limited to ... results") so that with a click of that button one gets to the map view via the link above, with the parameters "query" and "backend" set correctly.

PS: When this has matured, it will be easy to intergrate this into the QLever UI (so that one can simpy switch between table view and map view on the same page). But for now, it's good enough to have a link to a separate page.

jbuerklin commented 4 years ago

Merged into master in 1198a5b77d90427b922d5b53c8787eac631d8588