- 入门指南
- 许可
- 设置和配置
- Using the service
- 参考
- Examples and tutorials

Data Fabric user guide
在项目中使用实体
By using entities created in Data Fabric, you can manage and manipulate data aggregated in a single object, without having to work with it in a granular way. To do so you need Studio v2020.8 or later.
以下示例检索奥运会各个项目所获奖牌数前 10 名的国家/地区的相关数据,以及它们获得的奖牌。
Following the steps detailed on the Creating an entity page, we created an entity for storing information about participating nations, the opening and closing dates, and the medals they won.
“奥运会”实体具有以下字段:“名称”、“国家/地区”、“开幕日期”和“闭幕日期”。“奖牌”实体具有以下字段:“国家/地区”、“金牌”、“银牌”、“铜牌”以及奖牌总数。这两个实体通过“关系”标签相互关联。
在 Studio 的工作流中导入实体。
以下工作流将抓取有关某届奥运会的信息,将数据映射到参数,并将其传递到主工作流。
To do so we defined an argument for each type of information that we are collecting, thus resulting in five imported arguments.
通过使用实体,我们只需导入并使用两个参数即可收集数据。
inOlympics Year
和 outOlympics
)、其各自的属性和实体中定义的字段。通过使用实体,我们通过将数据正确映射到其各自的实体字段,减少了传递信息所需的参数个数。
Once the data was collected, you can use the Create Entity Record activity to add the information to Data Fabric.
In this example, we used the imported arguments to pass the collected information to Data Fabric. The Input and Output records are the values of variables of type Olympics used for passing along the data.
After running the project, the following record was created in Data Fabric:
Records structured in a data table can be passed along to Data Fabric using the For Each Row activity. In this example, we're invoking a workflow that collects structured data on the number of medals won by each country and passes these records along to Data Fabric.
After running the workflow, the following data is stored in Data Fabric:
通过在“奥运会”实体和“奖牌”实体之间设置关系,两者中的数据记录都可以在另一个实体中使用。例如,“奖牌”实体中的“奥运会”字段的值与相关实体中的值相同。
The Query Entity Records activity can be used to pull up a list of records from Data Fabric. In the following example, we use the activity to query data records from the Olympics entity, allow the user to choose an Olympics edition, and from the Medals entity write the number of medals that each participating country won.
Name != NULL
条件。这将遍历“名称”列中的所有记录,并在 listOlympics
变量中输出这些记录,以在“输入对话框”活动中使用。
listOlympics.Select(Function (o as Olympics) o.Name).ToArray
。或者,也可以使用“遍历循环”活动。
selectedOlympics
变量,并在另一个“查询实体记录”活动中使用所选内容来遍历在特定一届奥运会上所获奖牌的列表。此条件是通过在查询生成器中使用 equals
选项设置的。
可对选定实体和相关的实体记录执行查询。
Data Fabric can potentially store a large number of records. To query only a certain number of records, use the Pagination properties from the Query Entities Records activity. The Top property supports a maximum number of 1,000, this means that 1,000 records can be queried at a time.
本示例先查询前五个记录,然后再查询接下来的五个记录,直到抓取列表中的最后一个记录为止。
skip
Int64 变量分配了初始值 0
,然后在每个循环后将其值递增,直到抓取最后一个记录为止。
抓取前五枚奖牌后,使用“遍历循环”活动将参与国家/地区及其所获奖牌数写入到记事本文件。
The following scenario explains the steps for updating an entity schema in Data Fabric and then syncing the data with Studio.
In Data Fabric, go to the Medals entity, select Create New Field, and add a new column HostCountry of type Yes/No. Select Save.
In Studio, select on Manage Entities, and then the Refresh button. A change was detected for the Medals entity, as illustrated in the Changes column. Select Save and the entity is updated in Studio.
The Update Entity Record activity can be used for updating records from your workflow directly into Data Fabric.
在本示例中,我们将从“奖牌”实体查询某些记录,并使用上述活动自动更新这些记录。
在“奖牌”实体中,每届奥运会的主办国家名称旁边标有星号。例如,对于 2012 奥运会,主办国家在“奥运会”列中记录为“英国 (GBR)*”。
listMedals
变量中抓取记录,使用“遍历循环”活动遍历循环每个项目,并在“主办国家”列中在主办特定一届奥运会的国家旁边分配“True”值。
The Update Entity Record activity can be used in numerous other scenarios for passing along data and updating records in Data Fabric.