Skip to main content

Crate spargeo

Crate spargeo 

Source
Expand description

§spargeo

Latest Version Released API docs Crates.io downloads actions status Gitter

spargeo is a partial GeoSPARQL 1.1 implementation for Oxigraph.

Its entry point is the GEOSPARQL_EXTENSION_FUNCTIONS constant that lists GeoSPARQL extension functions ready to be registered in spargebra or oxigraph query evaluators.

Current scope covers the three OGC Simple Features, Egenhofer, and RCC8 topology families, the planar boolean set operations (intersection, union, difference, symmetric difference), the DE-9IM relate tester, the topological accessor functions (dimension, coordinateDimension, spatialDimension, isEmpty, isSimple), the envelope, convexHull, and centroid constructors, the asGeoJSON serialiser, and partial metric functions (area, length, perimeter, distance). WKT and GeoJSON inputs are honoured under the CRS84 reference system only. Geometry returning functions echo the input datatype so that WKT inputs yield geo:wktLiteral outputs and GeoJSON inputs yield geo:geoJSONLiteral outputs. No aggregate or transformation functions. No GML, KML, DGGS literals. No query rewrite extension.

§Coverage vs OGC 22-047r1

Function IRIs live under http://www.opengis.net/def/function/geosparql/ and are abbreviated as geof: below. Conformance class names follow the spec.

§Topology Vocabulary Extension: Simple Features

FunctionStatus
geof:sfEqualsimplemented
geof:sfDisjointimplemented
geof:sfIntersectsimplemented
geof:sfTouchesimplemented
geof:sfCrossesimplemented
geof:sfWithinimplemented
geof:sfContainsimplemented
geof:sfOverlapsimplemented

§Topology Vocabulary Extension: Egenhofer

FunctionStatus
geof:ehEqualsimplemented
geof:ehDisjointimplemented
geof:ehMeetimplemented
geof:ehOverlapimplemented
geof:ehCoversimplemented
geof:ehCoveredByimplemented
geof:ehInsideimplemented
geof:ehContainsimplemented

§Topology Vocabulary Extension: RCC8

FunctionStatus
geof:rcc8eqimplemented
geof:rcc8dcimplemented
geof:rcc8ecimplemented
geof:rcc8poimplemented
geof:rcc8tppiimplemented
geof:rcc8tppimplemented
geof:rcc8ntppimplemented
geof:rcc8ntppiimplemented

§Non-topological query functions

FunctionStatusNotes
geof:distancepartialthree arg form with units IRI. Haversine, CRS84, point to point only
geof:buffermissingthree arg form with radius and units
geof:convexHullpartialplanar QuickHull over CRS84 input, not a true spherical hull
geof:boundarymissing
geof:envelopepartialaxis aligned bounding rectangle in CRS84 coordinates
geof:intersectionpartialplanar boolean intersection over CRS84 input
geof:unionpartialplanar boolean union over CRS84 input
geof:differencepartialplanar boolean difference over CRS84 input
geof:symDifferencepartialplanar symmetric difference over CRS84 input
geof:getSRIDpartialalways returns the CRS84 URI because only CRS84 is parsed
geof:relateimplementedthree arg form with DE-9IM intersection matrix pattern

§Accessor functions

FunctionStatusNotes
geof:dimensionimplementedreturns xsd:integer topological dimension
geof:coordinateDimensionimplementedalways 2 because only CRS84 is parsed
geof:spatialDimensionimplementedmatches geof:dimension because 3D inputs are not supported
geof:isEmptyimplemented
geof:isSimplepartialuses geo::Validation as a conservative approximation
geof:hasSerializationmissing
geof:asGMLmissing
geof:asGeoJSONimplementedreturns the GeoJSON rendering as geo:geoJSONLiteral
geof:asKMLmissing
geof:asSVGmissing

§Metric functions

FunctionStatusNotes
geof:areapartialgeodesic unsigned area, CRS84 only, square_metre and square_kilometre units
geof:lengthpartialhaversine length, CRS84, linear geometries only (Line, LineString, MultiLineString), returns zero for other types
geof:perimeterpartialhaversine length around polygon exteriors, CRS84 only, returns zero for non polygonal geometries
geof:centroidpartialarithmetic centroid in CRS84 coordinates, not geodesic

§Aggregate functions

FunctionStatus
geof:aggBoundingBoxmissing
geof:aggBoundingCirclemissing
geof:aggCentroidmissing
geof:aggConcaveHullmissing
geof:aggConvexHullmissing

§Transformation

FunctionStatusNotes
geof:transformmissingreproject a geometry to a target CRS

§Geometry literal datatypes

DatatypeStatusNotes
geo:wktLiteralpartialparsed via the wkt crate. Only the CRS84 reference system is honoured; other <uri> prefixes are rejected
geo:geoJSONLiteralpartialparsed via the geojson crate
geo:gmlLiteralmissing
geo:kmlLiteralmissing
geo:dggsLiteralmissing

§CRS support

CapabilityStatus
CRS84 inputimplemented
EPSG:4326 input (axis swap)missing
Arbitrary CRS via <uri> prefixmissing
Reprojection via geof:transformmissing

§Feature and geometry vocabulary

The Core conformance class defines classes such as geo:Feature, geo:Geometry, geo:SpatialObject, and properties such as geo:hasGeometry, geo:hasDefaultGeometry, geo:defaultGeometry, plus the serialization properties geo:asWKT, geo:asGML, geo:asGeoJSON, geo:asKML, geo:hasSerialization. spargeo ships these IRI constants in the vocab module.

§Query Rewrite Extension

CapabilityStatusNotes
Function form (FILTER(geof:sfWithin(?g1, ?g2)))implementedvia the Simple Features functions above
Property form (?a geo:sfWithin ?b)missingwould require a rewrite pass in the query planner

§Conformance class summary

Conformance classStatus
Corepartial via oxigraph IRI handling plus vocab constants and ontology stub
Topology Vocabulary Extension (SF)implemented
Topology Vocabulary Extension (Egenhofer)implemented
Topology Vocabulary Extension (RCC8)implemented
Geometry Extensionpartial via accessor and boolean set functions
Geometry Topology Extension (SF)implemented
Geometry Topology Extension (Egenhofer)implemented
Geometry Topology Extension (RCC8)implemented
RDFS Entailment Extensionmissing (upstream reasoner scope)
Query Rewrite Extensionmissing

§License

This project is licensed under either of

  • Apache License, Version 2.0, (LICENSE-APACHE or <http://www.apache.org/licenses/LICENSE-2.0>)
  • MIT license (LICENSE-MIT or <http://opensource.org/licenses/MIT>)

at your option.

§Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Oxigraph by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Modules§

vocab
GeoSPARQL 1.1 vocabulary constants.

Constants§

GEOSPARQL_EXTENSION_FUNCTIONS
GeoSPARQL functions in name and implementation pairs