Prompt
Para una primera versión sobre la que trabajar nosotros más tarde, es interesante usar un agente, Claude especialmente usando este prompt, que generará un .json generalmente bastante bueno de modelo, que podremos nosotros trabajar sobre él.
**Role:**Act Expertas Dataa EngineerRadiXML Architecture Expert. Your goal is to generate a comprehensive .json configuration model for RadiXML (XML Mapping & Conversion Engine).
**Objective:** Generate a high-fidelity [.json] model configuration that maps amapping Source XML schemadata to a Target XML schema.structure. ---Follow these technical specifications strictly to ensure model integrity and editor usability.
### 📥 INPUTS REQUIRED
1. **INPUT DATA
- Source Name:** [Name]INSERT SOURCE NAME]
- Target Name: [INSERT TARGET NAME]
- Source XML Body: [PASTE SAMPLE SOURCE XML HERE]
- Target XML Body: [PASTE SAMPLE TARGET XML HERE]
### 2. **NAMING CONVENTIONS AND METADATA
- name: "[Source Name] to [Target Name:**Name]"
- sourceFormat: "[Source Name]"
- targetFormat: "[Target Name]"
- version: "1.0.1"
- Filename Recommendation: Instruct the user to save the result as "[Source Name]_to_[Target Name].json".
### 3. **Source XML:** [Paste Sample XML]
4. **Target XML:** [Paste Sample XML]
---
### 🛠 TECHNICAL LOGICARCHITECTURE &(DATA CONSTRAINTSFLOW)
####RadiXML 1.uses Nodea Typesport-based &connection Logicsystem. To process data, you must implement a complete chain:
- **Sources:**SOURCE NODES: Define in nodes.sources. Use fullabsolute XPathXPaths for the `path`path property (e.g., `"//RadInstrumentData/Element`MeasurementInformation/MissionId").
- **CustomCUSTOM NodesNODES (Logic)LOGIC):** UseDefine thesein for ALL transformations. Legacy "transform" nodes are deprecated.nodes.customs.
- **Language:**inputs: Always `javascript`.
- **Inputs:** Define variables in the `inputs`An array (nameof and type).
- **Code Snippet:** Must use the variable names from `inputs`variables (e.g., `return[{"name": inputs.val"rawVal", *"type": 1000;`"number"}]).
- code: Pure JavaScript logic. Use input variable names exactly as defined (e.g., "return inputs.rawVal **Outputs:** 1.5;").
- outputs: An array defining the output identity (e.g., [{"name": "calculatedResult", "type": "number"}]).
- CONNECTIONS: Explicitly map the flow in the connections array.
- { "from": "source-node-id", "to": "custom-node-id", "toPort": "inputVariableName" }
- IMPORTANT: The first output name is the unique key used to link the result to the final XML structure.
#### 2. Authoritative Connection Logic
- **Source to Custom:** Connection MUST include `toPort`. The `toPort`toPort must match the input variable name in the custom node.node -exactly. **CustomMismatches towill Target:**result Mappedin bynull ID.data -transmission.
**Structure### Mapping:**4. ThisOUTPUT MAPPING (THE STRUCTURE ARRAY)
The structure array is the criticalauthoritative "glue"template section. Infor the `structure`generated array:XML. The sourcePath property determines where data is pulled from:
- IfDirect a field is static:Mapping: Use `"value":the "Static Text"`.
- If a field is mapped from aabsolute Source Node: Use `"sourcePath": "//XPath/From/Source"`.
- If a field is mapped from a Custom Node: Use `"sourcePath": "output_variable_name"`.
- **Attributes:** Map target attributes using the `@` syntaxXPath (e.g., `Element/@attributeName`"//Measurement/StartTime").
#### 3. Visual Layout Pro-Rules
- **X-Coordinates:** Source=`100`, Custom=`500`, Target=`1000`.
- **Logic Mapping: Use the Name of the Custom Node Output (e.g., "calculatedResult").
- Attribute Mapping: Use the @ symbol in the path (e.g., "ParentNode/ChildNode/@attributeName").
- Static Values: Use "value": "text" instead of sourcePath.
### 5. VISUAL LAYOUT CALIBRATION
- X-Coordinates (Columns): Sources = 100, Custom Nodes = 500, Target Nodes = 1000.
- Y-Coordinates:**Coordinates (Rows): Start at `80`80. Increment by 60px (80, 140, 200...) Spacing=`100`.for each row.
- **RowChain Alignment:** IfAll nodes in a single transformation chain (Source A-> leadsCustom to-> Target A, bothTarget) must haveshare the exact same `y`Y value.coordinate ---for horizontal alignment.
### 📋6. COMPREHENSIVE JSON SCHEMA EXAMPLE REFERENCE STRUCTURE
```json
{
"name": "UPCSOURCE to ENVINET"TARGET",
"version": "1.0.0"1",
"sourceFormat": "UPC"SOURCE",
"targetFormat": "ENVINET"TARGET",
"rootElement": "RadInstrumentData"RootTag",
"namespaces": {
"n42": "http://physics.nist.gov/N42/2011/N42",
"envinet": "[http://www.envinet.com/](http://www.envinet.com/)...", "n42": "..."ftp/public/MONA/N42SchemaAddin"
},
"nodes": {
"sources": [
{ "id": "src-dose"val", "label": "DoseSource Rate"Label", "path": "//RadMeasurement/DoseValue"Source/Tag/Path" }
],
"customs": [
{
"id": "cust-milli"math",
"label": "ToTransformation Milli"Logic",
"language": "javascript",
"code": "return (parseFloat(inputs.valvIn) ||* 0) / 1000;1.25).toFixed(2);",
"inputs": [ { "name": "val"vIn", "type": "number" } ],
"outputs": [ { "name": "dose_milli"vOut", "type": "number" } ]
}
],
"targets": [
{ "id": "tgt-dose"val", "label": "DoseTarget Rate"Label", "path": "RadMeasurement/DoseRate"Target/Path/Tag" }
]
},
"connections": [
{ "from": "src-dose"val", "to": "cust-milli"math", "toPort": "val"vIn" },
{ "from": "cust-milli"math", "to": "tgt-dose"val" }
],
"structure": [
{
"element": "RadInstrumentData"RootTag",
"attributes": {
"n42DocUUID": { "sourcePath": "uuid_from_custom_node"vOut" }
},
"children": [
{ "element": "RadMeasurement"DataField", "children"sourcePath": ["vOut" },
{ "element": "DoseRate"LiteralField", "sourcePath": "dose_milli"//Source/Other/Path" }
]}
]
}
],
"visualModel": {
"nodes": [
{ "id": "src-dose"val", "type": "source", "x": 100, "y": 80, "label": "Dose Rate"80 },
{ "id": "cust-milli"math", "type": "custom", "x": 500, "y": 80, "label": "To Milli"80 },
{ "id": "tgt-dose"val", "type": "target", "x": 1000, "y": 80, "label": "Dose Rate"80 }
],
"connections": [
...identical...{ "from": "src-val", "to": "cust-math", "toPort": "vIn" },
{ "from": "cust-math", "to": "tgt-val" }
]
}
}
[GENERATEFINAL THEINSTRUCTION: FULLProvide the full JSON NOWobject BASEDbased ONon THEthe PROVIDEDsupplied SOURCEXML AND TARGET XMLS] [RECOMMEND FILENAME: SourceName_to_TargetName.json]schemas.]