Skip to main content

Module rinf

Module rinf 

Source
Expand description

ERA RINF SPARQL retrieval module (feature 006).

Provides:

  • The SparqlClient trait so production code can hit the real endpoint via UreqSparqlClient while tests inject deterministic fixtures.
  • A tiny inline WKT LINESTRING parser (avoids pulling a wkt crate).
  • Builders for the two SPARQL queries documented in specs/006-download-rinf-topology/research.md.
  • Row-to-core-model mappers that produce Netelement / NetRelation instances ready for downstream workflows.

Structs§

UreqSparqlClient
Default blocking SPARQL client backed by [ureq].

Traits§

SparqlClient
Pluggable SPARQL transport — production uses ureq, tests use mocks.

Functions§

build_netelements_query
Build the netelements SPARQL query for a given closed WGS84 polygon WKT.
build_netrelations_query
Build the netrelations SPARQL query for a list of seed element IRIs.
fetch_netelements
High-level helper: fetch + parse netelements for a search polygon.
fetch_netrelations
High-level helper: fetch + parse netrelations for the given seed IRIs.
linestring_length_meters
Approximate length of a WGS84 LineString in meters (great-circle, equirectangular).
map_netelements_to_core
Map parsed netelement rows to core Netelement structs.
map_netrelations_to_core
Map parsed netrelation rows to core NetRelation structs.
parse_netelements_response
Parse the SPARQL-JSON response for the netelements query.
parse_netrelations_response
Parse the SPARQL-JSON response for the netrelations query.
parse_wkt_linestring
Parse a LINESTRING(...) WKT into a [LineString<f64>].