Introduction
One of the most powerful features of RDataCore is its flexible approach to organizing entities in hierarchical structures. Unlike traditional systems that require you to create explicit folder entities, RDataCore uses a path-based system that automatically establishes parent-child relationships while keeping your database lean and efficient.
In this article, we'll explore how entity hierarchies work in RDataCore, from creating entities with custom paths to leveraging the import system for bulk data operations. Whether you're managing customers, orders, products, or any other data type, understanding these concepts will help you build a clean, navigable data structure.
If you're new to RDataCore, you might want to read our guide on Entities and Entity Definitions first to understand the basics.
Free-Form Entity Paths
When creating a new entity in RDataCore, you're not limited to predefined folder structures. Instead, you can specify any path you want for your entity. This path becomes the entity's location in the hierarchical tree view.
For example, when creating a new Customer entity, you might set the path to
/Clients. The system recognizes that this path doesn't exist yet and helpfully indicates that it will create a new folder called "Clients" to house your entity.This approach gives you complete freedom to organize your data in whatever way makes sense for your business. Want to organize customers by region? Use paths like
/Europe/Germany/Customers or /APAC/Japan/Customers. Need to separate B2B from B2C? Create paths like /B2B/Enterprise/Customers and /B2C/Retail/Customers.The key insight here is that you don't need to pre-create these folder structures. Simply specify the path when creating your entity, and RDataCore handles the rest.

Automatic Parent Resolution
One of the most convenient features of RDataCore's path system is automatic parent resolution. When you start typing a path, the system searches for existing entities that match your input and offers them as suggestions.
This becomes particularly powerful when building relationships between entities. Imagine you've already created a Customer entity at
/Clients/john-doe--john@doe.com. Now you want to create an Order entity that belongs to this customer. As you type /Cl in the path field, RDataCore immediately suggests the existing customer entity.By selecting this suggestion, you're not just placing your Order in the same folder; you're establishing a direct parent-child relationship. The new Order entity will have the Customer as its parent, creating a meaningful connection in your data model.
This automatic parent resolution works across all entity types. You can create deep hierarchies like
/Clients/john-doe/Orders/order-123/Items/item-456 where each level represents a real entity with proper parent-child relationships.
Virtual Folders: No Database Overhead
Here's where RDataCore's design philosophy really shines. When you create a path like
/Clients/john-doe, the "Clients" portion appears as a folder in the entity tree view. But here's the clever part: this folder doesn't exist as an actual entity in the database.RDataCore uses "virtual folders" to display hierarchical paths in the UI. These folders are purely visual constructs that help you navigate your data. They don't consume database resources, don't require management, and don't add complexity to your data model.
This approach has several benefits:
- Reduced Database Footprint: You only store actual data entities, not organizational containers
- Simplified Management: No need to create, update, or delete folder entities
- Flexible Reorganization: Virtual paths can be changed without migrating folder records
- Clean Data Model: Your entity definitions focus on real business objects, not structural elements
In the tree view, you'll see folder icons for virtual paths and entity-type-specific icons for actual entities. This visual distinction helps you quickly understand your data structure at a glance.
Parent-Child Relationships
Every entity in RDataCore maintains explicit relationships to its parent (and children, if any). These relationships are visible in the Entity Details panel under the "Relationships" section.
When you view an entity's details, you'll see:
- Parent: The UUID of the parent entity (if one exists)
- Children: A count of child entities (if any exist)
These relationships are more than just organizational; they're queryable. You can use the API to fetch all children of a specific entity, traverse up the hierarchy to find ancestors, or build complex queries that leverage the parent-child structure.
The relationship data includes the full path information, making it easy to understand exactly where an entity sits in your hierarchy. For instance, an Order might show its path as
/Clients/john-doe--john@doe.com indicating it's a child of the Customer entity at that location.
Import Integration with Path Resolution
RDataCore's path system becomes even more powerful when combined with the import functionality. When defining an import workflow, you can specify a target path for all imported entities.
In the import definition, you'll configure:
- Entity Definition: The type of entity to create (e.g., Customer)
- Path: The base path where entities should be created (e.g.,
/testo) - Field Mappings: How source data fields map to entity fields
The worker automatically resolves paths during import. If you import customer data with a specified path, each customer entity will be created at that location. The system handles parent resolution automatically: if entities already exist at parent paths, relationships are established accordingly.
This makes bulk data operations seamless. You can import thousands of records from CSV files, external APIs, or other sources, and each entity will be properly positioned in your hierarchy with correct parent-child relationships.
For more complex scenarios, you can even use dynamic path expressions that include data from the imported records themselves. For example, setting the path to
/Customers/{{region}} would automatically organize customers into region-based folders during import.
