sgbr_facet_values
sgbr_facet_valuesBreak a query down by one dimension to list each facet value with its record count, helping you discover valid filter values and build cross-tab slices.
Instructions
Read sgbr_guide before your first search. Break a query down by one dimension, returning each value with its count. Dimensions include library, language, publication year, author, genre, and topic. Counts are scoped to the query (and any filters / ranges) so they agree with sgbr_search. The year facet is an overlapping density profile; if warnings appear, verify exact totals with sgbr_search. Facet one dimension while filtering on another to build a cross-tab slice. Some dimensions (notably object_type) store "no value" as an empty bucket: those records are reported as absent_records, excluded from coverage_pct, and cannot be reached by a filter on that dimension — so read a value's absence as evidence only across matching_records.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"facet": "<facet>"
},
"name": "sgbr_facet_values"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Max number of values to return, the most frequent first (max 200). Ignored for "year", which always returns the full per-year distribution in chronological order. | |
| facet | Yes | Which dimension to break down. One of: library (holding library), language (language), resource_type (type of the original resource), genre (genre), publication_place (place of publication), subject_heading (catalogued subject heading; OR the German and English forms, which barely overlap (only the German carry a GND id)), subject_area (rule-based subject classification derived from the call number (enrichment)), topic (broad subject auto-derived from the call number (enrichment)), availability (type of data available in the portal (full text / metadata-only / external scans / single foldout page)), scan_source (platform or institution providing the scans (a record may list several)), object_type (object type: monograph (work/Werk), multivolume work (multivolume/Mehrbändig), volume (Band), or single foldout page (foldout/Einzelseite)), foldout_type (foldout content category — ~50 German terms (Karten, Tabellen, …) adapted from the Library of Congress Thesaurus for Graphic Materials (AI enrichment)), genre_ai (genre predicted by the ZB-Lab AI model (18 labels, high-confidence predictions only); ~4x the coverage of the catalogued `genre` (enrichment)), content_flags (~15 pipeline flags (IMAGE_ON_PAGE, CHAPTER_START, …) plus thousands of German volume-designation strings — not a controlled vocabulary (enrichment)), volume_info (volume designation within a multivolume work), parent_record (id of the parent record, gathering one work's volumes; filter the facet's BARE digits, never the id991… form), author (author), year (publication year). | |
| query | No | Free-text query the facet is computed over (same symbolic-Lucene rules as sgbr_search; empty = whole corpus). Counts match what sgbr_search would return for the same query/scope. | |
| scope | No | Restrict the query to one field group (same as sgbr_search). | all |
| exclude | No | Drop records carrying ANY of these values, per dimension (same keys and exact values as `filters`). Unlike a filter it keeps records with no value for that dimension, e.g. the untyped records filters.object_type can never reach. A misspelled value silently excludes nothing — take values from sgbr_facet_values. | |
| filters | No | Narrow the population the facet counts over, by dimension (same keys/values as sgbr_search). Values within one dimension are OR-ed; different dimensions AND. Dimension values are exact facet values — discover them with sgbr_facet_values facet=<dim> — except object_type, whose enum lists friendly keys. Note: subject_area, topic, foldout_type, genre_ai, content_flags are machine-derived enrichments, not catalogued data. | |
| year_to | No | Only records published in or before this year (inclusive publication-date range). | |
| pages_max | No | Only records with at most this many page images (see pages_min). | |
| pages_min | No | Only records with at least this many page images (a multivolume work counts all its volumes'); records without scans are excluded. | |
| year_from | No | Only records published in or after this year (inclusive publication-date range). With facet="year" the buckets are trimmed to the range. | |
| full_text_only | No | If true, count only digitised items that have machine-readable full text. | |
| ocr_quality_min | No | Only records whose OCR quality score (0–100, mostly 90–95) is at least this; records without their own scan (multivolume parent works, metadata-only records) are excluded. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| facet | Yes | ||
| query | Yes | ||
| scope | Yes | ||
| values | Yes | ||
| returned | Yes | ||
| warnings | No | ||
| query_total | Yes | ||
| coverage_pct | Yes | ||
| multi_valued | Yes | ||
| others_count | Yes | ||
| absent_records | Yes | Records indexed with an empty value for this dimension: excluded from matching_records and coverage_pct, and unreachable by any filter on it. null = no such bucket among the returned values — if others_count is high, raise `size` before trusting a 100% coverage_pct. | |
| full_text_only | Yes | ||
| applied_filters | No | ||
| distinct_values | Yes | ||
| matching_records | Yes | ||
| same_dimension_filter | Yes | True when the SAME dimension being faceted is also narrowed by `filters`. RDV excludes a dimension's own filter from its own aggregation, so values[], matching_records, distinct_values and others_count are then counted as if that filter were unset: your query still scopes them, this dimension no longer does, so they are not the intersection you asked for. coverage_pct is null for this reason. query_total, and every other dimension's narrowing, remain correct; to intersect two values of one dimension use inclusion-exclusion over sgbr_search (A + B - union). |