# Query ## Execute a multi-step query pipeline `$client->query->execute(list steps): QueryExecuteResponse` **post** `/api/v1/query` Execute a multi-step query pipeline ### Parameters - `steps: list` Ordered list of query steps to execute ### Returns - `QueryExecuteResponse` - `list> steps` Results from each pipeline step in execution order ### Example ```php query->execute( steps: [['type' => 'overpass', 'query' => 'query']] ); var_dump($response); ``` #### Response ```json { "steps": [ { "foo": "bar" } ] } ``` ## Execute an Overpass QL query `$client->query->overpass(string data): FeatureCollection` **post** `/api/v1/overpass` Execute an Overpass QL query ### Parameters - `data: string` Overpass QL query string ### Returns - `FeatureCollection` - `list features` Array of GeoJSON Feature objects - `Type type` Always `FeatureCollection` ### Example ```php query->overpass( data: '[out:json];node[amenity=cafe](around:500,48.8566,2.3522);out body;' ); var_dump($featureCollection); ``` #### Response ```json { "features": [ { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "@id": "bar", "@type": "bar", "amenity": "bar", "cuisine": "bar", "name": "bar" }, "type": "Feature", "id": "node/21154906" } ], "type": "FeatureCollection" } ``` ## Execute a SPARQL query `$client->query->sparql(string query): SparqlResult` **post** `/api/v1/sparql` Execute a SPARQL query ### Parameters - `query: string` SPARQL query string ### Returns - `SparqlResult` - `list results` Array of GeoJSON Features matching the SPARQL query. Features include `@type` and `@id` metadata when the source element type is known, but may contain only tags as properties for untyped results. ### Example ```php query->sparql( query: 'SELECT ?s ?name WHERE { ?s osm:name ?name . ?s osm:amenity "cafe" } LIMIT 10', ); var_dump($sparqlResult); ``` #### Response ```json { "results": [ { "geometry": { "coordinates": [ 2.3522, 48.8566 ], "type": "Point" }, "properties": { "foo": "bar" }, "type": "Feature", "id": "id" } ] } ``` ## Domain Types ### Overpass Query - `OverpassQuery` - `string data` Overpass QL query string ### Sparql Query - `SparqlQuery` - `string query` SPARQL query string ### Sparql Result - `SparqlResult` - `list results` Array of GeoJSON Features matching the SPARQL query. Features include `@type` and `@id` metadata when the source element type is known, but may contain only tags as properties for untyped results.