biotope map
Semantic mapping command group. Replaces the removed biotope describe (intent capture is now an intent flag on map) and the deprecated heuristic biotope propose-mapping (scaffolding is now biotope map scaffold).
The command never auto-picks a record set or fields. All semantic decisions are made by the human or copilot agent against deterministic inspection output.
biotope map (bare)
- No flags: launches the guided wizard. The wizard prompts for the Croissant file or mapping if it can't auto-discover them, captures intent on first run if
project.yamlis empty, walks each unresolved entity / relation slot in order, autosaves after every confirmed edit, and offers inline entity creation when a relation references a not-yet-defined entity. - Any intent flag present — runs non-interactively (agent-friendly):
biotope map --purpose "..." # replace project's purpose
biotope map --entity gene --entity disease # append to required_entities
biotope map --relation gene_associated_with_disease
biotope map --source <path-or-url>
biotope map --notes "..."
biotope map --clear-entities --clear-relations --clear-sources
biotope map --show # print intent + mapping progress
The wizard also offers a --croissant <path> and --mapping <path> option to pin which file to operate on.
biotope map inspect <croissant>
Deterministic inspector for a Croissant dataset. For each record set: name, description, source, field inventory (with scalar / array / struct kind), identifier-like candidates, explode-eligible arrays, and sample rows rendered as vertical key-value blocks. --json produces a stable machine-readable form for agents.
biotope map scaffold <croissant>
Emit an unresolved semantic mapping scaffold:
- top-level
croissant, emptyids entitiesandrelationskeyed byproject.yaml'srequired_entities/required_relations, normalised tosnake_case- a YAML comment appendix at the bottom with the inspector output (record sets, fields, sample rows) so a human or agent can edit the file without re-running inspection
Defaults to mappings/<croissant-stem>.mapping.yaml; pass --out or --stdout to override.
biotope map preview [<mapping>]
Validate a (partial) mapping and project its outputs. Tolerant of unresolved slots — reports them rather than crashing. Output:
- resolved vs unresolved slots
- validation findings (missing record sets, unknown fields, invalid explode targets, illegal
$itemplacement, unresolved endpoints) - projected BioCypher schema (
schema_term,input_label,namespace,represented_as, properties, edge source/target) - sample emitted tuples from resolved sections
--json for agent consumption. The wizard reuses this engine after every confirmed edit.
Agent workflow
Agents bypass the wizard and instead:
- Set intent —
biotope map --entity ... --relation .... - Generate scaffold —
biotope map scaffold <croissant>. - Inspect —
biotope map inspect <croissant> --json. - Edit
mappings/*.mapping.yamldirectly. - Validate —
biotope map preview --json. biotope build.
biotope map — semantic mapping authoring commands.
biotope map(bare) launches the guided wizard, unless any intent flag (--purpose,--entity,--relation,--source,--notes,--clear-*,--show) is present, in which case it applies the edit non-interactively and exits.biotope map inspect <croissant>— deterministic Croissant/data inspector.biotope map scaffold <croissant>— non-interactive unresolved scaffold.biotope map preview [<mapping>]— compile-in-memory preview.
All semantic decisions are made by the user or the editing agent. The CLI never auto-picks record sets or fields.
discover_croissants(project_root)
Return all Croissant metadata files under a project's .biotope/datasets/.
Looks for both *.jsonld (baker output) and *.croissant.json (legacy /
user-supplied) shapes.
Source code in biotope/biotope/commands/map.py
inspect(croissant, as_json, preview_rows)
Inspect a Croissant dataset deterministically.
Source code in biotope/biotope/commands/map.py
map_group(ctx, croissant, mapping_path, purpose, entities, relations, sources, notes, clear_entities, clear_relations, clear_sources, show)
Semantic mapping for a Croissant dataset.
Source code in biotope/biotope/commands/map.py
preview(mapping_path, as_json, sample_rows)
Validate a (partial) mapping and project its outputs.
With no path, previews every mapping under the project's mappings/ dir
(multi-mapping projects are the norm); pass an explicit path to preview
just one.
Source code in biotope/biotope/commands/map.py
scaffold(croissant, out, to_stdout, preview_rows)
Generate an unresolved semantic mapping scaffold for a Croissant file.