Linking Photos as Auxiliary Files
A frequent enrichment task is attaching field photos to the
stratigraphic units they document — without redrawing the graph in
yEd. EMtools supports this through the Auxiliary files
sub-panel of the EM Data Tree: a spreadsheet listing one row per
unit, with a column carrying the photo path (or filename), is
imported via a JSON mapping. The result is a set of graph nodes
whose photo_path (or equivalent) property points at the file on
disk, viewable through the existing thumbnail and document
machinery.
For the conceptual background of auxiliary files (what they are, why they are tabular, and how the JSON mapping is structured) see Auxiliary files — concept and JSON mapping template.
Learning objectives
By the end you will be able to:
prepare a spreadsheet listing photos per US;
write a minimal JSON mapping that binds the
photo_pathcolumn to a graph property;import the spreadsheet as an auxiliary file and verify the attachment in the Visual Manager.
Prerequisites
A loaded
.graphmlgraph in EMtools (any version 1.5).A photo folder reachable via a relative path from the
.blendfile (see EM Data Tree — Setting Up Resource Folders).A spreadsheet (
.xlsx) with one row per US and at least the columns: unit ID and photo filename (or relative path).
Step 1 — Prepare the spreadsheet
Use a simple layout, one US per row. Minimal columns:
Column A |
Column B |
Column C |
|---|---|---|
|
|
|
US001 |
photos/US001_north.jpg |
North face after cleaning |
US002 |
photos/US002_section_a.jpg |
East–west section A |
Keep paths relative to the resource folder (no
C:\\Users\\... or absolute /Users/... entries).
Step 2 — Write the JSON mapping
Save the following next to the spreadsheet as
photos_mapping.json:
{
"version": "1.0",
"sheet_name": "Photos",
"start_row": 2,
"id_column": "A",
"mappings": [
{"column": "A", "target": "human_id", "type": "identifier"},
{"column": "B", "target": "photo_path", "type": "document_link"},
{"column": "C", "target": "caption", "type": "qualia"}
]
}
Adjust sheet_name to match the tab name in your .xlsx.
start_row: 2 skips the header row.
Step 3 — Add the auxiliary file in EMtools
In the EM Data Tree panel:
expand the
Auxiliary filessection and pressAdd;choose EMdb Excel as the type (the JSON-driven importer);
select the spreadsheet from disk;
when the
Formatmenu appears, point it atphotos_mapping.json;press
Accept, then run Import.
Step 4 — Verify the attachment
After import:
open the Stratigraphy Manager and select a unit that was listed in the spreadsheet; the new property (
photo_path,caption) should appear in its property list;if the resource folder has thumbnails generated (EM Data Tree — Generating Thumbnails), the photo preview is reachable from the Visual Manager and from the Document Manager;
check the Blender console for any rows that did not match an existing US — these are reported with the offending
human_idand indicate a typo in the spreadsheet or a missing node in the graph.
See also
Auxiliary files — concept — what auxiliary files are and how they relate to the graph.
JSON mapping template — the JSON mapping schema in detail.
Bulk Import via the Excel Mapping Tool — bulk import with a JSON mapping on a larger dataset.
Auxiliary Resources: pyArchInit and External Data Connections — the live-database variant of the same idea.