Skip to content
GuidesPlaygroundDashboard

Execute a SPARQL query

SparqlResult Query.Sparql(QuerySparqlParamsparameters, CancellationTokencancellationToken = default)
POST/api/v1/sparql

Execute a SPARQL query

ParametersExpand Collapse
QuerySparqlParams parameters
required string query

SPARQL query string

ReturnsExpand Collapse
class SparqlResult:

GeoJSON FeatureCollection of SPARQL query results

required IReadOnlyList<GeoJsonFeature> Features

GeoJSON features from SPARQL query

required GeoJsonGeometry Geometry
required Coordinates Coordinates

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
IReadOnlyList<Double>
IReadOnlyList<IReadOnlyList<Double>>
IReadOnlyList<IReadOnlyList<IReadOnlyList<Double>>>
IReadOnlyList<IReadOnlyList<IReadOnlyList<IReadOnlyList<Double>>>>
required Type Type
One of the following:
"Point"Point
"LineString"LineString
"Polygon"Polygon
"MultiPoint"MultiPoint
"MultiLineString"MultiLineString
"MultiPolygon"MultiPolygon
required IReadOnlyDictionary<string, JsonElement> Properties
required Type Type
string ID

Feature identifier (type/osm_id)

Long OsmID

OpenStreetMap ID

required Type Type

Execute a SPARQL query

QuerySparqlParams parameters = new() { Query = "query" };

var sparqlResult = await client.Query.Sparql(parameters);

Console.WriteLine(sparqlResult);
Returns Examples