Formatting a CSV for View Import: Difference between revisions

From PHENOM Portal Knowledgebase
Jump to navigation Jump to search
(Created page with "To bulk import view characteristics, the CSV file should be formatted as described below. == General Column/Data Requirements == The following column headers must exist and contain data in each row: * View_Name * Characteristic_Name * Primitive * Source * Path * Measurement The following columns are purely optional (for example, the Package columns are only there to specify destination if desired): * Package_Name * Package_Description * Package_Tags * View_Description...")
 
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
To bulk import view characteristics, the CSV file should be formatted as described below.
To bulk import view characteristics, the CSV file should be formatted as described in this article.


== General Column/Data Requirements ==
== General Column/Data Requirements ==
Line 10: Line 10:
* Measurement
* Measurement


The following columns are purely optional (for example, the Package columns are only there to specify destination if desired):  
The following columns are optional (for example, the Package columns are only there to specify destination if desired):  
* Package_Name
* Package_Name
* Package_Description
* Package_Description
Line 18: Line 18:
* Characteristic_Description
* Characteristic_Description
* Characteristic_Tags
* Characteristic_Tags
* Lower_Bound
* Upper_Bound
* Nested_View


The order of the columns is not enforced, it does not have to be in the same order as the suggested format above.
The order of the columns is not enforced, it does not have to be in the same order as the suggested format above.
Line 25: Line 28:
Bulk import can currently import Package, View, and Characteristic elements.
Bulk import can currently import Package, View, and Characteristic elements.


== Column Specific Requirements ==
== Column-specific Requirements ==
=== Package Name ===
=== Package Name ===
* Leaving this column blank will default Package to the "Phenom" package.
* Leaving this column blank will default Package to the "Phenom" package.
Line 53: Line 56:
* Measurement must in the model and realize the Observable at the end of the Path.
* Measurement must in the model and realize the Observable at the end of the Path.


''For example: '''AirSystemType''' is projected (through payload) from '''elementID''' which is realized by ''UniqueID_Unbounded_Integer''''
''For example: '''AirSystemType''' is projected (through payload) from '''elementID''' which is realized by ''UniqueID_Unbounded_Integer'
 
=== Lower Bound and Upper Bound ===
 
* This row must have both a Source and a Path for these values to be valid
 
=== Nested View ===
 
* The Nested View must exist in the model and must be the name of a View.
* See Nested Views for changes to other columns


== Tagging New Elements (Optional) ==
== Tagging New Elements (Optional) ==
Line 61: Line 73:


Package_Tags will tag whichever package is chosen - this includes the Phenom package when a package isn't specified in the Package_Name column.
Package_Tags will tag whichever package is chosen - this includes the Phenom package when a package isn't specified in the Package_Name column.
== Nested Views ==
By referencing the name of another view, whether already existing in the model or being added by the same CSV file, in the '''Nested_View''' column, the import can create view sub-structuring or nesting.
In view field rows representing nested views, the '''Source''' and '''Path''' columns represent the perspective path under which the view sub-structure is nested. At the same time, the '''Primitive''', '''Platform_Type''', and '''Measurement''' are not applicable.
By default, all sub-structure nesting view field rows will be inferred to be representing a "private" nesting. This can be made explicit, or toggled off to accomplish a sub-structure import, by using the '''Characteristic_Foreign''' column: if set to "false", the view sub-structure will be private to its nesting view, and an independent import if set to "true".


== Additional Requirements ==
== 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:
* 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:'''
** '''IDL Reserved words:'''<p>"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"</p>
**; "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:'''<p> "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"</p>
** '''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.
* 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).
* 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.
* 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.
* 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).
* In the raw CSV (i.e., 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.

Latest revision as of 13:19, 2 May 2024

To bulk import view characteristics, the CSV file should be formatted as described in this article.

General Column/Data Requirements

The following column headers must exist and contain data in each row:

  • View_Name
  • Characteristic_Name
  • Primitive
  • Source
  • Path
  • Measurement

The following columns are optional (for example, the Package columns are only there to specify destination if desired):

  • Package_Name
  • Package_Description
  • Package_Tags
  • View_Description
  • View_Tags
  • Characteristic_Description
  • Characteristic_Tags
  • Lower_Bound
  • Upper_Bound
  • Nested_View

The order of the columns is not enforced, it does not have to be in the same order as the suggested format above.

Any 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 Platform Package within the model.
  • If there is no matching Package, a new Package will be created within the "Phenom" Package.

Package Description

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

View Name

The data in this column for an existing View will be matched to the first View of that name 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 be imported 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 imported under.
  • The Characteristic must not already exist in the desired View
  • 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 in the model and 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 in the model and realize the Observable at the end of the Path.

For example: AirSystemType is projected (through payload) from elementID which is realized by UniqueID_Unbounded_Integer'

Lower Bound and Upper Bound

  • This row must have both a Source and a Path for these values to be valid

Nested View

  • The Nested View must exist in the model and must be the name of a View.
  • See Nested Views for changes to other columns

Tagging New Elements (Optional)

Package_Tags, View_Tags, and Characteristic_Tags optional columns can be used 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.

Nested Views

By referencing the name of another view, whether already existing in the model or being added by the same CSV file, in the Nested_View column, the import can create view sub-structuring or nesting.

In view field rows representing nested views, the Source and Path columns represent the perspective path under which the view sub-structure is nested. At the same time, the Primitive, Platform_Type, and Measurement are not applicable.

By default, all sub-structure nesting view field rows will be inferred to be representing a "private" nesting. This can be made explicit, or toggled off to accomplish a sub-structure import, by using the Characteristic_Foreign column: if set to "false", the view sub-structure will be private to its nesting view, and an independent import if set to "true".

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 (i.e., as observed from notepad), any field with commas must have surrounding quotes (Excel normally handles this).