Skip to content
GuidesPlaygroundDashboard

Execute a SPARQL query

query().sparql(QuerySparqlParamsparams, RequestOptionsrequestOptions = RequestOptions.none()) : SparqlResult
POST/api/v1/sparql

Execute a SPARQL query

ParametersExpand Collapse
params: QuerySparqlParams
sparqlQuery: SparqlQuery
ReturnsExpand Collapse
class SparqlResult:

GeoJSON FeatureCollection of SPARQL query results

features: List<GeoJsonFeature>

GeoJSON features from SPARQL query

geometry: GeoJsonGeometry
coordinates: Coordinates

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
List<Double>
List<List<Double>>
List<List<List<Double>>>
List<List<List<List<Double>>>>
type: Type
One of the following:
POINT("Point")
LINE_STRING("LineString")
POLYGON("Polygon")
MULTI_POINT("MultiPoint")
MULTI_LINE_STRING("MultiLineString")
MULTI_POLYGON("MultiPolygon")
properties: Properties
type: Type
id: Optional<String>

Feature identifier (type/osm_id)

osmId: Optional<Long>

OpenStreetMap ID

type: Type

Execute a SPARQL query

package com.plazafyi.example

import com.plazafyi.client.PlazaClient
import com.plazafyi.client.okhttp.PlazaOkHttpClient
import com.plazafyi.models.query.QuerySparqlParams
import com.plazafyi.models.query.SparqlQuery
import com.plazafyi.models.query.SparqlResult

fun main() {
    val client: PlazaClient = PlazaOkHttpClient.fromEnv()

    val params: SparqlQuery = SparqlQuery.builder()
        .query("query")
        .build()
    val sparqlResult: SparqlResult = client.query().sparql(params)
}
Returns Examples