Files
brapi-java/docs/dev/04-germplasm/08-germplasm_attribute_definition.md
2026-05-28 11:56:17 +08:00

56 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 04 Germplasm / Seed - germplasm_attribute_definition 表录入说明
来源:`docs/architecture/04-germplasm-seed-data-flow.md`
## 录入目标
`germplasm_attribute_definition` 定义 germplasm 可维护的属性。它继承变量定义体系,可关联 crop、trait、method、scale、ontology。
## 上下游关系
| 类型 | 内容 |
| --- | --- |
| 表 | `germplasm_attribute_definition` |
| Java 实体 | `GermplasmAttributeDefinitionEntity` |
| 前置依赖 | `crop``trait``method``scale``ontology` |
| 下游引用 | `germplasm_attribute_value` |
| API | `/brapi/v2/attributes` |
## 字段录入
| 字段 | 业务意义 | 录入方式 | 校验规则 |
| --- | --- | --- | --- |
| `id` | 属性定义主键 | 系统生成;导入可指定 | 必填、唯一 |
| `auth_user_id` | 数据所属用户 | 登录上下文自动写入 | 不允许前端手填 |
| `name` | 属性名称 | 用户录入 | 必填 |
| `code` | 属性编码 | 用户录入 | 可选,建议唯一 |
| `pui` | 永久标识 | 用户录入 | 可选,建议唯一 |
| `attribute_category` | 属性分类 | 下拉/文本 | 可选 |
| `datatype` | 数据类型 | 下拉 | 建议必填 |
| `description` | 属性说明 | 多行文本 | 可选 |
| `uri` | 外部 URI | URL 输入 | 可选URL 格式校验 |
| `crop_id` | 作物 | Crop 选择器 | 可选 |
| `trait_id` | 性状 | Trait 选择器 | 可选 |
| `method_id` | 方法 | Method 选择器 | 可选 |
| `scale_id` | 标尺 | Scale 选择器 | 可选 |
| `ontology_id` | 本体 | Ontology 选择器 | 可选 |
| `documentationurl` | 文档链接 | URL 输入 | 可选 |
| `status` | 状态 | 下拉/文本 | 可选 |
| `default_value` | 默认值 | 文本 | 可选 |
| `growth_stage` | 生育期 | 文本 | 可选 |
| `institution` | 机构 | 文本 | 可选 |
| `language` | 语言 | 文本 | 可选 |
| `scientist` | 科学家/维护人 | 文本 | 可选 |
| `submission_timestamp` | 提交时间 | 日期时间 | 可选 |
## 页面与交互
- Attribute Definition 列表页支持按 crop、category、datatype、keyword 查询。
- 创建 attribute value 前必须先有 definition。
## 关键校验
1. `name` 必填。
2. 已被 `germplasm_attribute_value` 引用时不允许物理删除。
3. `datatype` 要与 value 输入控件联动。