XML Schema Reference#
This page provides automatically-generated documentation for the NexusLIMS XML schema used to represent experimental records.
Introduction#
NexusLIMS generates output experimental records as XML documents that conform to the Nexus Experiment Schema (XSD). These records can then be curated in the NexusLIMS CDCS frontend application, and capture comprehensive metadata about microscopy sessions, including:
Session information: Who performed the experiment, when, and why
Instrument details: Which microscope(s) were used and their configurations
Acquisition activities: Temporal grouping of related data files
Dataset metadata: Comprehensive technical parameters for each file
From Internal to Output XML Representations#
Added in version 2.2.0: Starting with v2.2.0, NexusLIMS uses a two-stage metadata pipeline. This validation and standardization system is still evolving as EM Glossary coverage expands and community standards develop.
Extraction & Validation (Internal): NexusLIMS extractors produce metadata dictionaries validated against internal Pydantic schemas (
NexusMetadata,ImageMetadata,SpectrumMetadata, etc.) with:EM Glossary standardized fields (where available - the vocabulary is still developing)
Physical quantities with units (via Pint)
Basic validation and unit normalization
Serialization to XML: Validated metadata is transformed into XML following the Nexus Experiment Schema with:
Quantity fields → XML elements with
unitattributesExtension fields →
<summary>elements in<nx:extensions>blocksEM Glossary metadata →
emg:display_nameandemg:idattributes on quantity elements (where EMG terms are available)
Example Transformation#
# Pydantic metadata (Python objects)
{
"acceleration_voltage": Quantity(200, "kV"),
"magnification": Quantity(50, "kiloX"),
"extensions": {
"detector_brightness": 50.0,
}
}
Metadata Serialized to XML (within a Dataset element)#
<nx:dataset type="Image" role="Experimental">
<nx:name>micrograph_001.tif</nx:name>
<nx:location>/path/to/data/micrograph_001.tif</nx:location>
<nx:format>image/tiff</nx:format>
<nx:meta name="Acceleration Voltage" unit="kV">200.0</nx:meta>
<nx:meta name="Magnification" unit="kX">50</nx:meta>
<nx:meta name="detector_brightness">50.0</nx:meta>
</nx:dataset>
This two-stage approach provides:
Basic type safety during extraction (Pydantic validation)
Emerging standardization via EM Glossary (where terms are available)
Interoperability through standard XML format
Semantic enrichment with EMG metadata attributes (where EMG IDs are available)
See Internal Metadata Schema System for complete details on the Pydantic schema system and EM Glossary Field Reference for EM Glossary integration.
Nexus Experiment Schema#
The Nexus Experiment schema defines the final output structure of XML records generated by NexusLIMS. Each record describes a microscopy session, including metadata about the experiment, instruments used, and data files acquired.
A metadata schema for describing an experiment utilizing equipment from the Nexus Microscopy Lab.
Schema Structure (Interactive)
The diagram below shows the hierarchical structure of the schema. Pan by clicking and dragging, zoom with the mouse wheel, and click on any type node to jump to its detailed documentation below. You can also hover over nodes to see more information about that element.
Schema Information
Target Namespace: https://data.nist.gov/od/dm/nexus/experiment/v1.0
Version: 1.03-10-2022
Root Elements
- Experiment
nx:Experiment The root element for a document describing an Experiment
Complex Types
Type: Experiment
A description of an experiment using an instrument in Nexus Microscopy Lab
- title
xs:token(optional)The title of this experiment
- id
xs:token(optional)A unique local identifier assigned to this record.
- summary
nx:SummaryA collection of metadata that summarize the overall use and intent of the experiment.
- sample
nx:Sample(optional)A description of a sample examined in this experiment.
- project
nx:Project(optional)A description of a project of which this Experiment is a part.
- acquisitionActivity
nx:AcquisitionActivity(optional)A description of a specific group of data acqusition during this experimental session.
- notes
nx:Notes(optional)Largely unformatted notes taken regarding the current sample
Attributes:
- pid
An unambiguous identifier for this resource description as assigned by its author or its curating registry.
Type: Summary
A collection of metadata that summarize the overall use and intent of the experiment.
- experimenter
xs:token(optional)The name of the user running this experiment.
- collaborator
xs:token(optional)The name of a notable collaborator in the experiment
- instrument
nx:Instrument(optional)The instrument used in this experiment
- reservationStart
xs:dateTime(optional)The start time of this experiment
- reservationEnd
xs:dateTime(optional)The end time of this experiment
- motivation
xs:string(optional)A prose description of the motivation, purpose, or other intent behind this experiment.
Attributes:
- ref
xs:anyURIAn external link to the reservation or metadata record used to populate this Experiment record. Could be a link to a particular reservation in a facility management system, for instance.
Type: Sample
A collection of metadata that describe a sample examined during an experiment.
- name
xs:token(optional)A name for the sample (for display purposes)
- description
xs:token(optional)A description of the sample (where each occurance can be thought of as a separate paragraph).
- notes
nx:Notes(optional)Largely unformatted notes taken regarding the current sample
- elements
nx:PeriodicTableElementType(optional)A list of one or more elements that are present or expected to be present in this sample
Attributes:
- id
xs:stringAn identifier (unique to this document) that identifies the current sample. This can be the sample name if it is unique.
- ref
xs:stringAn external persistent identifier for the current sample the current sample. This can be the sample name if it is unique.
Type: Project
A collection of metadata that describes a project to which an Experiment can belong.
- name
xs:token(optional)A name for the project (for display purposes)
- division
xs:token(optional)The division ID to which this project belongs
- group
xs:token(optional)The group ID within a division to which this project belongs
- project_id
xs:token(optional)The specific project ID within a research group/division
- ref
xs:anyURI(optional)An (optional) link to this project in another database
Type: AcquisitionActivity
A collection of metadata that describe a specific group of acquired data during the Experiment.
- startTime
xs:dateTime(optional)A date and time recorded as the start of this activity. This can be the time of the creation of the of the first dataset.
- sampleID
xs:token(optional)The identifier for the sample that was part of this acquisition activity. This should match a value of the id attribute for a sample element included in this document.
- setup
nx:Setup(optional)Metadata describing the set-up of the instrument during the current Acqusition Activity.
- notes
nx:Notes(optional)Largely unformatted notes taken regarding the current Acqusition Activity
- dataset
nx:Dataset(optional)A file or named set of files that was acquired during the current Acqusition Activity.
Attributes:
- seqno
xs:integerA number that indicates the order that this Acqusition Activity occurred within a sequence of Acqusition Activities.
Type: Notes
Generic content pulled as notes (lightly structured).
- entry
nx:Entry(optional)A section of the notes. Each section can be of a different type with different structural content (e.g. for text, an image, a table, etc.)
Attributes:
- source
xs:stringA label indicating where the notes were extracted from (e.g. “ELN”)
Type: Entry
An entry into a set of notes. This type serves as a base type for different sub-types.
Type: TextEntry
A text entry into a set of notes.
Type: ImageEntry
An image entry into a set of notes.
Type: TableEntry
A table entry into a set of notes.
Type: Table
A single grid of tabular information
- title
xs:token(optional)The title for the table
- header
nx:TableHeaderThe description of the table’s columns
- rows
nx:TableRowsThe main data of the table, organized into rows
Type: TableHeader
A description of a table’s columns
- column
nx:TableColumn(optional)A single column of data in the table
Type: TableColumn
A description of one column in a table
Attributes:
- id
The identifier to assign to this column (for reference by cell elements).
Type: TableRows
The main data body of a table, organized as a sequence of rows.
- row
nx:TableRow(optional)A single row of data in the table
Type: TableRow
A single row of a table
- cell
nx:TableCell(optional)A single cell in a row of a table.
Attributes:
- seqno
xs:integerA number that indicates the order that the row appears in the table.
Type: TableCell
A container for data in one cell of the table.
Attributes:
- colid
The identifier for the column that this cell corresponds to
Type: Setup
Metadata describing the set-up of an instrument (values common to all datasets within an Acqusition Activity).
- param
nx:Parameter(optional)An arbitrary setup parameter with a name and a value
Type: Dataset
A description of a file or set of files.
- name
xs:stringThe name given to the dataset
- location
xs:stringA directory path or URL indicating the location where the dataset is stored
- format
xs:string(optional)A string (can be a MIME type) indicating the format of the dataset (e.g. TIFF, DICOM, Excel).
- description
xs:string(optional)A description of the dataset (where each occurance can be thought of as a separate paragraph).
- preview
xs:string(optional)URL or string path to a preview rendering (thumbnail) of the data in the dataset.
- meta
nx:Parameter(optional)An arbitrary metadatum with a name and a value unique to this dataset
Attributes:
- type
nx:DatasetTypeA label indicating the type of this dataset (taken from a controlled list).
- role
nx:DatasetRoleA label indicating the experimental role of this dataset (taken from a controlled list).
Type: Parameter
A piece of arbitrary metadata featuring a name and a value, unique to a dataset within an Acqusition Activity.
Attributes:
- name
The name of the parameter
- unit
A physical unit associated with the value of this parameter
- warning
booleanA marker to indicate that this parameter may not be reliable (an instrument may have not written it correctly, or it is commonly not filled out properly, etc.)
Type: Instrument
The identification of an instrument in the facility.
Attributes:
- pid
xs:tokenAn unique identifier that identifies the instrument within facility.
- ref
xs:anyURIAn (optional) link to this instrument in another database
Type: PeriodicTableElementType
Allowed periodic table element values. Includes abbreviations from the periodic table up to element number 118. This list was adapted from the Chemical Markup Language schema (http://www.xml-cml.org/schema/schema3/)
- H (optional)
Hydrogen; Atomic number 1
- He (optional)
Helium; Atomic number 2
- Li (optional)
Lithium; Atomic number 3
- Be (optional)
Beryllium; Atomic number 4
- B (optional)
Boron; Atomic number 5
- C (optional)
Carbon; Atomic number 6
- N (optional)
Nitrogen; Atomic number 7
- O (optional)
Oxygen; Atomic number 8
- F (optional)
Fluorine; Atomic number 9
- Ne (optional)
Neon; Atomic number 10
- Na (optional)
Sodium; Atomic number 11
- Mg (optional)
Magnesium; Atomic number 12
- Al (optional)
Aluminum; Atomic number 13
- Si (optional)
Silicon; Atomic number 14
- P (optional)
Phosphorus; Atomic number 15
- S (optional)
Sulfur; Atomic number 16
- Cl (optional)
Chlorine; Atomic number 17
- Ar (optional)
Argon; Atomic number 18
- K (optional)
Potassium; Atomic number 19
- Ca (optional)
Calcium; Atomic number 20
- Sc (optional)
Scandium; Atomic number 21
- Ti (optional)
Titanium; Atomic number 22
- V (optional)
Vanadium; Atomic number 23
- Cr (optional)
Chromium; Atomic number 24
- Mn (optional)
Manganese; Atomic number 25
- Fe (optional)
Iron; Atomic number 26
- Co (optional)
Cobalt; Atomic number 27
- Ni (optional)
Nickel; Atomic number 28
- Cu (optional)
Copper; Atomic number 29
- Zn (optional)
Zinc; Atomic number 30
- Ga (optional)
Gallium; Atomic number 31
- Ge (optional)
Germanium; Atomic number 32
- As (optional)
Arsenic; Atomic number 33
- Se (optional)
Selenium; Atomic number 34
- Br (optional)
Bromine; Atomic number 35
- Kr (optional)
Krypton; Atomic number 36
- Rb (optional)
Rubidium; Atomic number 37
- Sr (optional)
Strontium; Atomic number 38
- Y (optional)
Yttrium; Atomic number 39
- Zr (optional)
Zirconium; Atomic number 40
- Nb (optional)
Niobium; Atomic number 41
- Mo (optional)
Molybdenum; Atomic number 42
- Tc (optional)
Technetium; Atomic number 43
- Ru (optional)
Ruthenium; Atomic number 44
- Rh (optional)
Rhodium; Atomic number 45
- Pd (optional)
Palladium; Atomic number 46
- Ag (optional)
Silver; Atomic number 47
- Cd (optional)
Cadmium; Atomic number 48
- In (optional)
Indium; Atomic number 49
- Sn (optional)
Tin; Atomic number 50
- Sb (optional)
Antimony; Atomic number 51
- Te (optional)
Tellurium; Atomic number 52
- I (optional)
Iodine; Atomic number 53
- Xe (optional)
Xenon; Atomic number 54
- Cs (optional)
Cesium; Atomic number 55
- Ba (optional)
Barium; Atomic number 56
- La (optional)
Lanthanum; Atomic number 57
- Ce (optional)
Cerium; Atomic number 58
- Pr (optional)
Praseodymium; Atomic number 59
- Nd (optional)
Neodymium; Atomic number 60
- Pm (optional)
Promethium; Atomic number 61
- Sm (optional)
Samarium; Atomic number 62
- Eu (optional)
Europium; Atomic number 63
- Gd (optional)
Gadolinium; Atomic number 64
- Tb (optional)
Terbium; Atomic number 65
- Dy (optional)
Dysprosium; Atomic number 66
- Ho (optional)
Holmium; Atomic number 67
- Er (optional)
Erbium; Atomic number 68
- Tm (optional)
Thulium; Atomic number 69
- Yb (optional)
Ytterbium; Atomic number 70
- Lu (optional)
Lutetium; Atomic number 71
- Hf (optional)
Hafnium; Atomic number 72
- Ta (optional)
Tantalum; Atomic number 73
- W (optional)
Tungsten; Atomic number 74
- Re (optional)
Rhenium; Atomic number 75
- Os (optional)
Osmium; Atomic number 76
- Ir (optional)
Iridium; Atomic number 77
- Pt (optional)
Platinum; Atomic number 78
- Au (optional)
Gold; Atomic number 79
- Hg (optional)
Mercury; Atomic number 80
- Tl (optional)
Thallium; Atomic number 81
- Pb (optional)
Lead; Atomic number 82
- Bi (optional)
Bismuth; Atomic number 83
- Po (optional)
Polonium; Atomic number 84
- At (optional)
Astatine; Atomic number 85
- Rn (optional)
Radon; Atomic number 86
- Fr (optional)
Francium; Atomic number 87
- Ra (optional)
Radium; Atomic number 88
- Ac (optional)
Actinium; Atomic number 89
- Th (optional)
Thorium; Atomic number 90
- Pa (optional)
Protactinium; Atomic number 91
- U (optional)
Uranium; Atomic number 92
- Np (optional)
Neptunium; Atomic number 93
- Pu (optional)
Plutonium; Atomic number 94
- Am (optional)
Americium; Atomic number 95
- Cm (optional)
Curium; Atomic number 96
- Bk (optional)
Berkelium; Atomic number 97
- Cf (optional)
Californium; Atomic number 98
- Es (optional)
Einsteinium; Atomic number 99
- Fm (optional)
Fermium; Atomic number 100
- Md (optional)
Mendelevium; Atomic number 101
- No (optional)
Nobelium; Atomic number 102
- Lr (optional)
Lawrencium; Atomic number 103
- Rf (optional)
Rutherfordium; Atomic number 104
- Db (optional)
Dubnium; Atomic number 105
- Sg (optional)
Seaborgium; Atomic number 106
- Bh (optional)
Bohrium; Atomic number 107
- Hs (optional)
Hassium; Atomic number 108
- Mt (optional)
Meitnerium; Atomic number 109
- Ds (optional)
Darmstadtium; Atomic number 110
- Rg (optional)
Roentgenium; Atomic number 111
- Cn (optional)
Copernicium; Atomic number 112
- Nh (optional)
Nihonium; Atomic number 113
- Fl (optional)
Flerovium; Atomic number 114
- Mc (optional)
Moscovium; Atomic number 115
- Lv (optional)
Livermorium; Atomic number 116
- Ts (optional)
Tennessine; Atomic number 117
- Og (optional)
Oganesson; Atomic number 118
Simple Types
Type: InstrumentName (simple type)
Controlled labels that identify available instruments in the facility (matching names in the reservation calendar resource).
Base type:
xs:tokenAllowed values:
FEI Titan TEM- The FEI Titan transmission electron microscope in Bldg 1/Room A
FEI Titan STEM- The FEI Titan scanning transmission electron microscope in Bldg 1/Room A
FEI Helios- The FEI Helios dual beam FIB/SEM in Bldg 1/Room A
FEI Quanta200- The FEI Quanta 200 environmental scanning electron microscope in Bldg 1/Room A
Hitachi S4700- The Hitachi S4700 scanning electron microscope in Bldg 1/Room A
Hitachi S5500- The Hitachi S5500 scanning electron microscope in Bldg 1/Room A
JEOL JEM3010- The JEOL JEM3010 transmission electron microscope in Bldg 1/Room A
JEOL JSM7100- The JEOL JSM7100 scanning electron microscope in Bldg 1/Room A
Philips EM400- The Phillips EM400 transmission electron microscope in Bldg 1/Room A
Philips CM30- The Phillips CM30 transmission electron microscope
Test Tool- A test tool that does not exist for testing
Type: DatasetType (simple type)
Controlled labels that identify a functional type data contained in a dataset.
Base type:
xs:tokenAllowed values:
Image- A 2-D array of data where each value is typically an intensity measurement as function of regularly spaced position
Spectrum- A 1-D array of data where each value is typically an intensity measurement as a function of frequency or energy
SpectrumImage- A 3-D array of data where each value is typically an intensity measurement as a function of regularly space position along two axes and of frequency or energy along the third.
Diffraction- Data that measures a (usually electron) diffraction pattern
Notes- Arbitrary textual data that is typically manually created by the Experimenter.
Misc- A dataset that does not qualify as of any of the other defined types.
Unknown- A dataset with an unknown type (meaning its metadata could not be extracted with current methods).
Type: DatasetRole (simple type)
Controlled labels that identify the functional role of a dataset
Base type:
xs:tokenAllowed values:
Experimental- “Normal” data collected during typical operation of an instrument for experimental purposes
MasterCalibration- Reference data collected for the purpose of instrument calibration during instrument service events or by allowed super users
UserCalibration- Data collected alongside “Experimental” Datasets by regular users for calibration purposes between service events or for a specific experiment
Derived- Data that is not collected form an instrument, but rather derived from raw and/or calibration data as the result of post-acquisition analysis processes
Example Record#
Here is a simplified example of a complete NexusLIMS XML record showing the key structural elements:
<?xml version="1.0" encoding="UTF-8"?>
<nx:Experiment xmlns:nx="https://data.nist.gov/od/dm/nexus/experiment/v1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://doi.org/10.18434/M32245"
pid="record_2024-01-15_12345">
<nx:title>STEM imaging session - nanoparticle characterization</nx:title>
<nx:id>session_20240115_jsmith</nx:id>
<!-- Session-level metadata -->
<nx:summary ref="https://nemo.example.org/reservation/12345">
<nx:experimenter>Dr. Jane Smith</nx:experimenter>
<nx:experimenter>John Doe</nx:experimenter>
<nx:instrument pid="FEI-Titan-TEM">FEI Titan TEM</nx:instrument>
<nx:reservationStart>2024-01-15T10:00:00-05:00</nx:reservationStart>
<nx:reservationEnd>2024-01-15T12:00:00-05:00</nx:reservationEnd>
<nx:motivation>Characterize particle size distribution and elemental composition of Au-TiO2 nanoparticles</nx:motivation>
</nx:summary>
<!-- Sample description -->
<nx:sample id="Au-TiO2-batch5" ref="https://sample-db.example.org/samples/Au-TiO2-batch5">
<nx:name>Gold-Titania Nanoparticles Batch 5</nx:name>
<nx:description>Au nanoparticles supported on TiO2, synthesized January 2024</nx:description>
<nx:elements>
<nx:Au/>
<nx:Ti/>
<nx:O/>
</nx:elements>
</nx:sample>
<!-- Project information -->
<nx:project>
<nx:name>Nanoparticle Catalysis Study</nx:name>
<nx:project_id>NP-2024-001</nx:project_id>
</nx:project>
<!-- Acquisition activity (temporal file grouping) -->
<nx:acquisitionActivity seqno="1">
<nx:startTime>2024-01-15T10:30:00-05:00</nx:startTime>
<nx:sampleID>Au-TiO2-batch5</nx:sampleID>
<!-- Setup parameters common to all datasets in this activity -->
<nx:setup>
<nx:param name="Microscope Mode">STEM</nx:param>
<nx:param name="Detector">HAADF</nx:param>
</nx:setup>
<!-- Individual dataset -->
<nx:dataset type="Image" role="Experimental">
<nx:name>overview_001.dm3</nx:name>
<nx:location>2024/01/15/overview_001.dm3</nx:location>
<nx:format>application/gatan-dm3</nx:format>
<nx:description>Overview STEM image showing particle distribution</nx:description>
<nx:preview>2024/01/15/overview_001.dm3.thumb.png</nx:preview>
<!-- Metadata -->
<nx:meta name="Data Type">STEM_Imaging</nx:meta>
<nx:meta name="Creation Time">2024-01-15T10:30:45-05:00</nx:meta>
<nx:meta name="Acceleration Voltage" unit="kV">200.0</nx:meta>
<nx:meta name="Beam Current" unit="pA">500</nx:meta>
<nx:meta name="Magnification">50000</nx:meta>
<nx:meta name="Working Distance" unit="mm">5.2</nx:meta>
<nx:meta name="Pixel Dwell Time" unit="us">10.0</nx:meta>
<nx:meta name="Stage X" unit="mm">1.25</nx:meta>
<nx:meta name="Stage Y" unit="mm">-0.75</nx:meta>
<nx:meta name="Stage Z" unit="mm">0.0</nx:meta>
<nx:meta name="camera_name">BM-Ceta</nx:meta>
</nx:dataset>
<!-- Additional datasets in this activity... -->
</nx:acquisitionActivity>
<!-- Additional acquisition activities... -->
</nx:Experiment>
Key Elements:
<nx:Experiment>: Root element containing entire record<nx:summary>: Session-level metadata (who, what, why)<nx:instrument>: Instrument identification and location<nx:AcquisitionActivity>: Temporal grouping of related files<nx:dataset>: Individual file metadata<nx:acquisition>: Technical parameters with units and EM Glossary attributes<nx:extensions>: Vendor-specific metadata not in standard schema<nx:preview>: Thumbnail image location
See Also#
Internal Metadata Schema System - Internal backend metadata schemas and validation
EM Glossary Field Reference - EM Glossary field mappings
Record building workflow - How records are generated
NexusLIMS Taxonomy - Data type classification