跳转至

Struct properties and shared property types(结构体属性与共享属性类型)

Struct properties can be used by local and shared property types. When converting, or promoting a local property type to a shared property type, struct fields need to be re-mapped. Local struct property types backed by shared property types will inherit shared property type fields except for the struct field resource identifiers (RIDs). Struct field metadata (display name, description, aliases) will then be inherited from the shared property type, but struct fields with keep their original RIDs.

Create a struct type shared property

  1. In Ontology Manager, you can create a struct type shared property in two ways:
  2. From the top right of the homepage, select New > Shared property Shared property option from the New dropdown menu.

  3. Select Shared properties > + New shared property + New shared property option in the Shared properties tab.

  4. In the main panel, select the New shared property button. This will open a helper where you can configure metadata of the shared property including the name, description, aliases, and API name. Then select Next to proceed.

    The 'Create shared property' dialog.

  5. Configure the base type, value type, visibility, and whether to require values for the property.

    Create shared property window on the configuration step.

  6. Select a project to save this shared property to.

    Select save location for the shared property.

  7. Back in Ontology Manager, select Save in the upper right corner to make the change to your ontology.

Attach a struct type shared property

  1. In Ontology Manager, open the Properties tab and select the desired property from the Properties table.
  2. In the Property editor to the right, scroll down to Shared property and select a shared property under Assign. This will share property metadata among both properties.

The shared property dropdown in the Assign section.

Note: To add new struct fields after assigning a shared property type to a local struct property type, you must add the new struct fields to the shared property type and map them to datasource columns for all local struct property types that are backed by the shared property.

Convert a struct property type into a shared property

The following instructions detail how to convert a struct property into a struct property backed by a shared property type.

  1. In Ontology Manager, open the Properties tab and select the desired property from the Properties table.
  2. In the Property editor to the right, scroll down and select Convert to a shared property, which backs the struct property by a shared property type.

The 'Convert to a shared property' button in the Property editor.


中文翻译


结构体属性与共享属性类型

结构体属性(struct properties)可被本地属性类型和共享属性类型使用。在将本地属性类型转换或提升为共享属性类型时,需要重新映射结构体字段。由共享属性类型支持的本地结构体属性类型将继承共享属性类型的字段,但结构体字段资源标识符(RID)除外。结构体字段元数据(显示名称、描述、别名)将从共享属性类型继承,但结构体字段将保留其原始RID。

创建结构体类型共享属性

  1. 在Ontology Manager中,您可以通过两种方式创建结构体类型共享属性:
  2. 从主页右上角选择 新建 > 共享属性 从新建下拉菜单中选择共享属性选项。

  3. 选择 共享属性 > + 新建共享属性 共享属性选项卡中的+新建共享属性选项。

  4. 在主面板中,选择 新建共享属性 按钮。这将打开一个辅助窗口,您可以在其中配置共享属性的元数据,包括名称、描述、别名和API名称。然后选择 下一步 继续。

    “创建共享属性”对话框。

  5. 配置属性的基础类型、值类型、可见性以及是否要求值。

    配置步骤中的创建共享属性窗口。

  6. 选择一个项目来保存此共享属性。

    选择共享属性的保存位置。

  7. 返回Ontology Manager,选择右上角的 保存将更改应用到您的本体

附加结构体类型共享属性

  1. 在Ontology Manager中,打开 属性 选项卡,并从 属性 表中选择所需属性。
  2. 在右侧的 属性编辑器 中,向下滚动到 共享属性,并在 分配 下选择一个共享属性。这将使两个属性共享属性元数据。

分配部分中的共享属性下拉菜单。

注意: 在将共享属性类型分配给本地结构体属性类型后,若要添加新的结构体字段,必须将新结构体字段添加到共享属性类型,并为其映射数据源列,适用于所有由该共享属性支持的本地结构体属性类型。

将结构体属性类型转换为共享属性

以下说明详细介绍了如何将结构体属性转换为由共享属性类型支持的结构体属性。

  1. 在Ontology Manager中,打开 属性 选项卡,并从 属性 表中选择所需属性。
  2. 在右侧的 属性编辑器 中,向下滚动并选择 转换为共享属性,这将使结构体属性由共享属性类型支持。

属性编辑器中的“转换为共享属性”按钮。