whodb_platform_ontology_query
Query ontology rows with filters, search, joins, grouping, and metrics to answer data questions, avoiding manual paging through row results.
Instructions
Query ontology rows with filters, search, joins, grouping and metrics. Use this to answer data questions instead of paging through whodb_platform_ontology_rows.
where grammar: {"status":"open"}, {"amount":{"gte":100}}, {"_or":[{"region":"EU"},{"region":"UK"}]}. Operators: eq, neq, gt, gte, lt, lte, contains, icontains, isnull. group_by + metrics (count, count_distinct, sum, avg, min, max) return one row per group. The server scans at most scan_limit rows (default 1000, max 5000) before filtering, so totals on large entities may be partial; use whodb_platform_ontology_aggregate for exact SQL totals. Policy-protected ontologies reject this query; fall back to whodb_platform_ontology_rows. Results are capped by limit and the MCP --max-rows setting. Accepts workspace {host, org, project} for per-call targeting without changing defaults.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | Result ordering | |
| joins | No | Join other ontologies by matching properties | |
| limit | No | Maximum rows to return | |
| where | No | Filter object: {prop: value}, {prop: {op: value}}, or {_and: [...]} / {_or: [...]}. Ops: eq, neq, gt, gte, lt, lte, contains, icontains, isnull. | |
| entity | Yes | Ontology apiName (not id). List with whodb_platform_ontologies. | |
| fields | No | Optional top-level output fields to include | |
| offset | No | Row offset | |
| search | No | Free-text search across searchable properties | |
| metrics | No | Metrics to compute, usually with group_by | |
| group_by | No | Properties to group by; pair with metrics | |
| workspace | No | Optional target for this call only. Omit to use the session default set by whodb_platform_session_use, then process/saved defaults. Discover targets with whodb_platform_hosts, whodb_platform_orgs and whodb_platform_projects. | |
| scan_limit | No | Rows scanned before filtering (default 1000, max 5000). Raise for large entities; use whodb_platform_ontology_aggregate for exact totals. | |
| search_fields | No | Restrict search to these properties |