Web Analytics Made Easy - Statcounter
Skip to content

Exporters#

An exporter writes SAMSON content to an external file format.

Use an exporter when your extension should turn data graph content into a file that can be archived, exchanged with another tool, or consumed by a downstream workflow.

Typical examples include structure writers, mesh exporters, trajectory snapshots, and tool-specific exchange formats.

Key class and core responsibilities#

File exporters derive from SBIFileExporter.

An exporter should:

How exporters are used#

An exporter may be used:

In both cases, SAMSON can route the request to the exporter matching the chosen file extension.

What to think about when designing an exporter#

The main design question is what subset of the data graph should be represented in the external format.

A good exporter defines:

  • which node types it supports
  • what happens when unsupported nodes are present
  • how scientific metadata is preserved, approximated, or omitted
  • whether the exporter writes the entire selection or a reduced representation

If the format cannot represent the full SAMSON object graph, document the loss clearly.

Example scenario#

Suppose you need to export a selected nanostructure to a simulation package:

  • the exporter collects the selected nodes
  • it extracts the subset of properties required by the target format
  • it writes the target file while validating units, identifiers, and topology assumptions

That is exporter logic, even if you also provide an app to choose additional export options.