JSON as an alternative file format for REXS
In the future, it will be possible to use the JSON Format as an alternative to the xml file format previously used for REXS models. The following will show how the individual elements of a REXS model are represented in JSON. The xml representation is also included for comparison purposes.
Note
The following REXS JSON file format specification is not yet part of the official version of REXS 1.4. However, it has been approved by the REXS CCB and will be part of the specification from REXS version 1.5. File extensions
File extensions
The *.rexsj file extension should be used for REXS-JSON files. Alternatively, the following file extensions are also allowed:
xml: *.rexs.xml
zip: *.rexs.zip
json: *.rexs.json
Model Object
The REXS model is contained in a JSON object called "model," which includes a row of name-value pairs. In addition to the metadata ("version," "applicationId," "applicationVersion," "date," "applicationLanguage"), the "model" object contains the "relations" and "components" arrays, as well as a "load_spectrum" object if necessary.
Feature | Description | |
---|---|---|
Part of the REXS file | version | Version of the REXS interface Format: mainversionnumber.subversionnumber Example: version="1.2" |
applicationId | Name of the application that generated the XML file; e.g., "FVA-Workbench" | |
applicationVersion | Version of the application | |
date | Time at which the file was created Date and time according to ISO 8601 in the following format: "yyyy-mm-ddThh:mm:ss+<offset to UTC>" Example: 2016-06-03T11:35:17+01:00 | |
applicationLanguage | Optional: specification of the language used in the application Language code according to 639-1 Example: applicationLanguage="en" |
Example REXS file metadata | XML Syntax
<model version="1.4" applicationId="FVA-Workbench" applicationVersion="7.0.0" date="2021-11-03T11:35:17+01:00" applicationLanguage="en"> <relations>...</relations> <components>...</components> <load_spectrum>...</load_spectrum> (optional) </model>
Example REXS file metadata | JSON Syntax
{"model": { "version": "1.4", "applicationId":"FVA-Workbench", "applicationVersion":"7.0.0", "date":"2021-11-03T11:35:17+01:00", "applicationLanguage":"en", "relations": [...], "components": [...], "load_spectrum": {...} (optional) } }
"relations" array
The "relations" array contains a list of JSON objects. Each of these objects includes the name-value pairs "id" (ID of the relation), "type" (type of relation), "order" (for relevant relation types), and the "refs" array. The "refs" array contains a list of objects with the name-value pairs "role" (role of the component in the relation), "id" (ID of the component in the relation), "hint" (optional addition for improved clarity).
Clarification: Multiple objects with the same role are not permitted in the "refs" array of a relation. For example, it is not allowed to use multiple "part" elements in the same assembly relation. A separate relation must be created for each "part."
Nr. | Feature | Description | Details | |
---|---|---|---|---|
Part of the REXS file | 1 | id | Unique identifier of the relation in the concrete instance of the model Data type: integer | |
2 | type | Type of relation; e.g., "assembly“ Follows the naming convention Data type: string | Naming convention Types of relations | |
3 | order | Some relations between two components (e.g., "ordered_assembly_relation") also include an order, which is determined by the "order" tag. For example, this makes it possible to uniquely assign the bearing rows of a rolling bearing. Data type: integer The "order" always begins = 1 and increases in increments of 1. |
Nr. | Feature | Description | |
---|---|---|---|
Part of the REXS file | 1 | id | ID of a component in the relation. Data type: integer |
2 | role | Role of the component in the relation (e.g., stage). Data type: string | |
Optional in REXS file | 3 | hint | Note to make the relation easier to read; e.g., type of the referenced component, max. 40 characters |
Example REXS file relations | XML syntax
<relations> <relation id="15" type="ordered_assembly" order="1"> <ref id="8" role="assembly" hint="bearing"/> <ref id="16" role="part" hint="bearing_row"/> </relation> <relation id="23" type="stage"> <ref id="3" role="stage" hint="cylindrical_stage"/> <ref id="7" role="gear_1" hint="cylindrical_gear"/> <ref id="9" role="gear_2" hint="cylindrical_gear"/> </relation> </relations>
Example REXS file relations | JSON syntax
"relations": [ {"id":15, "type":"ordered_assembly", "order":1, "refs": [ {"id":8, "role":"assembly", "hint":"bearing"}, {"id":16, "role":"part", "hint":"bearing_row"} ] }, {"id":23, "type":"stage", "refs": [ {"id":3, "role":"stage", "hint":"cylindrical_stage"}, {"id":7, "role":"gear_1", "hint":"cylindrical_gear"}, {"id":9, "role":"gear_2", "hint":"cylindrical_gear"} ] }, ]
"components" array
The "components" array contains a list of JSON objects. Each of these objects includes the name-value pairs "id" (ID of the component), "name" (component name), "type" (component type), as well as the "attributes" array.
Overview of name-value pairs in components:
"attributes" array
The "attributes" array contains a list of objects with the following name-value pairs: "id" (attribute ID), "unit" (unit, required for certain data types), as well as the attribute value. Depending on the data type, a different identifier is used to enable JSON validation. The available identifiers are listed below. For details on binary-coded arrays and matrices, see array values and matrix values.
Data type | Details | JSON identifier | Example JSON value |
---|---|---|---|
scalar | Scalar values | ||
boolean | true, false | boolean | false |
string | string | "NU 206" | |
integer | integer | 3 | |
floating_point | The floating point symbol is "." (period). Maximum number of significant digits: 15 | floating_point | 2.0 |
enum | Has a specified value range | enum | "both_directions" |
reference_component | ID of the reference component for specification of the position and orientation (POSE) | reference_component | 1 |
file_reference | Reference to a file or folder (relative or absolute) | file_reference | "example.gde" |
array | One-dimensional array of values | ||
floating_point_array | The floating point symbol is "." (period). Maximum number of significant digits: 15 | floating_point_array | [1.0,0.0,0.0] |
floating_point_array | in binary format | floating_point_array_coded | {"code": "float32", "value": "62wRNhgQS0AAAAAAAAAAANgPsyG1MXDA"}} |
integer_array | integer_array | [1,2,3] | |
boolean_array | boolean_array | [true,false,true] | |
string_array | string_array | ["example 1","example 2"] | |
enum_array | The enum_array data type is new. Array of enum values | enum_array | ["quad4","triangle3","quad4"] |
matrix | Two-dimensional array of values, where each row has the same length | ||
floating_point_matrix | The floating point symbol is "." (period). Maximum number of significant digits: 15 | floating_point_matrix | [[1.0,0.0,0.0],[0.0,1.0,0.0],[0.0,0.0,1.0]] |
floating_point_matrix | in binary format | floating_point_matrix_coded | {"code": "float64", "rows":100, "columns":200 "value": "MveeQZ6hM0I"}} |
integer_matrix | integer_matrix | [[1,0,0],[0,1,0],[0,0,1]] | |
boolean_matrix | boolean_matrix | [[true,false,true],[false,false,true],[true,false,false]] | |
string_matrix | string_matrix | [["example 1","example 2"],["example 3","example 4"]] | |
array_of_arrays | Two-dimensional array of values, where the rows can have different lengths | ||
array_of_integer_arrays | array_of_integer_arrays | [[1,2,3,4],[1,3,4,5,6],[7,9,11]] |
Example attribute list | JSON syntax
"attributes":[ {"id": "name", "string": "30203-A"}, {"id": "normal_module", "unit": "mm", "floating_point": 2.0}, {"id": "addendum_modification_coefficient", "unit": "none", "floating_point": 0.1}, {"id": "number_of_gears", "integer": 3}, {"id": "is_driving_gear", "boolean": false}, {"id": "axial_force_absorption", "enum": "both_directions" }, {"id": "u_axis_vector", "unit": "mm","floating_point_array": [1.0,0.0,0.0]}, {"id": "matrix_correction", "unit": "mm", "floating_point_matrix": [[1.0,0.0,0.0],[0.0,1.0,0.0],[0.0,0.0,1.0]] }, {"id": "example_attribute_id", "unit": "mm", "floating_point_array_coded": {"code": "float32", "value": "MveeQZ6hM0I"}}, {"id": "element_structure", "array_of_integer_arrays": [[108,2,1,107,7],[0,1,0],[0,7,0,1]]}, ]
"load_spectrum" object
The "load_spectrum" object includes the name-value pairs "id" (ID of the load spectrum), "accumulation" (sub-model for accumulated values of the spectrum), as well as the "load_cases" array. The "accumulation" object contains a "components" array. The "load_cases" array contains a list of JSON objects, each of which includes both an "id" and a "components" array.
For details on the modeling system, see load spectra.
Example load spectrum | JSON syntax
"load_spectrum": { "id": 1, "load_cases": [ { "id": 1, "components": [ { "id": 1, "attributes": [...]}, { ... }, ... ] }, { "id": 2, "components": [ { "id": 2, "attributes": [...]}, { ... }, ... ] }, ... ] "accumulation": { "components": [ { "id": 2, "attributes": [...]}, { ... }, ... ] } }
Example model - JSON syntax
Example model | JSON syntax
{ "model": { "applicationId": "Bearinx", "applicationVersion": "12.0.8823", "date": "2021-07-01T12:18:38+01:00", "version": "1.3", "relations": [ { "id": 48, "type": "assembly", "refs": [ {"hint": "gear_unit","id": 1,"role": "assembly"}, {"hint": "gear_casing","id": 2,"role": "part"} ] }, { "id": 49, "type": "side", "refs": [ {"hint": "concept_bearing","id": 40,"role": "assembly"}, {"hint": "shaft","id": 13,"role": "inner_part"}, {"hint": "gear_casing","id": 2,"role": "outer_part"} ] } ... ] "components": [ { "id": 1, "name": "Transmission unit", "type": "gear_unit", "attributes": [ {"id": "example_string", "string": "30203-A"}, {"id": "example_floating_point_unit", "unit": "mm", "floating_point": 2.0}, {"id": "example_floating_point_without_unit", "unit": "none", "floating_point": 0.1}, {"id": "example_integer", "integer": 3}, {"id": "example_boolean", "boolean": false}, {"id": "example_enum", "enum": "both_directions" }, {"id": "example_floating_point_array", "unit": "mm","floating_point_array": [1.0,0.0,0.0]}, {"id": "example_floating_point_matrix", "unit": "mm", "floating_point_matrix": [[1.0,0.0,0.0], [0.0,1.0,0.0], [0.0,0.0,1.0]] }, {"id": "example_array_coded", "unit": "mm", "floating_point_array_coded": {"code": "float64", "value": "62wRNhgQS0AAAAAAAAAAANgPsyG1MXDA"}}, {"id": "example_array_of_arrays", "array_of_integer_arrays": [[108,2,1,107,7],[0,1,0],[0,7,0,1]]}, ] } { "id": 2, "name": "Input shaft", "type": "shaft", "attributes": [ ... ] } ... ] "load_spectrum": { "id": 1, "load_cases": [ { "id": 2, "components": [ { "id": 2, "attributes": [ ... ] }, { ... }, ... ] }, { ... } ] "accumulation": { "components": [ { "id": 2, "attributes": [ ... ] }, { ... }, ... ] } } } }