Visualize geospatially linked data

When a SPARQL query returns data that contains geometries, you can explore the results of the query visually using the Geo tab in the GraphDB Workbench. The Geo tab visualizes data using OpenStreetMaps and OpenTopoMap and can render results as points, lines, or polygons. The results can be styled through the SPARQL query itself using custom SPARQL properties.

Activation criteria

The Geo tab is only accessible if a SPARQL query returns geospatial data which contains a value with any of the following datatypes:

  • http://www.opengis.net/ont/geosparql#wktLiteral

  • http://www.openlinksw.com/schemas/virtrdf#Geometry

  • http://www.opengis.net/ont/geosparql#geoJSONLiteral

  • http://www.opengis.net/ont/geosparql#gmlLiteral

  • http://www.opengis.net/ont/geosparql#kmlLiteral

  • http://www.opengis.net/ont/geosparql#dggsLiteral

  • http://www.opengis.net/ont/geosparql#geoCodeLiteral

When activated, the plugin iterates over all SPARQL result bindings, identifies geometries (points, line or polygons) and re-renders them using Leaflet.

Styling and interaction properties

You can control the styling and behavior of the rendered elements via special SPARQL binding variables. These variables begin with geo_ and control the color, opacity, and interactions with the different rendered elements. Some of the variables affect each geometry in a different way.

Note

By default, clicking on a rendered geometry, a popup opens with all properties bound to that geometry.

SPARQL binding variable

Effect on rendered result, separated by geometry

Point

Line

Polygon

geo_tooltip

If the result has geo_tooltip, hovering on the rendered geometry will display a tooltip with the content of the variable. HTML is permited, but will be sanitized. For multi-geometries and GeometryCollections, the same tooltip is applied to all contained geometries.

geo_popup

If the result has geo_popup, clicking on the rendered geometry will display a tooltip with the content of the variable. geo_popup supports Markdown. HTML is permited, but will be sanitized. For multi-geometries and GeometryCollections, the same tooltip is applied to all contained geometries.

geo_color

Defines the color of the point, unless geo_markerClass is used. Accepts hex values and all default HTML colors.

Defines the color of the line or the border of the polygon. Accepts hex values and all default HTML colors.

geo_opacity

Controls opacity of the point. Accepts values from 0 to 1, where 0 is fully transparent.

Controls the opacity of the line or the border of the polygon. Accepts values from 0 to 1, where 0 is fully transparent.

geo_weight

N/A

Controls the stroke width of the line or the border of the polygon.

geo_fillColor

N/A

N/A

Defines the fill color for the polygon. Accepts hex values and all default HTML colors.

geo_fillOpacity

N/A

N/A

Defines the fill opacity for the polygon. Accepts values from 0 to 1, where 0 is fully transparent.

geo_markerClass

Changes the visualization of a point with an icon from the Remix icon set. Accepts Remix Icon classes. Can be used together with geo_color to control the color of the icon.

N/A

N/A

geo_markerClass

Changes the visualization of a point with a custom icon. Accepts the URL address of the custom icon. Supported file formats are png, jpg, jpeg and webp. color of the icon.

N/A

N/A