> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/roboflow/roboflow-jp/deploy/vision-events/use-cases.md).

# ユースケース

## Use Cases

Use Case は、共通の目的とカスタムメタデータ構造を共有する Vision Events をグループ化したものです。すべてのイベントは必ず 1 つの Use Case に属します。同じ Use Case 内のイベントは通常同じメタデータフィールドを共有するため、異なるソース間でのデータのフィルタリングや比較が簡単になります。

### 1つの Use Case と複数の Use Cases の使い分け

**イベントを同じ Use Case に入れる** 異なる場所、カメラ、またはデバイスから来ていても、類似したカスタムメタデータフィールドを共有している場合です。たとえば、「Defect Detection」Use Case は複数の工場からイベントを受け取ることがありますが、すべてのイベントには `line_id`, `shift`、および `part_number`.

**別々の Use Cases を作成する** メタデータ構造が根本的に異なる場合です。例:

* **Assembly Line QA** — を追跡 `line_id`, `shift`, `part_number`
* **Warehouse Inventory** — を追跡 `aisle`, `shelf`, `item_type`
* **Construction Site Safety** — を追跡 `zone`, `alert_type`, `contractor`

### Use Case を作成する

#### Agent 経由

この [Roboflow Agent](broken://pages/c7f6dab8e6240bed4cbccd5a692b84ed25e256eb) は、Vision Events を含む Workflow を構築する際に Use Cases を自動的に作成します。適したものがあれば既存の Use Case を選択し、なければ説明されたユースケースに基づいて新しい Use Case を作成します。新しい Use Case の設定を Agent に直接依頼することもできます。

#### Dashboard で

1. 次に移動します **Vision Events** workspace の左サイドバーにある
2. クリックします **+ Create Use Case**
3. Use Case の名前を入力します

<figure><img src="/files/b551e6b45d8edf8aca1759dfee3b53edef7d1c42" alt="" width="375"><figcaption></figcaption></figure>

REST API 経由で Use Cases を作成することもできます。詳しくは [Manage Use Cases Programmatically](#manage-use-cases-programmatically).

### Use Cases を表示する

#### Dashboard で

Vision Events ページには、すべての Use Cases を一覧表示するテーブルがあり、以下が表示されます:

* Use Case 名
* イベント総数
* 最後のイベントのタイムスタンプ
* 使用中のイベントタイプ

#### API 経由

workspace 内のすべての Use Cases を取得します:

```bash
curl -X GET "https://api.roboflow.com/vision-events/use-cases" \\
  -H "Authorization: Bearer YOUR_API_KEY"
```

詳しくは [Vision Events API Reference](https://docs.roboflow.com/developer/rest-api/vision-events) 完全なレスポンス形式についてはそちらを参照してください。

### Manage Use Cases Programmatically

dashboard に加えて、REST API 経由で Use Cases の作成、名前変更、archive、unarchive を行うこともできます。これらのエンドポイントには、次の `vision-events:manage` スコープが必要です（制限のない workspace API keys はデフォルトでアクセスできます）。

**Use Case を作成する**

```bash
curl -X POST "https://api.roboflow.com/vision-events/use-cases" \\
  -H "Content-Type: application/json" \\
  -H "Authorization: Bearer YOUR_API_KEY" \\
  -d '{ "name": "assembly-line-qa" }'
```

**Use Case の名前を変更する**

```bash
curl -X PUT "https://api.roboflow.com/vision-events/use-cases/USE_CASE_ID" \\
  -H "Content-Type: application/json" \\
  -H "Authorization: Bearer YOUR_API_KEY" \\
  -d '{ "name": "assembly-line-qa-v2" }'
```

**Use Case をアーカイブまたはアーカイブ解除する**

```bash
curl -X POST "https://api.roboflow.com/vision-events/use-cases/USE_CASE_ID/archive" \\
  -H "Authorization: Bearer YOUR_API_KEY"

curl -X POST "https://api.roboflow.com/vision-events/use-cases/USE_CASE_ID/unarchive" \\
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Use Case をアーカイブする

Use Cases は不要になったら dashboard からアーカイブできます。アーカイブされた Use Cases とそのイベントには引き続きアクセスできますが、デフォルト表示では非表示になります。クリックして **View archived use cases** Use Cases テーブルの下部にあるそれをクリックすると表示できます。\ <br>

<figure><img src="/files/c5d7988abd1d7c71443ac02f1ecf91d7ba5a8877" alt=""><figcaption></figcaption></figure>

### Custom Metadata Schema

イベントが Use Case に送信されると、システムは観測されたフィールドと値の型に基づいてメタデータスキーマを推論します。Use Case の推論済みスキーマを取得して、どのキーと値の型が使用されているかを把握できます:

```bash
curl -X GET "https://api.roboflow.com/vision-events/custom-metadata-schema/assembly-line-qa" \\
  -H "Authorization: Bearer YOUR_API_KEY"
```

**レスポンス例:**

```json
{
  "useCaseId": "assembly-line-qa",
  "fields": {
    "line_id": { "types": ["string"] },
    "shift": { "types": ["string"] },
    "temperature": { "types": ["number"] },
    "is_priority": { "types": ["boolean"] }
  }
}
```

詳しくは [Vision Events API Reference](https://docs.roboflow.com/developer/rest-api/vision-events) 完全な詳細についてはそちらを参照してください。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.roboflow.com/roboflow/roboflow-jp/deploy/vision-events/use-cases.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
