Skip to main content

File Structure and Format

This page explains the file structure and main format of files handled by the YamlExchange package.

Exported File Structure​

When you export from the screen, the following files are exported to the Yaml folder in the same folder as the project file.

Change Shape TypeFile NameContent
Main File<Project Name>.yamlThis is the starting file for the exported set.
<Project Name> is the project name displayed at the top of the Model Navigator.
Split Destination<Model Name>_<Short ID>.yamlThis is the file for the model specified as the target for file splitting in the settings.
It is placed in the same folder as the main file.
Rich Text Filecontents/<id>_<field name>.htmlThis file contains the values ​​of the rich text fields (Rich Text Edit Tool).
Metamodel Information Filend.metamodel.yamlThis file contains a list of classes and fields (Metamodel Information File).
  • The main file contains references ($file) to the split files and the rich text file. When only a portion of the model is exported, only the table of contents (the $file line) may be written in the main file, etc. (When only a portion is exported). Since the entire set is required for import, please provide the entire folder when transferring files.

  • Do not change the filename of the split file. The parent file's $file will not be found, and the import will be interrupted with an error.

  • When you re-export, any files that were not exported this time, including the split files and rich text files that can be traced from the previous file of the selected model, will be deleted (files you placed yourself will not be deleted). Do not place files you created yourself in the contents folder. If you use --clean with yamlexchange, everything in the export destination folder will be deleted.

When exporting only a part​

If you select a model that has never been exported before, only the files of the selected model will be exported.
In this case, if the main file containing the selected model or the source file for splitting does not yet exist, the contents of the model will not be written to that file, and only lines with $file pointing to the split files will be written. Like a table of contents in a book, the contents are in the files pointed to by $file.

# ADAS
# Because only a part was exported, only $file points to the split files are written. Models not listed here are also in ND. Do not write a model in this file.
schema_version: '1.0'
root:
- $file: Soft Requirements Specification_N23CR3.yaml
  • If you select another model and export it, a row will be added to the table of contents.
  • If you select a higher-level model (the project in the case of the main file) and export it, the contents of the model will be written to that file.
Note

A file containing only a table of contents will be recreated each time you export. Do not add models to it (import will be interrupted). If there is a conflict during a Git merge, leave both lines.

YAML Format​

At the top level, write schema_version and root.
schema_version is currently '1.0' (enclosed in quotes).
root should contain the top-level model of that file.
In the import file, you can list multiple models in root and import them all at once.

Each model (node) is written with a mapping that has the following keys:

KeyContent
nameModel name.
classFully qualified name of the class.
Required for all models. Always include it in new models.
idModel identifier (short ID).
Omit it in new models, or write a temporary ID starting with new- (id matching).
Field NameField value. Use the field name as the key.
For owned fields, list the child models as an array.
For referenced fields, list the referenced object as an array of {id: …}.
$fileReference to the split file or rich text file.
Do not rewrite this line; edit the referenced file instead.

Example description (excerpt):

# Software Requirements Specification Development/Software Requirements Specification/Meter ECU
schema_version: '1.0'
root:
name: Meter ECU
class: In-vehicle system software development.Software requirements specification development.Software requirements specification.SoftwareRequirementSpecificationGroup
id: HHGAJJ
Description: Requirements for Meter ECU
RequirementSpecifications:
- name: Target speed notification
class: In-vehicle system software development.Software requirements specification development.Software requirements specification.SoftwareFunctionalRequirement
id: G2TSFW
Content: Notifies the driver of the updated target speed.

