Skip to content
GuidesPlaygroundDashboard

Execute a SPARQL query

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

Execute a SPARQL query

ParametersExpand Collapse
QuerySparqlParams params
SparqlQuery sparqlQuery
ReturnsExpand Collapse
class SparqlResult:

GeoJSON FeatureCollection of SPARQL query results

List<GeoJsonFeature> features

GeoJSON features from SPARQL query

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
Optional<String> id

Feature identifier (type/osm_id)

Optional<Long> osmId

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;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        PlazaClient client = PlazaOkHttpClient.fromEnv();

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