A QGIS plugin to export geographic vector layers as RDF triples in Turtle (.ttl) format, enabling integration with linked data ecosystems.
Part of the QGISParQL suite — see also Triple2Layer.
Layer2Triple converts QGIS vector layers (points, lines, polygons) into RDF (Resource Description Framework) data using the GeoSPARQL standard. Users can map layer attributes to ontology concepts, define namespaces and prefixes, and export the results as Turtle (.ttl) or XML files ready for ingestion into triple stores or linked data portals.
The plugin bridges GIS and Semantic Web workflows, enabling geospatial data to be published as linked open data.
- Export QGIS vector layers to RDF Turtle (
.ttl) or XML format - Load custom OWL vocabularies from remote URLs to map layer attributes
- Map attributes to ontology properties (Constant Value, Layer Attribute, or Vocabulary)
- Define base URL, RDF type, and namespace prefix for generated resources
- Save and reload export configurations as JSON files
- Filter and select specific features or all features in the layer
- Generate unique resource identifiers (UUID) or use an existing layer attribute as ID
- Group observations into a named dataset (
qb:DataSet) via constant aggregations
- QGIS 3.0 or higher
- Python 3.x (tested on Python 3.10–3.12)
- Python packages:
rdflib
- Open QGIS and go to Plugins → Manage and Install Plugins
- Search for
Layer2Triple - Click Install
- Download or clone this repository
- Copy the folder to your QGIS plugins directory:
- Linux:
~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ - Windows:
%APPDATA%\QGIS\QGIS3\profiles\default\python\plugins\
- Linux:
- Restart QGIS and enable the plugin under Plugins → Manage and Install Plugins
QGIS does not install external Python packages automatically. You must install them manually in your QGIS Python environment to avoid ModuleNotFoundError.
Open the OSGeo4W Shell as Administrator and run:
pip install rdflibOpen your terminal and run:
pip install rdflib --break-system-packagesrdflib
- Open a QGIS project containing at least one vector layer
- Go to Vector → QGISParQL → Layer2Triple
- Select the layer to export in the Layer dropdown
- (Optional) Load an OWL vocabulary via Vocabulary → Load Vocabulary
- Click Load Layer to populate the attribute table
- Map each attribute by selecting a concept and its type (Constant Value, Layer Attribute, or Vocabulary)
- Set the Base URL, Prefix, and RDF Type for the output resources
- (Optional) Save the configuration via Settings → Save for reuse
- Click Save and choose the output file path
For a full walkthrough with screenshots, see the documentation.
@prefix obs: <https://purl.org/dbcells/observation#> .
@prefix geo: <http://www.opengis.net/ont/geosparql#> .
@prefix dbc: <https://purl.org/linked-data/dbcells#> .
obs:a1b2c3d4 a qb:Observation ;
dbc:resolution 8.3e-02 ;
geo:asWKT "Polygon ((-34.83 -6.92, ...))" .Triple2Layer — the companion plugin that imports SPARQL query results from triple stores back into QGIS as vector layers.
- Sérgio Souza Costa — @profsergiocosta — sergio.costa@ufma.br
- Nerval Junior — @nervaljunior
Universidade Federal do Maranhão (UFMA) — LambdaGeo Research Group
If you use this plugin in your research, please cite:
@software{costa2024layer2triple,
author = {Costa, Sérgio Souza and Junior, Nerval},
title = {Layer2Triple: A QGIS Plugin for Exporting Geographic Data as RDF Triples},
year = {2024},
url = {https://github.com/LambdaGeo/qgisparql-layer2triple}
}This project is licensed under the GNU General Public License v2.0 — see the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request.