RequirementType: Must
- name: Cruise Control Driving Feasibility Notification
class: In-Vehicle System Software Development.Software Requirements Specification Development.Software Requirements Specification.SoftwareFunctionalRequirement
id: J6GKZH
Content: If the condition check determines that cruise control driving can be started, notify the driver accordingly.
RequirementType: Must
Functions:
- id: HKPRFW
path: System Physical Design/System Physical Structure/Meter ECU/Driver Notification Output
rel:
name: ''
class: In-Vehicle System Software Development.Metamodel Elements.Relationship.SoftwareRequirementToTechnicalArchitectureFunction
id: RXYJFV
  • If the reference is included in this export, the name of the reference will be added as a comment at the end of the reference line (e.g., - {id: PJVS93} # Target Control Value). If it is not included, path (model path) will be added instead of a comment. Both are aids for the reader and are not used for import.
  • References on the source side of the association are written as rel (see Reference Handling).
  • If a field name is the same as a reserved key such as name, class, or id, write it with f:, like f:type.
  • Anchors (&), aliases (*), tags (!), and merge keys (<<) cannot be used.
  • If you write multiple documents separated by --- in one file, only the first document will be read.
  • Use the editor with the setting to not remove trailing whitespace. Removing it will change the value and update it in the next import.

Rich Text​

The values ​​of rich text fields are not embedded in the YAML body, but are exported to the HTML file in the contents folder.
The YAML file in the main body only contains $file to the file.

  SoftwarePurpose:
$file: contents/N23CR3_SoftwarePurpose.html
  • The file name is <model id>_<field name>.html. This does not change even if the model name is changed.
  • Images in the main body are extracted into image files such as <model id>_<field name>_001.png. They are embedded back into the HTML when imported.
  • When changing the content, edit the HTML file directly. Do not change the document format of <html><head></head><body>…</body></html>.

Settings File​

The settings file specifies which models should be included in the file splitting during export.

  • The file name is fixed as yamlexchange.ndycfg.

  • Place the file in the same folder as the project file (.nproj). Files from other locations cannot be used.

  • If the file does not exist, it will be exported as a single file without splitting (if you select a model that is not subject to file splitting on the screen and export it, a configuration file will be created and that model will be added. See File Splitting (YAML Exchange Settings) > Specification Added to Settings).

Normally, you create and edit it on the [YAML Exchange Settings] screen (File Splitting (YAML Exchange Settings)).

Metamodel Information File​

The metamodel information file (nd.metamodel.yaml) is a file that lists the classes and fields in the project profile that can be written and imported in YAML.
It is used when having AI edit YAML or when validating YAML with validate --metamodel. This is used as a "glossary" to look up class names that can be written in class and the fields that can be written for each class.

Handling of Metamodel Information Files
  • Do not edit this file. Editing it will not update the profile when importing YAML.

  • If you change the profile, re-export it in an environment where you can edit the profile.

  • This file cannot be exported if you are using a Designer edition or if the profile is protected. See Restrictions > Export for details.

name: In-Vehicle System Software Development
version: '1.0'
types:
In-Vehicle System Software Development.Software Requirements Specification Development.Software Requirements Specification.SoftwareRequirementBase:
displayName: Software Requirements
abstract: true
extends: [In-Vehicle System Software Development.Metamodel Elements.Model Base.EntityBase, In-Vehicle System Software Development.Metamodel Elements.Requirement Base.RequirementBase]
fields:
SubRequirements: {displayName: Sub-Requirements, itemType: In-Vehicle System Software Development.Software Requirements Specification Development.Software Requirements Specification.SoftwareRequirementBase, relation: containment, multiple: true}
SoftwareStructureElements: {displayName: Software Component, type: In-Vehicle System Software Development.Software Design.Software Structure.SoftwareStructureElement, relation: trace, multiple: true}

The main notation is as follows:

NotationMeaning
types keyThe fully qualified name of the class. This value is written in the class field in YAML.
displayNameThe name displayed on the Next Design screen.
abstract: trueAn abstract class. Cannot be written in class.
extendsThe class from which it is inherited. Fields from the inherited class can also be written.
fieldsFields defined in that class. The key is the field name written in YAML.
itemType and relation: containmentOwned fields. Child elements are written nested.
type and relation: traceReference fields. Written as {id: …}.
valuesValues ​​that can be written in an enumeration field.
readonly: trueA read-only field. It will not be imported even if written in YAML.