Function Description
Used to create a relational dataset within a data source, managing the association between two dataset objects. For example, Dataset A stores real estate unit (parcel) information (real estate unit number, land use, area) within a certain administrative region, while Dataset B stores information about real estate right holders (name, ID number, real estate unit number). By creating a one-to-many relationship between Dataset A and Dataset B based on the key field "real estate unit number," you can instantly associate and retrieve all information about the right holders corresponding to a specific parcel when browsing or querying Dataset A.
Before using this function, please note the following limitations:
- Supported dataset types: 2D point/line/region datasets, 3D point/line/region datasets, CAD datasets, text datasets, and attribute datasets.
- Quantity limit: A dataset can only create one relational dataset. If Dataset A has already created a relational dataset with Dataset B, neither Dataset A nor B can create another relational dataset with Dataset C.
- Type restrictions: The primary key and foreign key types must be consistent, but binary and date types are not supported. Once a relationship is created, the fields cannot be modified; otherwise, the relationship will become invalid.
- Data source types: Only PostGIS and UDBX data sources are supported. Other data sources and EMS data sources are not supported.
Function Entry
- Workspace Manager -> Data Source Context Menu -> New Dataset -> Relation Dataset.
- Start Tab -> New Dataset Group -> Relation Dataset.
- Toolbox -> Data Management -> Relation Dataset -> Create a Relational Dataset.
Parameter Description
Parameter Name | Parameter Interpretation | Parameter Type |
Data Source |
Sets the data source where the two datasets to be related are located. By default, it is the selected data source in the Workspace Manager and can be modified. |
Datasource |
Source Dataset |
Sets the dataset to establish a relationship with the relation dataset. For example, Dataset A in the above example. |
String |
Relation |
Sets the dataset to establish a relationship with the source dataset. For example, Dataset B in the above example. |
String |
Type of Relationship |
Sets the association behavior between two dataset objects, offering weak association and strong association.
|
String |
Relational Model |
Sets the logical model for the association between two dataset objects, including one-to-one (1:1), one-to-many (1:N), and many-to-many (M:N).
|
RelationshipCardinalityType |
Message Direction |
Sets the message propagation direction to determine the notification scope of related operations. For example, with a forward direction (from source to relation) and a strong relationship type: If object A in the source dataset is deleted, the system will send a deletion notification to the relation dataset and automatically delete the related objects in it. However, deleting an object in the relation dataset will not send a notification to the source dataset or trigger any operations on it. The current version does not support related operations; only creating relations is supported. The following options are available:
|
NotificationType |
Forward Relationship Label | Sets the relationship description when associating from the source dataset to the relation dataset. Once set, it can be viewed in the object properties panel. | String |
Reverse Relationship Label | Sets the relationship description when associating from the relation dataset to the source dataset. Once set, it can be viewed in the object properties panel. | String |
Relation Dataset |
Sets the name of the generated relational dataset. The default is "SourceDatasetName_RelationDatasetName." Its naming rules are consistent with those of ordinary datasets. |
String |
Relationship Attribute |
Specifies whether the relational dataset has attributes, i.e., whether it is necessary to edit the relational dataset properties table to specifically define the association between the two dataset objects.
|
Boolean |
Source Primary Key |
In non-attribute-based one-to-one and one-to-many relationships, the source primary key is the field in the source dataset associated with the relation dataset. In attribute-based or many-to-many relationships, the source primary key is the field in the source dataset associated with the relational dataset. By default, it is the first field of the source dataset and can be selected from the dropdown menu. For example, the "real estate unit number" field in Dataset A. |
String |
Source Foreign Key |
In non-attribute-based one-to-one and one-to-many relationships, the source foreign key is the field in the relation dataset associated with the source dataset. For example, the "real estate unit number" field in Dataset B. In attribute-based or many-to-many relationships, the source foreign key is the field in the relational dataset associated with the source dataset. This field must be manually entered and should comply with the field naming rules, such as not containing illegal characters and not starting with two consecutive letters "sm." |
String |
Associate the Primary Key | In attribute-based or many-to-many relationships, the associate primary key is the field in the relation dataset associated with the relational dataset. | String |
Associate Foreign Keys | In attribute-based or many-to-many relationships, the associate foreign keys are the fields in the relational dataset associated with the relation dataset. This field must be manually entered and should comply with the field naming rules, such as not containing illegal characters and not starting with two consecutive letters "sm." | String |
Output Result
A new relational dataset is added under the data source node.