-
Notifications
You must be signed in to change notification settings - Fork 6
RDF resources support and autodetection
Several kinds of RDF resources can be used with the SPARQLing Unicorn QGIS plugin. This page lists how to access different RDF resources.
The autodetection dialog of the SPARQLing Unicorn QGIS plugin allows the detection of RDF contents in:
- SPARQL endpoints
- RDF files
- RDF files accessible on the internet using a URI
To add a new resource, choose the resource type, add a name and its URL or file path, and if necessary, credentials if the file or SPARQL endpoint is behind an HTTP-authenticated server.
Irrespective of the RDF resource, the plugin will attempt an autoconfiguration of the following elements in the knowledge graph:
The SPARQLing Unicorn QGIS plugin can currently detect the following vocabularies being used in a SPARQL endpoint:
- GeoSPARQL 1.0 and 1.1 vocabulary with Well-Known Text (WKT), GeoJSON, GML literals
- Schema.org geo vocabulary with lat/lon properties
- W3C Geo vocabulary with lat/lon properties
The SPARQLing Unicorn QGIS plugin tries to detect namespaces of the respective knowledge graph using the following three queries:
SELECT DISTINCT ?ns WHERE { ?s ?p ?o . BIND(replace(str(?s), \"(#|/)[^#/]*$\", \"$1\" ) AS ?ns )} LIMIT 10
SELECT DISTINCT ?ns WHERE { ?s ?p ?o . BIND(replace(str(?p), \"(#|/)[^#/]*$\", \"$1\" ) AS ?ns )} LIMIT 10
SELECT DISTINCT ?ns WHERE { ?s ?p ?o . BIND(replace(str(?o), \"(#|/)[^#/]*$\", \"$1\" ) AS ?ns )} LIMIT 10
That is, up to ten distinct namespaces for resources in the subject, predicate, and object position are attempted to be detected. If a prefix is known by prefix.cc, the prefix will be registered in the automatically generated endpoint configuration.
Depending on the implementation of the triple store, the execution of these queries may be resource-intensive. Therefore, their execution is optional.
For SPARQL endpoints, in addition to the previously mentioned detection of graph structures, test queries evaluate:
- GeoSPARQL compatibility of the SPARQL endpoint
- SPARQL 1.1 compatibility
The SPARQLing Unicorn QGIS plugin uses RDFLib to process local RDF files. Hence, the query capabilities of local files mimic those of RDFLib. It is possible to load one RDF file or a list of RDF files, which can be selected from a QGIS file widget. If many RDF files are selected, the combined graph of all RDF files will be accessible in the SPARQL Unicorn QGIS plugin. As for writing these lines, the plugin cannot cache parsed RDF files until a restart of QGIS. The files need to be added again when the plugin is restarted.
The SPARQLing Unicorn QGIS plugin uses RDFLib to process resources shared as URIs. Hence, the query capabilities of local files mimic those of RDFLib.
Support for Solid pods might be added in the future and depends on the implementation of a link resolver.
RDF resources can be exported in any format that is supported by RDFLib, but at least in the following formats: