Questions about geospatial tutorial

Dear Stardog support,

I just started to use Stardog to eventually set up a knowledge graph with some geospatial features.

For the very first steps I followed your "Stardog geospatial" tutorial ( Stardog Geospatial | Stardog Documentation Latest ) and downloaded your example data ( stardog-tutorials/stardog-geospatial/dclandmarks.ttl at master · stardog-union/stardog-tutorials · GitHub ). Then I switched to Studio, created a new database (with the "spatial.enabled" flag enabled!) and imported the example data to the default graph. After that the database has 65 edges. I also added the additional namespaces that are used in that data file.

Then I opened a new workspace tab with this query:

SELECT * WHERE {
?s ?p ?o .
}
LIMIT 1000

This shows 65 results.

The example query from the tutorial

prefix geo: http://www.opengis.net/ont/geosparql#
prefix geof: http://www.opengis.net/def/function/geosparql/
prefix : http://blog.stardog.com/geons/

SELECT ?geom ?feature {
?f a :Location ;
rdfs:label ?feature ;
geo:hasGeometry ?geom .
?geom geof:within ("POINT(-77.111 38.855)"^^geo:wktLiteral "POINT(-77.052 38.885)"^^geo:wktLiteral) .
}

shows 2 results. That all looks fine.

When I click an entry in the 65 results table from the first query and choose "Visualize" it switches to Explorer and I see one triple (in this case: "Location" - "type" - "Washington Monument"). Now I don't understand several things:

  • I thought that when I double click on "Location" that the other landmarks will also appear!?
  • In general: Double clicking on "Location" or "Washington Monument" does not show anything. I expected the see the "geo:*" links...
  • When I perform an "empty search" (with "All v" on the left of the input field) I get "No results". This happens in both "List" and "Graph" view.
  • According to the documentation ( Stardog Explorer | Stardog Documentation Latest ) Explorer should display the Location instances on a map. But in my case no map is displayed.

Am I doing something wrong?

Thanks a lot for your help!

P.S.: I just saw: GeoSparql queries not working - #3 by NielsHoffmann
Do I also have a licence problem?

Hi Markus,

Everything looks as expected, but you’re missing a model, which is required for Explorer to navigate your data.

I’ve attached a model that should work for you. Download the geoModel.trig file.

In Studio, go to:
Database → Admin → Load Data, then browse to the file.

The Load Data dialog will populate the remaining fields automatically (because it is a .trig file), so there’s no need to change them.

Then in Explorer, run the query

This will find the all Location that have Geometry. You can then click the map icon to view the locations on a map.

Thanks

Joe

geoModel.trig (1.5 KB)

Hi Joe,

great, that works!

Thanks a lot,
Markus

1 Like

Hi Joe,

one additional question: I managed to visualize locations from your dataset, but no areas (nor my own "street" = WKT-linestring). Is it possible to also draw these elements in the Explorer map?

Thanks!

Markus,

Explorer’s map view is really geared towards showing locations as points on the map. It doesn’t currently render geometries like areas (polygons/envelopes) or lines (e.g. LINESTRING) as shapes on the map.

That said, with some creativity you could use points to represent your objects

  • represent an area using a few key points (e.g. corners or centroid)

  • sample points along a line to give a visual sense of it

Thanks

Joe

Here for example flight paths are represented as positions at 1 min intervals, with point diameter proportional to 1/altitude. Larger points are lower altitude. You can see aircraft landing and taking off.

OK, I understand. No problem, and good to know. I will create a QGIS plugin to read and visualize these geometries on a map…