Inspect a data model¶
inspect-datamodel prints exactly what datamodel would create or update in
EarthRanger — without making any writes. Use it as a sanity check before
running a real sync, or to diff what's in SMART against what's in ER.
When to use it¶
- Before running
datamodelfor the first time against a new CA. - After a SMART data model change, to confirm only the expected event types will be affected.
- To learn what a configurable-model overlay does without committing it.
- To preview the v2 schema and
$refURLs before they hit ER's meta-schema.
File-based or API-based?¶
Reading v2 output¶
For v2 (the default), the output groups event types by category and shows
each event type's fields with their UI types and $ref URLs (for choice
fields):
CA: JKPERU
Event types: 18
active: 18
inactive: 0
- jkperu_incidents_caza_furtiva
display: Caza furtiva
fields:
signo_de_caza: array (ui=CHOICE_LIST/DROPDOWN, enum=...)
acciontomada: array (ui=CHOICE_LIST/DROPDOWN, enum=...)
...
Choice sets: 60
- field: et5e6b96f4_signo_de_caza
options (4):
- rastro: Rastro
- trampa: Trampa
- ...
For each choice-bearing field, you'll see the derived Choice.field name
(the et<hash>_<attr> part). This is what datamodel will POST as
EarthRanger Choice records.
Reading v1 output¶
If you pass --event-type-version v1, the output is closer to v1's inline-
enum format:
CA: JKPERU
Event types: 18
active: 18
inactive: 0
- jkperu_incidents_caza_furtiva
display: Caza furtiva
fields:
signo_de_caza: array (enum=['rastro', 'trampa', 'red', 'cazador'])
...
No separate Choice section — v1 embeds the options directly in the schema.
Tips¶
inspect-datamodelhonors your config'schoices_base_urlso the previewed$refURLs match what a real sync would emit.- Configurable models are supported:
--cm-from-file path/to/cm.xml. - Output goes to stdout, so you can pipe it:
... | grep -A5 mineria.
Related¶
- Push a data model — the real sync
inspect-datamodelCLI reference- Event-type version