CSV

From PHENOM Portal Knowledgebase
Revision as of 15:20, 13 October 2022 by Nathalie (talk | contribs)
Jump to navigation Jump to search

The CSV import tool allows users to bulk import data into their model.

The types of data the user can import are:

  • View-Characteristic
  • Enum-Literal
  • Model-Content
  • Constraints
  • Message Data Model
  • Platform Types

Selecting the "... UPDATE" option for any type of data will overwrite existing information.

View Characteristics

To import a CSV file containing Views/Characteristics,

  • Select "View-Characteristic" from the Import Type dropdown:
  • Under Import File, select a properly formatted CSV file (see Formatting a CSV for View Import)
  • Click the Import button on the lower right side

After the import has finished, PHENOM will display a popup message with the status of the import.

There may be a delay before the import completes depending on the size of the file.

After the import finishes, there will either be a success message or an Import Errors message with each error and its respective row.



Formatting a CSV for View Import


How a sample View-Characteristic bulk import CSV could be formatted. General Column/Data Requirements: The following column headers must exist and contain data in each row: View_Name, Characteristic_Name, Primitive, Source, Path, Measurement All other columns are purely optional (for example, the Package columns are only there to specify destination if desired). Optional columns: Package_Name, Package_Description, Package_Tags, View_Description, View_Tags, Characteristic_Description, Characteristic_Tags Column order is not enforced - it does not have to be in the same order as the suggested format above. Additional user-made columns will be ignored and will not interfere with import. Bulk import can currently import Package, View, and Characteristic elements. Column Specific Requirements: Package Name


Leaving this Column blank will default Package to the "Phenom" package. Setting this Column to an existing Package will default to the first matching Package within the model. If there isn't a matching Package a new Package will be created within the "Phenom" Package. Package Description


Package Description will import for new Packages only. Only the first Description for new Packages will be imported. View Name


Setting data in this column to an existing View will default to the first matching View within the model (there should only be one match). If there isn't a matching View a new View will be created within the "Phenom" Package. View Description


View Description will import for new Views only. Only the first Description for new Views will be imported. Characteristic Name, Characteristic Description


Characteristic Names must be unique to the View they are importing under. The Characteristic must not already exist in the desired View within the model before importing. Characteristics belonging to different Views may have the same name. Primitive


This column isn't case sensitive. Acceptable values: "Char", "Double", "Float", "Long", "Short", "String", "ULong", "UShort", "Octet", "Enumeration" Source, Path, Measurement


Source must exist and it must be the Entity/Association projected from the last element in the Path column. Path must have valid elements leading up to/ending with the Observable realized by the Measurement. Measurement must exist and realize the Observable at the end of the Path. AirSystemType is projected (through payload) from elementID which is realized by UniqueID_Unbounded_Integer Tagging New Elements (Optional)


Optional columns can be added in to CSV to tag new Packages, Views, or Characteristics. Each field can have multiple comma delimited tags. The raw CSV must have quotes around fields with commas (Excel normally handles this). Package_Tags will tag whichever package is chosen - this includes the Phenom package when a package isn't specified in the Package_Name column Additional Requirements Data within Package_Name, View_Name, and Characteristic_Name must all begin with a letter, and only contain numbers, letters, or underscores. The data must also not match any of the following reserved words: IDL Reserved words: "and", "begin", "break", "case", "common", "compile_opt", "continue", "do", "else", "end", "endcase", "endelse", "endfor", "endforeach", "endif", "endrep", "endswitch", "endwhile", "eq", "for", "foreach", "forward_function", "function", "ge", "goto", "gt", "if", "inherits", "le", "lt", "mod", "ne", "not", "of", "on_ioerror", "or", "pro", "repeat", "switch", "then", "until", "while", "xor" OCL Reserved words: "abstract", "any", "attribute", "boolean", "case", "char", "component", "const", "consumes", "context", "custom", "default", "double", "emits", "enum", "eventtype", "exception", "factory", "false", "finder", "fixed", "float", "getraises", "home", "import", "in", "inout", "interface", "local", "long", "manages", "module", "multiple", "native", "object", "octet", "oneway", "out", "primarykey", "private", "provides", "public", "publishes", "raises", "readonly", "sequence", "setraises", "short", "string", "struct", "supports", "switch", "true", "truncatable", "typedef", "typeid", "typeprefix", "union", "unsigned", "uses", "valuebase", "valuetype", "void", "wchar", "wstring" New Views not already within the model must be unique among elements of type IDLStruct and Enumeration. Multidimensional Measurements are supported, however each axis will default to the primitive found within the primitive column (these can be corrected within Phenom later if desired). If there are any errors during validation of the CSV file, the model import will not be initiated and a list of errors will be returned. They will be labeled by the row they occur on for convenience. There is a 2MB limit in place - if a larger file needs to be imported, it needs to be split up into smaller files. In the raw CSV (ie as observed from notepad), any field with commas must have surrounding quotes (Excel normally handles this).

