create a relational dataset

Function Description

Used to create a relational dataset in a data source, managing the association between two dataset objects. For example, dataset A stores information about real estate units (plots) in an administrative area (real estate unit number, plot usage, area), dataset B stores information about real estate rights holders (name, ID number, real estate unit number). By creating an association between dataset A and dataset B based on the key field "real estate unit number", when browsing or querying a plot in dataset A, you can instantly associate and obtain all information about the rights holder corresponding to that plot.

Before using this function, you need to note the following constraints:

  • Supported dataset types: 2D point/line/region datasets, attribute datasets.
  • Quantity constraint: A dataset can only create one relationship class dataset. If dataset A has already created a relational dataset with dataset B, then neither dataset A nor B can create a relational dataset with dataset C.
  • Type constraint: The types of the primary key and foreign key must be consistent, but binary and date types are not supported.
  • Data source types: Only PostGIS and UDB/UDBX data sources are supported; other data sources and EMS data sources are not supported.

Function Entry

  • Workspace Manager -> PostGIS, UDB/UDBX 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 to-be-related datasets are located. Defaults to the selected data source in the Workspace Manager, and can be modified.

Datasource

source dataset

Sets the dataset that establishes a relationship with the relation.

As in the above example, dataset A.

String
Source Primary Key

Sets the field in the source dataset used to associate with the relation. Defaults to the first field of the dataset, and the corresponding field can be selected from the dropdown menu.

As in the above example, the "real estate unit number" field in dataset A.

String
relation

Sets the dataset that establishes a relationship with the source dataset.

As in the above example, dataset B.

String
Associated Primary Key

Sets the field in the associated dataset used to associate with the source dataset. Defaults to the first field of the dataset, and the corresponding field can be selected from the dropdown menu.

As in the above example, the "real estate unit number" field in dataset B.

String
Relationship Type

Sets the association behavior between the two dataset objects, offering weak association and strong association.

  • Weak association: When the source object is deleted, the key field value of the referenced object becomes null, and the referenced object is not deleted. The current version does not support this.
  • Strong association: When the source object is deleted, the referenced object is deleted simultaneously. The current version does not support this.
String
Relationship Model

Sets the logical model of association between the two dataset objects, including one-to-one (1:1) and one-to-many (1:N).

  • One-to-one: A record in the source dataset can only correspond to one record in the relation, and a record in the relation can only correspond to one record in the source dataset.
  • One-to-many: A record in the source dataset can correspond to multiple records in the relation, but a record in the relation can only correspond to one record in the source dataset. In this relationship model, the "one" must point to the source dataset, and the "many" must point to the "relation".
RelationshipCardinalityType
Forward Relationship Label Sets the relationship description when associating from the source dataset to the relation. After setting, it can be viewed through the object properties panel. String
Reverse Relationship Label Sets the relationship description when associating from the relation to the source dataset. After setting, it can be viewed through the object properties panel. String
relation dataset

Sets the name of the generated relation dataset, defaulting to "source_dataset_name_relation_dataset_name". Its naming rules are consistent with those of ordinary datasets:

  • Composed of Chinese characters, letters, numbers, and underscores, but cannot start with a number or underscore.
  • The length cannot be 0 and must not exceed 59 characters, i.e., 59 English letters or 59 Chinese characters. If the dataset name exceeds 59 characters, the excess part will be automatically truncated.
  • Cannot contain illegal characters, such as spaces, parentheses, etc.
  • Cannot conflict with reserved fields of various databases.
String

Output Result

Adds a new relation dataset under the data source node.