Source: https://dev-docs.yueshu.com.cn/v5.3.2/database-gql-reference/overview/example-dataset/ Documentation version: v5.3.2 # 示例数据集 本文介绍文档中使用的示例数据集,并演示如何导入该数据集以进行数据探索。 ## 前提条件 已按[连接并完成首次查询](https://dev-docs.yueshu.com.cn/v5.3.2/get-started/first-query/#ngql)使用 [ngql](https://dev-docs.yueshu.com.cn/v5.3.2/utilities/ngql/) 连接悦数图数据库开发版服务组。 ## 数据集介绍 示例数据集是一个用于电影推荐的知识图数据集。下图展示了知识图中的实体和实体间的相互关系: [![knowledge graph](https://docs-cdn.nebula-graph.com.cn/figures/5.0/core-overview-240806-movie-recommendation.png)](https://docs-cdn.nebula-graph.com.cn/figures/5.0/core-overview-240806-movie-recommendation.png) 图1:知识图中的实体和相互关系 为了在 GQL 中实现该数据集,引入了以下点类型和边类型: | 点类型 | 标签 | 属性 | 主键 | User | `Person` | `id` | `id` | Actor | `Person` | `id`,`name`,和`birthDate` | `id` | Director | `Person` | `id`,`name`,和`birthDate` | `id` | Movie | `Movie` | `id`和`name` | `id` | Genre | `Genre` | `id`和`name` | `id` 表1:数据集中的点类型 | 边类型 | 标签 | 属性 | 起始点类型 | 目标点类型 | Watch | `Watch` | `rate` | `User` | `Movie` | Act | `Act` | 无 | `Actor` | `Movie` | Direct | `Direct` | 无 | `Director` | `Movie` | WithGenre | `WithGenre` | 无 | `Movie` | `Genre` 表2:数据集中的边类型 下图以表格形式展示了数据集的图模型: [![graph model](https://docs-cdn.nebula-graph.com.cn/figures/5.0/core-overview-tabular_schema.jpg)](https://docs-cdn.nebula-graph.com.cn/figures/5.0/core-overview-tabular_schema.jpg) 图2:数据集的图模型 ## 加载数据集至悦数图数据库开发版 1. 在 ngql 中运行以下命令以加载数据集: ```` :play movie ```` 2. 验证数据集是否成功加载,可运行以下语句以展示所有图: ```` SHOW GRAPHS ```` 返回: ```` +----------+------------+-----------------+-------+ | name | graph_type | schema | owner | +----------+------------+-----------------+-------+ | movie | movie_type | /default_schema | root | +----------+------------+-----------------+-------+ ```` ## 获取数据集文件 如需获取数据集原始文件,单击[此处](https://docs-cdn.nebula-graph.com.cn/files/5.x-utilities/import_movie.zip)下载 CSV 格式的完整数据集文件。