Model Merge Tool User Guide
Overview
The Model Merge Tool allows you to combine properties from multiple DataFlood schemas into a single unified schema. This is useful for creating composite models, consolidating related schemas, or building complex data structures from simpler components.
Key Features
- Visual Drag-and-Drop: Intuitive interface for selecting and merging properties
- Conflict Resolution: Automatic detection and resolution of naming conflicts
- Type Compatibility: Validates type compatibility during merge
- Statistical Model Preservation: Maintains string models and histograms
- Preview Mode: See the merged result before saving
- Selective Merging: Choose specific properties to include
Interface Layout
┌─────────────────────────────────────────────────────────┐
│ Model Merge Tool │
├──────────────────┬─────────────────┬──────────────────┤
│ │ │ │
│ Source Model 1 │ Merge Area │ Source Model 2 │
│ │ │ │
│ ┌─ Properties │ ┌─ Merged │ ┌─ Properties │
│ ├─ customerId │ ├─ customerId │ ├─ userId │
│ ├─ name │ ├─ name │ ├─ username │
│ ├─ email │ ├─ email │ ├─ email │
│ └─ address │ ├─ address │ └─ profile │
│ │ ├─ userId │ │
│ │ └─ profile │ │
│ │ │ │
├──────────────────┴─────────────────┴──────────────────┤
│ [Load Model 1] [Load Model 2] [Preview] [Save Merged] │
└─────────────────────────────────────────────────────────┘
Getting Started
Opening the Merge Tool
From Menu
Tools → Model Merge
From Toolbar Click the "Merge" icon
From Project Tree Right-click multiple models → "Merge Selected"
Loading Source Models
Method 1: Load from Files
- Click "Load Model 1" button
- Select first schema file
- Click "Load Model 2" button
- Select second schema file
Method 2: Drag from Project Tree
- Drag first model to left panel
- Drag second model to right panel
Method 3: From Open Tabs
- Right-click on tab → "Send to Merge Tool"
- Choose position (Model 1 or Model 2)
Merging Properties
Basic Merge Operations
Drag and Drop
- Select property from source model
- Drag to merge area
- Drop in desired position
Context Menu
- Right-click property in source
- Select "Add to Merged Model"
- Configure if needed
Select Multiple
- Ctrl+Click to select multiple properties
- Drag selection to merge area
- All selected properties are added
Handling Conflicts
Name Conflicts
When properties have the same name but different definitions:
Automatic Detection
- Conflicting properties highlighted in yellow
- Warning icon appears
Resolution Options
- Keep Both: Rename one property
- Replace: Use one definition
- Merge: Combine compatible definitions
- Custom: Manually edit
Example:
// Model 1: email
{
"type": "string",
"format": "email",
"maxLength": 100
}
// Model 2: email
{
"type": "string",
"format": "email",
"maxLength": 255
}
// Merged (with merge option)
{
"type": "string",
"format": "email",
"maxLength": 255 // Takes larger constraint
}
Type Conflicts
When properties have incompatible types:
Warning Display
- Red highlight on conflicting properties
- Error message in status bar
Resolution
- Choose one type
- Create union type (if supported)
- Skip property
Advanced Merging
Nested Object Merging
Merge nested structures:
Shallow Merge
- Drag entire object property
- Maintains structure
Deep Merge
- Expand nested objects
- Selectively merge sub-properties
- Combine nested structures
Example:
// Model 1: address
{
"type": "object",
"properties": {
"street": {"type": "string"},
"city": {"type": "string"}
}
}
// Model 2: address
{
"type": "object",
"properties": {
"city": {"type": "string"},
"country": {"type": "string"}
}
}
// Deep Merged
{
"type": "object",
"properties": {
"street": {"type": "string"},
"city": {"type": "string"},
"country": {"type": "string"}
}
}
Array Merging
Combine array definitions:
// Model 1: tags
{
"type": "array",
"items": {"type": "string"},
"maxItems": 5
}
// Model 2: tags
{
"type": "array",
"items": {"type": "string"},
"maxItems": 10
}
// Merged
{
"type": "array",
"items": {"type": "string"},
"maxItems": 10 // Takes larger limit
}
Statistical Model Handling
String Model Merging
When merging string properties with statistical models:
Vocabulary Combination
- Combines value frequencies
- Merges pattern lists
- Recalculates entropy
Pattern Merging
// Model 1 patterns: ["Llll", "Llll Llll"] // Model 2 patterns: ["LLLL", "Llll-Llll"] // Merged patterns: ["Llll", "Llll Llll", "LLLL", "Llll-Llll"]
Character Distribution
- Weighted average of distributions
- Preserves character probabilities
Histogram Merging
For numeric properties with histograms:
Bin Combination
- Merges overlapping bins
- Adjusts frequencies
- Maintains distribution shape
Range Extension
// Model 1: 0-100 // Model 2: 50-200 // Merged: 0-200 with adjusted bins
Configuration Options
Merge Settings
Access via Settings button or Edit → Merge Preferences:
{
"conflictResolution": "prompt|auto|manual",
"preserveRequired": true,
"mergeStatisticalModels": true,
"combineEnums": true,
"extendRanges": true,
"deepMerge": false
}
Conflict Resolution Modes
Prompt Mode (Default)
- Ask for each conflict
- Show resolution options
- Preview result
Auto Mode
- Apply rules automatically
- Use larger constraints
- Combine vocabularies
- Log decisions
Manual Mode
- Flag conflicts only
- Require manual resolution
- Full control
Preview and Validation
Preview Panel
Before saving, preview the merged schema:
- Click "Preview" button
- Review merged structure
- Check for warnings/errors
- Test with sample generation
Validation Checks
Automatic validation includes:
- Property name uniqueness
- Type compatibility
- Constraint consistency
- Required field conflicts
- Statistical model validity
Test Generation
Generate sample documents to verify:
- Click "Test Generate"
- Review sample outputs
- Adjust merge if needed
- Regenerate to confirm
Saving Merged Schema
Save Options
Save As New
- File → Save As
- Choose location and name
- Preserves source models
Replace Existing
- File → Save
- Overwrites current file
- Confirm before replacing
Add to Project
- Automatically adds to project
- Updates project references
Export Options
- DataFlood Model: Full model with statistical models
- Standard DataFlood Model: Standard DataFlood Model
- TypeScript: Interface definitions
- Documentation: Markdown documentation
Use Cases
Combining Related Entities
Merge customer and user schemas:
Customer Schema + User Schema = Complete Profile Schema
- customerId - userId - customerId
- billing - username - userId
- orders - preferences - billing
- orders
- username
- preferences
Building Composite Models
Create order schema from components:
Product + Customer + Payment = Order
- productId - customerId - orderId
- price - shipping - products[]
- inventory - contact - customer
- cardInfo - payment
- shipping
- total
Schema Evolution
Merge old and new versions:
Schema v1 + Schema v2 Updates = Schema v2 Complete
- Preserve existing fields
- Add new fields
- Update constraints
- Maintain compatibility
Best Practices
Before Merging
- Review source schemas
- Identify common properties
- Plan conflict resolution
- Consider final structure
During Merge
- Start with required fields
- Handle conflicts immediately
- Test frequently
- Document decisions
After Merging
- Validate thoroughly
- Generate test data
- Review statistical models
- Update documentation
Tips and Tricks
Keyboard Shortcuts
Shortcut | Action |
---|---|
Ctrl+M | Open merge tool |
Drag | Move properties |
Shift+Drag | Copy properties |
Delete | Remove from merged |
Ctrl+Z | Undo merge action |
F5 | Validate merged schema |
Ctrl+G | Test generate |
Quick Actions
- Double-click: Add property to merged
- Right-click: Context menu
- Ctrl+Click: Multi-select
- Alt+Drag: Clone property
Performance Tips
- Merge simple properties first
- Handle complex nested objects separately
- Use preview before large merges
- Save incrementally
Troubleshooting
Common Issues
Properties Won't Merge
- Check type compatibility
- Verify no circular references
- Ensure valid JSON structure
Lost Statistical Models
- Enable "Preserve Models" in settings
- Check model compatibility
- Manually re-add if needed
Merge Tool Crashes
- Reduce schema complexity
- Check for corrupted schemas
- Clear merge cache
- Restart application
Validation Errors
- Review conflict resolutions
- Check required fields
- Verify constraint logic
- Test with small samples
Advanced Features
Batch Merging
Merge multiple schemas at once:
- Select multiple schemas in project
- Right-click → "Batch Merge"
- Configure merge order
- Apply common rules
- Review and save results
Merge Templates
Save merge configurations:
- Configure merge settings
- Save as template
- Apply to similar merges
- Share with team
Scripted Merging
Use merge rules file:
{
"rules": [
{
"property": "email",
"action": "use-first"
},
{
"property": "address",
"action": "deep-merge"
}
]
}
Integration
With Model Editor
- Send merged schema to editor
- Continue refinement
- Add missing properties
With Tides Editor
- Use merged schema in sequences
- Create relationships
- Test generation flows
With CLI
- Export for command-line use
- Batch process merges
- Automate workflows
Next Steps
- Practice with Model Editor
- Learn Import/Export
- Explore Tides Editor
- Review Best Practices