Available Views
v_bioprocesses
Note: parents of bioprocesses (aka experiments) have been moved to a separate table called experiments
curl -H "Authorization: Bearer <AUTH0_TOKEN>" \
-H "Content-Type: application/json" \
-X POST \
-d '{"statement": "SELECT * FROM v_bioprocesses LIMIT 1"}' \
https://api.invertbio.com/external/v1/statements/
Common Event Types
DbObservationEvent
DbAdditionEvent
DbRemovalEvent
DbBioprocessPhaseEvent
v_bioprocess_quantity_data
A flat, top-level view of per-bioprocess quantity data — one row per (bioprocess, quantity).
curl -H "Authorization: Bearer <AUTH0_TOKEN>" \
-H "Content-Type: application/json" \
-X POST \
-d '{"statement": "SELECT * FROM v_bioprocess_quantity_data LIMIT 1"}' \
https://api.invertbio.com/external/v1/statements/
Join to bioprocesses via v_bioprocess_quantity_data.bioprocess_id = v_bioprocesses.id.
v_timeseries
curl -H "Authorization: Bearer <AUTH0_TOKEN>" \
-H "Content-Type: application/json" \
-X POST \
-d '{"statement": "SELECT * FROM v_timeseries LIMIT 1"}' \
https://api.invertbio.com/external/v1/statements/
statistics object:
v_timeseries_data
curl -H "Authorization: Bearer <AUTH0_TOKEN>" \
-H "Content-Type: application/json" \
-X POST \
-d '{"statement": "SELECT * FROM v_timeseries_data LIMIT 1"}' \
https://api.invertbio.com/external/v1/statements/
v_quantities
curl -H "Authorization: Bearer <AUTH0_TOKEN>" \
-H "Content-Type: application/json" \
-X POST \
-d '{"statement": "SELECT * FROM v_quantities LIMIT 1"}' \
https://api.invertbio.com/external/v1/statements/
curl -H "Authorization: Bearer <AUTH0_TOKEN>" \
-H "Content-Type: application/json" \
-X POST \
-d '{"statement": "SELECT * FROM v_formulas LIMIT 1"}' \
https://api.invertbio.com/external/v1/statements/
Example formula types:
- Simple references:
A, B
- Basic arithmetic:
(A+B+C)/3, A+B
- More complex:
(A*3)*B/100
- Time-based:
time_derivative_hours(A), time_integral_hours(A*2)
- Advanced statistical:
log_linear_regression(A)
When timeseries is not null: {data: Array<Number>, times_ms: Array<Number>}
v_archived_records
v_experiments
Example Queries
Delta Loads
Request data produced after a given date:
curl -H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-X POST \
-d '{"statement": "SELECT * FROM v_bioprocesses WHERE last_updated_at > '"'"'2024-07-29'"'"' LIMIT 1"}' \
https://api.invertbio.com/external/v1/statements/
Get timeseries updated since a bioprocess was last updated:
curl -H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-X POST \
-d '{"statement": "SELECT * FROM v_timeseries WHERE last_updated_at > (SELECT MAX(last_updated_at) FROM v_bioprocesses)"}' \
https://api.invertbio.com/external/v1/statements/
View Joins
Get bioprocesses associated to a timeseries:
curl -H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-X POST \
-d '{"statement": "SELECT t.*, b.* FROM v_timeseries t LEFT JOIN v_bioprocesses b ON t.bioprocess_id = b.id LIMIT 1"}' \
https://api.invertbio.com/external/v1/statements/
Error States
Timeouts
Long running requests (>30 seconds) will be terminated and return a 504. Modify your query to reduce/chunk the amount of data.
SQL execution errors
No data returned:
{
"data": [],
"status": {
"state": "success",
"message": "Statement executed successfully, but returned no results."
}
}
Non-existent view:
{
"data": [],
"status": {
"state": "error",
"message": "relation \"v_non_existent_view\" does not exist"
}
}
Syntax errors: JSON decode error — be careful about use of single vs double quotation marks.
Unexpected exceptions
{
"data": [],
"status": {
"state": "error",
"message": "Error executing statement"
}
}