ラベルの概要
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ラベルは、ユーザーが Google ドライブ内のファイルを整理、検索してポリシーを適用するうえで役立つように定義するメタデータです。Drive API を使用すると、デベロッパーはファイルとフォルダにラベルを適用したり、ラベルのフィールド値を設定したり、ファイルでラベルとフィールド値を読み取ったり、カスタム ラベル分類で定義されたメタデータ用語を使用してファイルを検索したりできます。
ドライブラベルは、ファイルとフォルダにメタデータを添付することでビジネス プロセスをサポートできます。ラベルの一般的な使用例は次のとおりです。
情報ガバナンス戦略に沿ってコンテンツを分類する - デリケートなコンテンツや特別な扱いを必要とするデータを識別するためのラベルを作成します。たとえば、「機密性」という名前のラベル(オプション値が色分けされたラベル)を作成し、値として「極秘」、「機密」、「公開」を設定できます。
ドライブのアイテムにポリシーを適用する - ラベルを作成して、ドライブのコンテンツをライフサイクル全体にわたって管理し、組織の記録保持の慣行を遵守できるようにします。たとえば、ユーザーが「機密性」ラベルが「極秘」に設定されているファイルをダウンロードできないようにするデータ損失防止(DLP)ポリシーを管理するためにラベルを使用します。
ファイルの管理と検索 - ラベルを作成して、組織内のユーザーがラベルとそのフィールドに基づいてアイテムを検索できるようにすることで、会社のコンテンツの検索可能性を高めます。たとえば、「署名状況」ラベルセットを「署名待ち」に適用して、特定の日付までに署名が必要なすべての契約書に適用します。これにより、ユーザーが「署名待ち」を検索したときに、ドライブの検索でこれらの契約書が返されるようになります。
ドライブのラベルで使用される一般的な用語を以下に示します。
- ラベル
ドライブ ファイルに配置された構造化メタデータ。ドライブ ユーザーは、ファイルにラベルを割り当てて、ラベルのフィールド値を設定できます。ラベルは次の要素で構成されます。
- ラベル名
- ラベルのリソース名。ラベル ID は、ラベル名の一部です。リクエストに応じて、名前は
labels/{id}
または labels/{id}@{revisionId}
の形式になります。詳細については、下記のラベルのリビジョンをご覧ください。 - ラベル ID
- ラベルのグローバルに一意の識別子。ID はラベル名の一部ですが、名前とは異なり、リビジョン間で一貫しています。
- フィールド
ラベルの個々の型付き設定可能なコンポーネント。ラベルには、関連付けられたフィールドが 0 個以上含まれることがあります。Google ドライブ ラベル API でフィールドが ListOptions
で構成されている場合、選択フィールドとユーザー フィールドには複数の値を設定できます。
- フィールド タイプ
- フィールドに関連付けられた値のデータ型。整数、dateString、テキスト、ユーザー、選択として構成できます。選択したタイプは、ドライブ アイテムに適用可能な有効な値と、使用可能な検索クエリ オプションの両方に影響します。
- ラベルの分類
ユーザーがドライブ ファイルに適用できる、構成済みのラベル フィールド。Drive Labels API を介して読み取りと書き込みが可能です。ラベル スキーマとも呼ばれます。
- ラベルの改訂
ラベルのインスタンス。ラベルが作成、更新、公開、非推奨になるたびに、ラベル リビジョンが増加します。
- 下書きのリビジョン
- ラベルの現在のドラフト インスタンスのリビジョン番号。ラベルを複数回更新できます。更新するたびに下書きリビジョン番号が増加しますが、公開済みリビジョンには影響しません。下書きラベルを使用すると、ラベルの更新を公開前にテストできます。
- 公開済みのリビジョン
- ラベルの公開バージョンのリビジョン番号。公開されたラベルは、ユーザーが利用できるラベルのインスタンスです。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-04 UTC。
[null,null,["最終更新日 2025-08-04 UTC。"],[],[],null,["# Labels overview\n\n*Labels* are metadata that you define to help users organize, find, and apply\npolicy to files in Google Drive. The Drive API allows developers to\napply labels to files and folders, set label field values, read labels and field\nvalues on files, and search for files using metadata terms defined by the custom\nlabel taxonomy.\n\nDrive labels can support business processes by attaching metadata\nto files and folders. Common uses for labels are:\n\n- **Classify content to follow an information governance strategy**---Create a\n label to identify sensitive content or data that requires special handling.\n For example, you might create a badged label (a label with color-coded\n option values) titled \"Sensitivity\" with the values of \"Top Secret,\"\n \"Confidential,\" and \"Public.\"\n\n- **Apply policy to items in Drive**---Create labels to manage\n Drive content throughout its lifecycle and ensure it adheres\n to your organization's record keeping practices. For example, use labels to\n manage a data loss policy (DLP) whereby users can't download files with a\n \"Sensitivity\" label set to \"Top Secret\".\n\n- **Curate and find files**---Create labels to increase searchability of your\n company's content by letting people in your organization find items based on\n labels and their fields. For example, apply a \"Signature Status\" label set\n to \"Awaiting Signature\" to all contracts awaiting signature by a specific\n date. Drive search can then return these contracts when\n someone searches \"awaiting signature\".\n\nBelow is a list of common terms used by Drive labels:\n\n*Label*\n\n: Structured metadata placed on a Drive file.\n Drive users can assign labels and set label field values\n for files. Labels are composed of:\n\n *Label name*\n : The resource name of the label. The *label ID* is part of the\n Label name. Depending on the request, the name is in the form of either:\n `labels/{id}` or `labels/{id}@{revisionId}`. For more information, see\n [Label revision](#revision) below.\n\n *Label ID*\n : A globally unique identifier for the label. The ID is part of the\n label name, but unlike the name, it's consistent between revisions.\n\n*Field*\n\n: An individual typed, settable component of a label. A label can have zero or\n more fields associated with it. Selection and user fields can be set with\n multiple values if the field is configured with\n [`ListOptions`](/workspace/drive/labels/reference/rest/v2/labels#listoptions) in the\n [Google Drive Labels API](/workspace/drive/labels/guides/overview).\n\n *Field type*\n : The data type of the value associated with the *field*. Configurable as\n integer, dateString, text, user, or selection. The type chosen impacts\n both the valid values applicable to Drive items and the\n search query options available.\n\n*Label taxonomy*\n\n: The configured label fields available to users for application to\n Drive files. Readable and writable through the\n Drive Labels API. Also known as the label schema.\n\n*Label revision*\n\n: An instance of the label. Anytime a label is created, updated, published, or\n deprecated, the label revision increments.\n\n *Draft revision*\n : The revision number of the current draft instance of the label. You can\n make several updates to a label, each incrementing its draft revision\n number, without affecting the published revision. The ability to have\n draft labels lets you test label updates before publishing.\n\n *Published revision*\n : The revision number of the published version of a label. The published\n label is the instance of the label available to users.\n\nRelated topics\n--------------\n\n- To learn about using labels in Drive, see [Set a label field\n on a file](/workspace/drive/api/guides/set-label).\n- Learn more about the [Drive Labels API](/workspace/drive/labels/guides/overview)."]]