Bulk Update

The UPDATE functionality works exactly as described above, except it allows overwriting of existing information.

You can use Generate → View_Export.csv to export, modify, and re-import existing views.







DSDM Import DSDM Import or the Model-Content Bulk Import is a convenient tool for bulk creation of Entities and Associations.

Importing DSDM Content

To import a Bulk CSV file containing DSDM content from the Bulk Import page: Select "Model-Content" from the Import Type dropdown:

Click the Browse button under Import File:

Select a properly formatted CSV file (see CSV Format/ Instructions / API):

Click the Import button on the lower right side:

After the import has finished, Phenom will display a popup message with either a success message or an Import Errors message with each error and its respective row.

Formatting a CSV for DSDM Import

Use the following CSV Format/ Instructions / API [CSV Template]



Each row creates 1 attribute on 1 element. Creation of new elements is incidental and done only if a match isn't found. Column & Data Requirements: Required column headers Element_Name Operation_Type Attribute_Name Attribute_Type Optional columns Element_Description Element_Tags Attribute_Description Attribute_Tags Association_Path Package_Name Package_Description Package_Tags Element Name & Description If an Entity (or Association) with a matching name is found in the model, the attribute will be added to it. New elements default to a type of Entity. If an Entity (or Association) is created, the description is applied to that new element. If the element already exists, its description (if not an empty string) will be updated with the description provided here. Operation Type & Association Path Must be set to 'Composition' or 'Association'. If your Operation_Type is Association, then the Element will automatically be turned into an Association. If the Attribute already exists, it will be updated to be an Associated Entity (i.e. turns the Entity into an Association) There MUST BE AT LEAST TWO associated entities or the creation/update operation will fail. It is possible to only add a single associated entity if the element already exists and already contains an associated entity. By default, the Association Path is empty. This is an advanced concept used to relate to specific attributes of an element rather than the entire element itself. Attribute Name, Type & Description Attribute_Name is the desired name for the attribute. Attribute_Type must be a valid Observable, Entity, or Association that either exists in the model, or was created on a previous row. Attribute_Description is the description that will be applied to that attribute. If the attribute already exists, its description (if not an empty string) will be updated with the description provided here. Package Name & Description These columns allow you to place new entity in the package specified by Package_Name. If a package with the provided name does not exist, the new package will be created under the PhenomEntities package. Package_Name specified the name of the existing/new package. Package_Description specifies the description that will be applied to that package. Tagging (Optional) Optional columns can be added in to CSV to tag new Packages, Elements, or Attributes. Each field can have multiple comma delimited tags.

Enum-Literal Import The Enum-Literal Bulk Import is a convenient tool for bulk creation of Enumerations/Enumeration Literals.

FACE XMI v2.1 Import View-Characteristic Import The View-Characteristic Bulk Import is a convenient tool for bulk creation of Views/Characteristics.