Raster extension of Virtual Knowledge Graph (VKG) system Ontop to query over multidimensional raster data in conjunction with relational data in arbitrary domains. Currently it integrates and queries regular gridded (geo) spatial-temporal raster data [OGC Coverage] together with relational data including vector geometrical data, OpenStreetMap (OSM) data and 3DCityGML data. We're constantly enhancing the extension with new robust features to allow the end users to semantically query integrated raster data with relational data of arbitrary domain under the VKG paradigm.
- 4.1. Raster Ontology
- 4.2. GeoSPARQL Ontology v1.1
- 4.3. CityGML v2.0
- 4.4. Quantities, Units, Dimensions and Types (QUDT) Ontology
- 4.5. OpenStreetMap (OSM) Ontology
-
- 5.1.1. Vector Data (DVector)
- 5.1.2. 3DCityGML Data (DCity3D)
- 5.1.2. OSM Data (DOSM)
-
5.2. Raster Data (Darr)
-
Query - List all the 30 meters tall residentials in Munich where average terrain elevation less than 550 meters and average land surface temperature is over 300K, given the following data.
How can someone find an answer to this question if they don't have the required domain knowledge or expertise regarding to handle these many types of spatial data and their respective metadata.
😃 You need OntoRaster to solve this. 😃
Ghosh, A., Pano, A., Xiao, G., Calvanese, D. OntoRaster: Extending VKGs with Raster Data. International Joint Conference on Rules and Reasoning. RuleML+RR 2024. Lecture Notes in Computer Science (LNCS), vol 15183. Springer, 2024.
-
Windows
git clone https://github.com/aghoshpro/OntoRaster --config core.autocrlf=input
-
MacOS and Linux:
git clone https://github.com/aghoshpro/OntoRaster
- Go to https://docs.docker.com/desktop/ and install docker on your favourite OS.
-
For this demo, we assume that the ports
7777
,7001-7010
(used for the RDBMS),8080
(for Array DBMS),8082
(used by Ontop),6060
(prompt success msg and endpoint) are free. If you need to use different ports, please edit the file.env
. -
Open
terminal
orcmd
and navigate to theOntoRaster
repository -
Run the following:
docker-compose -f docker-compose.ontoraster.yml up
-
This command starts and initializes the relational database PostgreSQL with the spatial extension PostGIS. Once the relational database is ready, the array database Rasdaman initiates and imports the raster data.
-
NOTE:
When running Rasdaman in a Docker container, it's important to ensure that your system has sufficient resources (CPU, memory, and disk space) to handle large raster file imports. If you encounter issues, such as failed imports, it may be due to insufficient available memory or other resource constraints. If this issue occurs try closing unnecessary applications or increase docker resource limits. -
This Docker-compose file uses the mapping
vkg/OntoRaster.obda
and ontologyvkg/OntoRaster.owl
.
It becomes available at http://localhost:8082/ under success
in docker desktop (ETC 5 min). Click the link and try out the RasSPARQL queries as shown below,
All RasSPARQL queries described below are also available at vkg/OntoRaster.toml
.
Qi | Description |
---|---|
Q1 | What is the dimension of the input raster dataset? |
Q2 | Perform element-wise operation over cells of an array of an input raster dataset at a particular timestamp with the user-specific operator and operator. |
Q3 | Find spatial average value from the raster dataset over a user-specific vector region at a specific timestamp |
Q4 | Find spatial maximum value from the raster dataset over a user-specific vector region at a specific timestamp |
Q5 | Find spatial minimum value from the raster dataset over a user-specific vector region at a specific timestamp |
Q6 | Find the temporal average value from a user-specific raster dataset over a user-specific vector region between start time and end time. |
Q7 | Find the temporal maximum value from a user-specific raster dataset over a user-specific vector region between start time and end time. |
Q8 | Find the temporal minimum value from a user-specific raster dataset over a user-specific vector region between start time and end time. |
Q9 | Clip a portion of user-specific raster data using the geometry of a user-specific vector region at a particular time and return the clipped array |
Q10 | Clip a portion of user-specific raster data based on the shape of custom vector region at a particular time and return filtered arrays |
We have provided Raster Ontology ontology that describe meta-level information of
For vector data we are using GeoSPARQL v1.1 Ontology introduces classes likes features, geometries, and their representation using Geography Markup Language (GML) and Well-Known Text (WKT) literals, and includes topological relationship vocabularies. GeoSPARQL also provides an extension of the standard SPARQL query interface, supporting a set of topological functions for quantitative reasoning.
We are also using CityGML v2.0 Ontology developed by the University of Geneva for the ontology component of the KG construction phase and further modified by Ding et al., 2024 by adding further classes on addresses (including xAL) and removing object properties with the same IRI as data properties.
The QUDT provides set of vocabularies representing the base classes properties, and restrictions used for modeling physical quantities, measurement units, and their dimensions in various measurement systems originally developed for the NASA Exploration Initiatives Ontology Models (NExIOM) project and now it forms the basis of the NASA QUDT Handbook. QUDT aims to improve interoperability of data and the specification of information structures through industry standards for Units of Measure (UoM)
, Quantity Kinds, Dimensions and Data Types as pointed out by Ray et al., 2011. This OWL schema is a foundation for a basic treatment of units which is considered for Unit of Measurement (UoM)
in this work.
-
Defines classes of objects appearing on maps: roads, railways, water ways, amenities, emergency infrastructure, public transport, shops, tourist attractions, etc. This extensive ontology comprises over 660 classes, delineated according to the established set of OSM tags and their corresponding values. It was developed by Ontology Engineering Group (link).
-
OSMonto: An ontology of OpenStreetMap tags, created with the purpose to ease maintenance and overview of existing tags and to allow enriching the semantics of tags by relating them to other ontologies. It has been developed as a research paper Mihai et al 2011 at University Bremen and DFKI Bremen and was presented at State of the Map Europe SotM-EU'2011 and . An .owl file containing the OSMonto ontology can be viewed in Protégé.
-
Open Street Map integration : This integration creates a simple lookup service to federate against the Open Street Maps (OSM) API, allowing users to reference place names in their ResearchSpace instances. Users can lookup a street address, a city, a country etc. and be able to reference this in their data.
We selected Munich, the capital and largest city of Bavaria State, Germany as our area of interest (AOI) which comprises an approximate area of 5504
**NOTE - Any other AOI with similar kinds of data can be used.
-
This demo utilised 25 districts and 105 sub-districts of Munich as our vector data, downloaded from arcgis.
-
This demo also utilised municipalities in Sweden, Bavaria (Germany), and South Tyrol (Italy) as Areas of Interest (AOI) which comprises approx 500 distinct regions with varying geometry features with other attributes. Check this branch to find more details.
-
Stored in three separate tables such as
dist_25
,dist_105
,region_bavaria
,region_sweden
,region_south_tyrol
in VectorTablesDB database inside PostgreSQL with spatial extension PostGIS. Snapshot of first three tablse are displayed below, -
Same goes for
region_sweden
andregion_south_tyrol
.
- Ideally any user-specific vector data for any region of interest will work by adding relevant mappings.
-
Check Java version 11 or higher
-
Follow the instructions to install 3DCityDB schema that will contain CityGML data in RDBMS
-
Go to 3DCityDB and download the Importer/Exporter installer
.jar
file -
Set up 3DCityDB schema for PostgreSQL as per the instructions here
-
Launching Importer/Exporter link
-
Start the 3DCityDB GUI Wizard
$ chmod u+x 3DCityDB-Importer-Exporter && ./3DCityDB-Importer-Exporter
-
Area of Interest : Munich Metropolitan Area
-
To check how many LOD2 gml files are needed to cover the aforementioned AOI one may go to OpenData and upload text file containing geometry of the AOI in
EWKT
format. -
It will give something like below. One can also download the file
./diagrams/lod2.meta4
which contains all LONGs and LATs for the entire dataset with respective links.
-
Run the following shell script (or gitbash in Windows) to download files (110
.gml
files ~ 6.4 GB in our study)#!/bin/bash for LONG in `seq 674 2 680` do for LAT in `seq 5332 2 5342` do wget "https://download1.bayernwolke.de/a/lod2/citygml/${LONG}_${LAT}.gml" done done
- CityJSON is a JSON-based encoding for storing 3D city models.
- CityGML 2 CityJSON Conversion here
- Drop the converted
.json
file in the CityJSON official online viewer called ninja.
-
clio is a command-line interface program used to edit, marge and validate CityJSON files.
-
Python (version >3.7) is required and using pip
pip install cjio
.
-
GeoFabrik OpenStreetMap Data Extracts : Select your area of interest (AOI) and download OSM data in various formats such as
.osm
,.pfb
,.shp
. -
You can also use CLI tools such as
wget
prcurl
if you have the Bounding Box (BBOX) of AOI- BBOX : [11.3608770000001300,48.0615539900001068,11.7230828880000786,48.2481460580001453]
$ wget -O Munich.osm "https://api.openstreetmap.org/api/0.6/map?bbox=11.2871,48.2697,11.9748,47.9816"
$ wget -O Munich.osm "http://overpass.openstreetmap.ru/cgi/xapi_meta?*[bbox=11.3608770000001300,48.0615539900001068,11.7230828880000786,48.2481460580001453]"
-
Figure 1(e-i) displays the respective raster data over Munich which includes elevation, land surface temperature, vegetation, snow coer and soil moisture.
-
Stored in array DBMS RasDaMan ("Raster Data Manager").
-
Information about the Raster data can be found at NASA's Earth Science Data Systems (ESDS)
- Demo data used for Sweden, Bavaria and South Tyrol can be downloaded direclty from Google Drive
-
Metadata are stored in
raster_lookup
table as shown below. -
Ideally any 3-D gridded raster data of geospatial domain should work with the addition of relevant mappings.
Mappings design is the most crusial user-centric step in generating Virtual Knowledge Graph (VKG). A mapping consist of three main parts: a mapping id, a source and a target.
- Mapping ID is an arbitary but unique identifier
- Source refers to a regular SQL query expressed over a relational database fetching the data from the table using the chosen column name.
- Target is RDF triple pattern that uses the answer variables from preceding SQL query as placeholders and described using Turtle syntax
Here we have provided the actual mappings for the demo vector and raster dataset (D).
For vector data we simply substituted the table name sample_regions_of_interest
with actual table names kept in RDBMS including region_sweden
, region_bavaria
, region_south_tyrol
displaying vector data (500+ unique regions) for municipalities of Sweden, Bavaria (Germany) and South Tyrol (Italy) respectively.
User can add their own vector data by writing their own mappings in similar fashion shown below.
The Region class includes any usecase-specific regions of interest (ROI), such as municipalities, provinces, countries, administrative boundaries, and so on, together with their geometries and other features.
- Target
:region/sweden/{gid} a :Region .
- Source
SELECT gid AS regionId FROM region_sweden
- Target
:region/demo/{regionId} rdfs:label {regionName}^^xsd:string .
- Source
SELECT gid AS regionId, name_2 AS region_name FROM region_sweden
- Target
:region/demo/{regionId} geo:asWKT {regionWkt}^^geo:wktLiteral .
- Source
SELECT regionId, CASE WHEN ST_NumGeometries(geom) = 1 THEN ST_AsText(ST_GeometryN(geom, 1)) ELSE ST_AsText(geom) END AS regionWkt FROM region_sweden
- Target
:raster/{rasterId} a :Raster .
- Source
SELECT raster_id AS rasterId FROM raster_lookup
- Target
:raster/{rasterId} rasdb:rasterName {rasterName}^^xsd:string .
- Source
SELECT raster_id AS rasterId, raster_name AS rasterName FROM raster_lookup
Please visit the official website of Ontop https://ontop-vkg.org for more details on Virtual Knowledge Graphs and https://doc.rasdaman.org/index.html for more details on array databases.