GeoSPARQL support | AllegroGraph 9.0.1
Author: Franz Incorporated

Copyright (c) 2005 - 2026 Franz, Incorporated
Last updated 27 May 2026 at 10:34

# GeoSPARQL support in AllegroGraph 9.0.1

- Documentation Index
  - Release Notes
  - Quick Start
  - SSL/TLS Quick Start
  - Introduction
  - Setup and Configuration
    - Download
    - Server Installation
    - Server Configuration and Control
    - WebView
    - Database Upgrading
    - Managing Users
  - Server Management
    - Performance Tuning
    - Deleting Duplicate Triples
    - Purging Deleted Triples
    - Auditing
    - Managing Users
    - Replication
    - Point-in-Time Recovery
    - Transaction Log Archiving
    - Security Overview
    - Security Implementation
  - Tools
    - agtool
    - Data Loading
    - Data Export
    - Backup and Restore
    - Querying
    - RDFS++
    - Materializer
    - Event Scheduler
    - SHACL
  - Details
    - Triple Indices
    - Freetext Indices
    - Encoded IDs
    - Connection Pooling
    - N-dimensional Geospatial Overview
    - 2-D Geospatial
    - Temporal
    - Social Network
    - JavaScript
    - Datatypes
    - Data Conversion (Rapper)
    - Stored Procedures
    - Triple Attributes
    - Lineparse Format
  - Querying
    - SPARQL documentation summary
    - SPARQL Reference
    - SPIN
    - SPARQL Magic Properties
    - Prolog
  - 3rd-party tools
    - Solr text Indices
    - MongoDB integration
    - TopBraid Composer Plugin
    - Cloudera
  - Client APIs
    - Gruff
    - GraphTalker
    - REST/HTTP interface
    - HTTP reference
    - Javadocs (Sesame and Jena)
    - Python API
    - Lisp Reference
    - JavaScript
  - Tutorials
    - N-dimensional Geospatial
    - SPARQL Tutorial
    - Java Sesame
    - Java Jena
    - Python Sesame
    - Lisp
    - Prolog
    - More...
  - Other
    - Conferences and Seminars
    - Source Code on Github
    - Amazon EC2
    - Copyrights
  - Franz, Inc.

- Introduction

Documentation Index

## Introduction

GeoSPARQL is a standard for representation and querying of geospatial linked data for the Semantic Web from the Open Geospatial Consortium (OGC). It provides:

- A vocabulary for representing geospatial data in RDF.

- An extension to the SPARQL query language for processing geospatial data.

On top of the standard GeoSPARQL functions, AllegroGraph also implemented a few useful extentions, including Geohash indexing as well as proximity queries.

There is a tutorial demonstrating how to use GeoSPARQL in AllegroGraph using AllegroGraph's Python APIs. This tutorial can be found at https://github.com/franzinc/agraph-examples/blob/master/geosparql/geosparql-tutorial.ipynb.

We implement much the functionality specified by the Consortium. Here is a discussion of the implementation followed by a list of what is implemented.

GeoSPARQL contains a small spatial domain OWL ontology that allow literal representations of geometries to be associated with spatial features and for features to be associated with other features using spatial relations. GeoSPARQL also contains SPARQL extension function definitions that can be used to calculate relations between spatial objects. Several other supporting assets are also contained within GeoSPARQL such as vocabularies of Simple Feature types and data validators. The namespace for the GeoSPARQL ontology is

    <http://www.opengis.net/ont/geosparql#>

The suggested prefix for this namespace is `geo`. The namespace for the GeoSPARQL functions is

    <http://www.opengis.net/def/function/geosparql/>

The suggested prefix for this namespace is `geof`. That is, queries should have these prefixes defined:

    PREFIX geo: <http://www.opengis.net/ont/geosparql#>
    PREFIX geof: <http://www.opengis.net/def/function/geosparql/>

See the Namespaces and query options for information on defining namespaces to the system so PREFIXes need not be added to every query.

Here are the implemented features. Each (except the AllegroGraph-specific extensions) is described in detail in the OGC GeoSPARQL - A Geographic Query Language for RDF Data document (search for the name without the prefix).

Serialization format (recognized in AllgroGraph):

- geo:wktLiteral
- geo:asWKT
- geo:geoJSONLiteral
- geo:asGeoJSON

Simple Features Relation Family provided as magic properties

- geo:sfEquals
- geo:sfDisjoint
- geo:sfDisjoint
- geo:sfTouches
- geo:sfWithin
- geo:sfContains
- geo:sfOverlaps
- geo:sfCrosses

Simple Features Relation Family provided as SPARQL functions

- geof:sfEquals
- geof:sfDisjoint
- geof:sfDisjoint
- geof:sfTouches
- geof:sfWithin
- geof:sfContains
- geof:sfOverlaps
- geof:sfCrosses

Egenhofer Relation Family provided as SPARQL functions

- geof:ehEquals
- geof:ehDisjoint
- geof:ehMeet
- geof:ehOverlap
- geof:ehCovers
- geof:ehCoveredBy
- geof:ehInside
- geof:ehContains

RCC8 Relation Family provided as SPARQL functions

- geof:rcc8eq
- geof:rcc8dc
- geof:rcc8ec
- geof:rcc8po
- geof:rcc8tppi
- geof:rcc8tpp
- geof:rcc8ntpp
- geof:rcc8ntppi

Non-topological Query Functions

- geof:isEmpty
- geof:convexHull
- geof:intersection
- geof:union
- geof:difference
- geof:symDifference
- geof:envelope
- geof:centroid
- geof:getSRID
- geof:distance

**Franz's extentions (provided as magic properties. The `geoext` namespace expands to `http://franz.com/ns/allegrograph/3ns-allegrograph-3.0-geosparql-ext.html.0/geosparql/ext#`)

- geoext:haversineDistance
- geoext:buildGeohashIndex
- geoext:rebuildGeohashIndex
- geoext:nearby