Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 145 additions & 0 deletions docs/manuals/ADMIN/base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ SWORD APIの管理に関する操作手順を説明しています。

[3.4 インポートする 68](#インポートする)

[3.5 ヴァリデーションを設定する ](#ヴァリデーションを設定する)

[4. インデックスツリー管理 89](#インデックスツリー管理)

[4.1 インデックスツリーを管理する 90](#インデックスツリーを管理する)
Expand Down Expand Up @@ -3653,6 +3655,149 @@ CNRIハンドル設定ユーザ

・存在しないインデックスは指定しないでください。アイテム登録が正常に行われません。

### ヴァリデーションを設定する

アイテム登録時に実施されるヴァリデーション機能の設定方法について説明します。

#### 利用者

本機能を利用するには以下の条件を全て満たす必要があります。

- 管理者権限を有していること
- コンフィグ値 **「WEKO_ADMIN_VALIDATION_ENABLE」** が `True` に設定されていること
- コンフィグ値 **「WEKO_ADMIN_VALIDATION_STORAGE_LOCATION」** に Location 名が定義されていること
- 上記コンフィグで指定された Location が、WEKO のファイル管理機能に登録されていること

---

#### ヴァリデーション概要

アイテム登録時に、アイテムのメタデータに統制語彙に従わない値が含まれていないかを検証し、その結果をレポートとして出力します。
現在、本機能によるヴァリデーションは、ハーベスト(OAI-PMH、ResouceSync)を通じて登録されるアイテムのみを対象としています。
ヴァリデーション対象となるメタデータ項目や、使用する統制語彙の内容は、JSON 形式の設定ファイルにより定義します。

---

#### 設定方法

以下のヴァリデーション設定画面から、設定ファイルの登録を行います。

![ヴァリデーション設定画面](media/media/image_validation_1.png)

| 機能 | 項目説明 |
|---|---|
| アップロードボタン | 設定ファイルをアップロードするボタンです。ボタンを押下すると OS 標準のファイル選択ダイアログが表示され、ファイルを選択すると登録されます。<br>既に設定ファイルが登録されている状態で新しいファイルをアップロードした場合は更新扱いとなり、既存のファイルは削除され、新しくアップロードされたファイルが登録されます。なお、本機能ではバージョン管理を行わないため、更新前のファイルを取得することはできません。 |
| ダウンロードボタン | 登録されている設定ファイルをダウンロードするボタンです。設定ファイルが登録されていない場合は非活性となります。 |
| 削除ボタン | 登録されている設定ファイルを削除するボタンです。設定ファイルが登録されていない場合は非活性となります。 |
| バージョン情報 | 登録されている統制語彙 JSON ファイルに記載されたバージョン情報を表示します。設定ファイルが登録されていない場合は表示されません。 |
| OAI-PMH に関する設定状況 | 統制語彙 JSON ファイルにおいて、OAI-PMH のヴァリデーション機能が有効な場合は「活性」、無効な場合は「非活性」を表示します。設定ファイルが登録されていない場合は表示されません。 |
| ResouceSync に関する設定状況 | 統制語彙 JSON ファイルにおいて、ResouceSync のヴァリデーション機能が有効な場合は「活性」、無効な場合は「非活性」を表示します。設定ファイルが登録されていない場合は表示されません。 |



設定ファイルの項目を下表に記載します。

![統制語彙設定JSON ファイル](media/media/image_validation_2.png)

実際の設定ファイルは以下のような内容となります。

```
{
"version" : "0.0.1_sample",
"validationTargets" : [
{ "targetName" : "OAI-PMH", "isActive" : true },
{ "targetName" : "ResouceSync", "isActive" : true }
],
"controlledItems" : [
{ "vocabularyName" : "Data Type", "controlledVocabulary" : [・・・ 統制語彙 ・・・] ],
"itemTypes" : [
{
"identifier" : "/items/jsonschema/20",
"name" : "Harvesting_DDI",
"path" : "$.item_1588260046718[*].subitem_1591178807921"
},
{
"identifier" : "/items/jsonschema/12",
"name" : "Multiple",
"path" : "$.item_1636460428217[*].subitem_1522657697257",
"condition" : [
{
"conditionPath" : "$.item_1636460428217[*].subitem_1522657647525",
"conditionValue" : "Other"
}
]
}
]
}
・・・その他の統制語彙項目・・・
]
}
```

#### 画面表示時・設定時のエラー

画面表示時や設定ファイルのアップロード時には、以下のエラーが発生する可能性があります。
エラーメッセージとその原因を以下の表に示します。

| No. | エラーコード | 英語 | 日本語 | 原因 |
|----:|-------------|------|--------|------|
| 1 | ERR_WAV-001 | Validation feature is disabled, so validation settings are unavailable. | ヴァリデーション機能が無効なため、ヴァリデーション設定を利用できません。 | コンフィグ値「WEKO_ADMIN_VALIDATION_ENABLE」が未定義、または False の場合 |
| 2 | ERR_WAV-002 | The file Location for validation setting has not been configured. | ヴァリデーション設定のファイル保存先が設定されていません。 | コンフィグ値「WEKO_ADMIN_VALIDATION_STORAGE_LOCATION」が定義されていない場合 |
| 3 | ERR_WAV-003 | Location '{location_name}' was not found. | ロケーション「{location_name}」が登録されていません。 | 指定された Location が存在しない場合 |
| 4 | ERR_WAV-004 | IO error occurred. | 入出力エラーが発生しました。 | ファイルの書き込みに失敗した場合 |
| 5 | ERR_WAV-005 | The JSON encoding is incorrect. Expected UTF-8 without BOM. | JSON ファイルのエンコードが BOM なし UTF-8 ではありません。 | BOM 付き UTF-8、または UTF-8 以外のエンコードで保存されている場合 |
| 6 | ERR_WAV-006 | The JSON format is incorrect. | JSON ファイルの形式に不正があります。 | JSON 構文が不正な場合 |
| 7 | ERR_WAV-007 | The JSON format is incorrect. Required field version is missing or empty. | JSON の構造に不備があります。version が未定義、または空です。 | version が定義されていない場合 |
| 8 | ERR_WAV-008 | The JSON structure is invalid. validationTargets is not defined as an array. | JSON の構造に不備があります。validationTargets が配列として定義されていません。 | validationTargets が配列でない場合 |
| 9 | ERR_WAV-009 | The JSON structure is invalid. {targetName} isActive is not defined as a boolean. | JSON の構造に不備があります。{targetName} の isActive がブール値として定義されていません。 | isActive が未定義、または boolean 以外の場合 |
| 10 | ERR_WAV-010 | The JSON structure is invalid. {targetName} is not defined in validationTargets. | JSON の構造に不備があります。validationTargets に {targetName} が定義されていません。 | OAI-PMH または ResouceSync が定義されていない場合 |
| 11 | ERR_WAV-011 | Validation feature is disabled, so validation reports are unavailable. | ヴァリデーション機能が無効なため、ヴァリデーションレポートを利用できません。 | コンフィグ値「WEKO_ADMIN_VALIDATION_ENABLE」が未定義、または False の場合 |


#### ヴァリデーション結果のレポートを取得する

ヴァリデーションレポート画面では、ヴァリデーション結果をレポートとしてダウンロードできます。
不要となったレポートは削除することが可能です。

![ヴァリデーションレポート画面](media/media/image_validation_3.png)

| 項目 | 項目説明 |
|---|---|
| 対象日付 | ヴァリデーションレポートの対象日付です。レポートは日付単位で生成されます。 |
| 不一致件数 | 対象日付に実施されたヴァリデーションにおいて、不一致が検出された件数です。 |
| ダウンロードボタン | ヴァリデーションレポートをダウンロードするボタンです。 |
| 削除ボタン | ヴァリデーションレポートを削除するボタンです。削除後は一覧から表示されなくなります。 |

---

#### ヴァリデーション結果のレポート内容を確認する

レポートに記載される各項目の内容を以下に示します。

![実行レポート](media/media/image_validation_4.png)

実際のレポートは、以下のような JSON 形式で出力されます。

```json
{
"targetDate": "2025-10-17",
"notMatchCount": 27,
"notMatchs": [
{
"version": "0.0.1_sample",
"validationTarget": "OAI-PMH",
"detectionTime": "2025-10-17T12:07:33",
"itemId": "HarvestingDDI_item1.json",
"handling": "Dry-run",
"controlledItem": "Topic",
"incorrectWord": "テスト変換項目(Topic)"
}
・・・その他の不一致項目・・・
]
}
```


## インデックスツリー管理

この章では、インデックスツリーを管理する方法について説明します。
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
149 changes: 149 additions & 0 deletions docs/manuals_en/ADMIN/admin_manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ The format conventions used in this document are as follows:

[3.4 Import items 67](#import-items)

[3.5 Configure Validation ](#configure-validation)

[4. ‏Index Tree 88](#index-tree)

[4.1 ‏Manage the index tree 89](#manage-the-index-tree)
Expand Down Expand Up @@ -8387,6 +8389,153 @@ You cannot modify the resource type (dc:type) when updating. If you modify one,

‏- Upgrade: Register duplicates (\* The rationale behind this is that, based on the filename alone, it is impossible to determine whether the two files are the same or different files with the same name).

## Configure Validation

This section explains how to configure the validation feature that is executed during item registration.

---

#### Eligible Users

To use this feature, all of the following conditions must be met:

- You must have administrator privileges
- The configuration value **`WEKO_ADMIN_VALIDATION_ENABLE`** must be set to `True`
- A Location name must be defined in the configuration value **`WEKO_ADMIN_VALIDATION_STORAGE_LOCATION`**
- The Location specified in the configuration must be registered in WEKO’s file management system

---

#### Validation Overview

During item registration, the system verifies whether the item metadata contains values that do not conform to the defined controlled vocabularies, and outputs the results as a report.
Currently, this validation feature is applied only to items registered via harvesting mechanisms (OAI-PMH and ResouceSync).
The metadata fields subject to validation and the content of the controlled vocabularies are defined using a JSON-format configuration file.

---

#### Configuration Procedure

Register the configuration file from the validation settings screen shown below.

![Validation Settings Screen](media/media/image_validation_1.png)

| Function | Description |
|---|---|
| Upload Button | A button to upload the configuration file. When the button is clicked, the OS-standard file selection dialog is displayed, and the selected file is registered.<br>If a configuration file is already registered, uploading a new file is treated as an update: the existing file is deleted and replaced with the newly uploaded file. Since version management is not supported, previously registered files cannot be retrieved after an update. |
| Download Button | A button to download the registered configuration file. This button is disabled if no configuration file is registered. |
| Delete Button | A button to delete the registered configuration file. This button is disabled if no configuration file is registered. |
| Version Information | Displays the version information described in the registered controlled vocabulary JSON file. This information is not displayed if no configuration file is registered. |
| OAI-PMH Status | Displays “Active” if validation for OAI-PMH is enabled in the controlled vocabulary JSON file, or “Inactive” if it is disabled. This status is not displayed if no configuration file is registered. |
| ResouceSync Status | Displays “Active” if validation for ResouceSync is enabled in the controlled vocabulary JSON file, or “Inactive” if it is disabled. This status is not displayed if no configuration file is registered. |

---

The items defined in the configuration file are shown below.

![Controlled Vocabulary Configuration JSON File](media/media/image_validation_2.png)

An example of the actual configuration file is shown below.

```json
{
"version": "0.0.1_sample",
"validationTargets": [
{ "targetName": "OAI-PMH", "isActive": true },
{ "targetName": "ResouceSync", "isActive": true }
],
"controlledItems": [
{
"vocabularyName": "Data Type",
"controlledVocabulary": [ ... controlled vocabulary ... ],
"itemTypes": [
{
"identifier": "/items/jsonschema/20",
"name": "Harvesting_DDI",
"path": "$.item_1588260046718[*].subitem_1591178807921"
},
{
"identifier": "/items/jsonschema/12",
"name": "Multiple",
"path": "$.item_1636460428217[*].subitem_1522657697257",
"condition": [
{
"conditionPath": "$.item_1636460428217[*].subitem_1522657647525",
"conditionValue": "Other"
}
]
}
]
}
... other controlled vocabulary items ...
]
}
```

#### Errors During Screen Display and Configuration

Errors may occur when displaying the screen or uploading a configuration file.
The possible error messages and their causes are listed in the table below.

| No. | Error Code | English Message | Japanese Message | Cause |
|---:|------------|-----------------|------------------|-------|
| 1 | ERR_WAV-001 | Validation feature is disabled, so validation settings are unavailable. | ヴァリデーション機能が無効なため、ヴァリデーション設定を利用できません。 | The configuration value `WEKO_ADMIN_VALIDATION_ENABLE` is undefined or set to False. |
| 2 | ERR_WAV-002 | The file Location for validation setting has not been configured. | ヴァリデーション設定のファイル保存先が設定されていません。 | The configuration value `WEKO_ADMIN_VALIDATION_STORAGE_LOCATION` is not defined. |
| 3 | ERR_WAV-003 | Location `{location_name}` was not found. | ロケーション「{location_name}」が登録されていません。 | The specified Location does not exist. |
| 4 | ERR_WAV-004 | IO error occurred. | 入出力エラーが発生しました。 | Failed to write the file. |
| 5 | ERR_WAV-005 | The JSON encoding is incorrect. Expected UTF-8 without BOM. | JSON ファイルのエンコードが BOM なし UTF-8 ではありません。 | The uploaded JSON file is not encoded in UTF-8 without BOM. |
| 6 | ERR_WAV-006 | The JSON format is incorrect. | JSON ファイルの形式に不正があります。 | The uploaded JSON file has invalid JSON syntax. |
| 7 | ERR_WAV-007 | The JSON format is incorrect. Required field `version` is missing or empty. | JSON の構造に不備があります。version が未定義、または空です。 | The `version` field is missing or empty. |
| 8 | ERR_WAV-008 | The JSON structure is invalid. `validationTargets` is not defined as an array. | JSON の構造に不備があります。validationTargets が配列として定義されていません。 | `validationTargets` is not defined as an array. |
| 9 | ERR_WAV-009 | The JSON structure is invalid. `{targetName}` `isActive` is not defined as a boolean. | JSON の構造に不備があります。{targetName} の isActive がブール値として定義されていません。 | `isActive` is missing or not defined as a boolean. |
| 10 | ERR_WAV-010 | The JSON structure is invalid. `{targetName}` is not defined in `validationTargets`. | JSON の構造に不備があります。validationTargets に {targetName} が定義されていません。 | `validationTargets` does not include OAI-PMH or ResouceSync. |
| 11 | ERR_WAV-011 | Validation feature is disabled, so validation reports are unavailable. | ヴァリデーション機能が無効なため、ヴァリデーションレポートを利用できません。 | The configuration value `WEKO_ADMIN_VALIDATION_ENABLE` is undefined or set to False. |

---

#### Retrieve Validation Result Reports

On the validation report screen, validation results can be downloaded as reports.
Reports that are no longer needed can be deleted.

![Validation Report Screen](media/media/image_validation_3.png)

| Item | Description |
|---|---|
| Target Date | The target date of the validation report. Reports are generated on a per-date basis. |
| Mismatch Count | The number of mismatches detected in the validation performed on the target date. |
| Download Button | A button to download the validation report. |
| Delete Button | A button to delete the validation report. Deleted reports will no longer be displayed in the list. |

---

#### Review the Contents of a Validation Result Report

The items included in the report are described below.

![Execution Report](media/media/image_validation_4.png)

An actual report is output in the following JSON format.

```json
{
"targetDate": "2025-10-17",
"notMatchCount": 27,
"notMatchs": [
{
"version": "0.0.1_sample",
"validationTarget": "OAI-PMH",
"detectionTime": "2025-10-17T12:07:33",
"itemId": "HarvestingDDI_item1.json",
"handling": "Dry-run",
"controlledItem": "Topic",
"incorrectWord": "テスト変換項目(Topic)"
}
... other mismatch items ...
]
}
```

# ‏Index Tree

This chapter provides information on how to manage the index tree.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/spec/base/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
* [ADMIN-2-3: 一括エクスポート 110](./admin/ADMIN_2_3.md)
* [ADMIN-2-4: インポート 113](./admin/ADMIN_2_4.md)
* [ADMIN-2-5: RO-Crateインポート](./admin/ADMIN_2_5.md)
* [ADMIN-2-6: ヴァリデーション設定](./admin/ADMIN_2_6.md)
* [ADMIN-2-7: ヴァリデーションレポート](./admin/ADMIN_2_7.md)
### インデックスツリー管理 155
* [ADMIN-3-1: ツリー編集 155](./admin/ADMIN_3_1.md)
* [ADMIN-3-2: 雑誌情報 162](./admin/ADMIN_3_2.md)
Expand Down
Loading