Nested Requests

Below is endpoints that support the timbr nessted feature:
| Endpoint | Method | Body | Description |
|---|---|---|---|
/timbr/api/query/ | POST | { ontology_name: <ontology_name>, query: <SQL query to run> } | Posts a query and returns results in JSON form |
/timbr/api/q/<ontology_name>/concept/<concept_name>?<filters> | GET | Query a concept in a knowledge graph. A user can optionally specify <filters> for the properties of the concept | |
/timbr/api/q/<ontology_name>/view/<view_name>?<filters> | GET | Query a view in a knowledge graph. A user can optionally specify <filters> for the properties of the view |
Intro
timbr can nest the JSON response (gaining the same benefits of GraphQL using only SQL) and avoid a couple of queries when you need to fetch data from multiple concepts. This can also reduces dramatically the response size comparsed to returning a flat large JSON.
The way timbr automatically nest the results is based on the relationships used in the SQL query. Using relationships in the query and additional JSON format settings you can customize the nested JSON result.
Example 1 - Simple Query without nesting
Request:
curl -X 'GET' \
'https://timbr-sample.company.com/timbr/api/get_ontologies/' \
-H 'Content-Type: application/json' \
-H 'x-api-key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
Response:
- Response code: 200
- Response body:
{
"data": ["timbr_supply_chain", "timbr_user_segmentation", ...],
"status": "success"
}