Commons:機械判読が可能なデータ

This page is a translated version of a page Commons:Machine-readable data and the translation is 92% complete. Changes to the translation template, respectively the source language can be submitted through Commons:Machine-readable data and have to be approved by a translation administrator.

Shortcut: COM:MRD

ウィキメディア・コモンズでは、多くのメタデータ(ライセンス情報や著作者など)は機械で読むことができません。値を取得するために使用できるAPIモジュール、iiprop=extmetadataがありますが()、情報がファイルページ自体にフリーテキストとして入力されているので、これは完全ではありません。現在進行中のコモンズの構造化データプロジェクトは、メタデータを完全に構造化されたデータに移行することを目的としており、最終的には、このページに示されている機械判読が可能なデータに取って代わることになります。

それまでの間、将来のより構造化されたデータへの移行を円滑にするために、コモンズではHTML要素を利用した機械可読なテンプレートを組み合わせて利用します。スクリプトの中にはすでにこの方式で作成されているものもあります。これらのデータは、コモンズを使用しているどのウィキでも利用可能であり、ローカルデータ同様にファイルページのHTMLから読み取ることができます。

機械的に読み取れるデータ

基礎情報ボックステンプレートが設定する機械可読データ

情報の構文解析を実行するため、テンプレートの要素ごとに個別のタグにタグ付けする標準基本情報ボックスのテンプレートinfobox templatesが複数あります。使用するタグは複数です。

  • マイクロフォーマットタグは工業規格に準拠し、規定のツールで解析できます。
  • <td> id属性(識別子)によりカスタムなマーキングをすると、より完全で読み取りにカスタムツールが必要なタグの使用が可能です。最も普遍的な基本情報ボックスの多くは2列構造で、1列目にフィールド名を、2列目に値が入ります。
    • <td> id属性はこれまで、特定の行の1列目の名前コールにタグ付けするために使われてきました。データ取得には2列目の<td>セルの内容が必要です。
    • {{Creator}}(作者)ならびに{{Institution}}(機関・施設)のテンプレートは構造がさらに複雑で、実際にデータが入ったセルにはマゼンタ(赤紫色)の背景に属性のタグを付けます。
テンプレート テンプレートのパラメーター名 説明 <td> の id 属性 マイクロフォーマット コメント
{{Information}} description ファイルの解説 fileinfotpl_desc hProduct.description. Often contains multiple languages annotated with {{Lang}}.
{{Information}} date 原作品の制作日 fileinfotpl_date hCalendar vevent.dtstart ときには追加で、あるいは唯一、公表日を含む。これら2つの日付は著作権に対して異なる意味を持つ。使うとき、 {{Date context}}で違いを示すことができる。{{Date}}テンプレートを使って追加したマイクロフォーマット
{{Information}} source ファイルの情報源 fileinfotpl_src Often contains entire tables. We have no good way to deal with this source templates yet. Source templates often have references to catalogue IDs, but these are also not machine readable.
{{Information}} author ファイルの作者 fileinfotpl_aut This can be author, creator and/or copyright holder and is used mixed. Often contains the {{Creator}} template which is described below.
{{Information}} permission ファイルの使用許可やライセンス fileinfotpl_perm
{{Information}} other versions ファイルの他のバージョン fileinfotpl_ver
{{Artwork}} description アートワークの説明 fileinfotpl_desc hProduct.description
{{Artwork}} date アートワークの原作品の制作日 fileinfotpl_date hCalendar vevent.dtstart microformat added by {{Date}} template
{{Artwork}} source ファイルの情報源 fileinfotpl_src
{{Artwork}} artist アートワークの制作者 fileinfotpl_aut "hProduct.fn value"
{{Artwork}} author アートワークの作者 fileinfotpl_aut "hProduct.fn value"
{{Artwork}} permission アートワークの使用許可やライセンス fileinfotpl_perm
{{Artwork}} other versions ファイルの他のバージョン fileinfotpl_ver
{{Artwork}} title アートワークのタイトル fileinfotpl_art_title hProduct.fn
{{Artwork}} object type アートワークの形態の種別 fileinfotpl_art_object_type
{{Artwork}} medium アートワークの素材や制作技術 fileinfotpl_art_medium
{{Artwork}} dimensions アートワークの寸法 fileinfotpl_art_dimensions
{{Artwork}} gallery アートワークを収蔵する施設 fileinfotpl_art_gallery
{{Artwork}} location 機関・施設内のアートワークの位置 fileinfotpl_art_location hProduct.locality
{{Artwork}} accession number アートワークの受入番号 fileinfotpl_art_id hProduct.identifier
{{Artwork}} object history アートワークの来歴 fileinfotpl_art_object_history
{{Artwork}} exhibition history アートワークの展示歴 fileinfotpl_art_exhibition_history
{{Artwork}} credit line アートワークのクレジット表記 fileinfotpl_art_credit_line
{{Artwork}} inscriptions アートワークに施された記名 fileinfotpl_art_inscriptions
{{Artwork}} notes アートワークについての註釈 fileinfotpl_art_notes
{{Artwork}} references アートワークに関連する参考文献 fileinfotpl_art_references
{{Book}} Author 本の著者 fileinfotpl_author
{{Book}} Editor 本の編者 fileinfotpl_book_editor
{{Book}} Translator 本の訳者 fileinfotpl_book_translator
{{Book}} Illustrator 本のイラストレータ fileinfotpl_book_illustrator
{{Book}} Title 本のタイトル fileinfotpl_book_title
{{Book}} Subtitle 本のサブタイトル fileinfotpl_book_subtitle
{{Book}} Series title 本のシリーズ名 fileinfotpl_book_series-title
{{Book}} Authority file 典拠管理データ fileinfotpl_book_authority
{{Book}} Publisher 本の出版者 fileinfotpl_book_publisher
{{Book}} Printer 本の印刷者 fileinfotpl_book_printer
{{Book}} Year of publication 本の発行年、または発行日 fileinfotpl_date
{{Book}} Place of publication 本の出版地 fileinfotpl_book_place-of-publication
{{Book}} Language 本の言語 fileinfotpl_book_language
{{Book}} Description 本の説明 fileinfotpl_desc
{{Creator}} Name 制作者名 creator vCard.fn
{{Creator}} Alternative names 制作者の別名 fileinfotpl_creator_alt-name_value vCard.nickname
{{Creator}} Description 制作者の国籍、職業(複数可) fileinfotpl_creator_desc_value vCard.note
{{Creator}} Date of death 制作者の死亡日 fileinfotpl_creator_deathdate_value
{{Creator}} Date of birth 制作者の誕生日 fileinfotpl_creator_birthdate_value vCard.bday
{{Creator}} Location of birth/death 制作者の死没地 fileinfotpl_creator_deathloc_value
{{Creator}} Location of birth 制作者の生誕地 fileinfotpl_creator_birthloc_value
{{Creator}} Work period 制作者の活動期間 fileinfotpl_creator_work-period_value
{{Creator}} Work location 制作者の活動地 fileinfotpl_creator_work-location_valuev
{{Creator}} Image 制作者を写した肖像画もしくは写真 fileinfotpl_creator_image
{{Creator}} Authority file 制作者に関する典拠 fileinfotpl_creator_authority_value


{{FileContentsByBot}} (各種) 必要に応じて{{FileContentsByBot}}を要参照 (various) hproduct-by-bot データセットは大きく拡張中で、{{FileContentsByBot}}を要参照
{{Photograph}} title 写真のタイトル fileinfotpl_art_title hProduct.fn
{{Photograph}} description 写真の説明 fileinfotpl_desc hProduct.description
{{Photograph}} original description 写真に関するアーカイブの元の説明 fileinfotpl_desc hProduct.description
{{Photograph}} date アートワークの原作品の制作日 fileinfotpl_date hCalendar vevent.dtstart microformat added by {{Date}} template
{{Photograph}} medium 写真の素材や制作技術 fileinfotpl_art_medium
{{Photograph}} dimensions 写真の寸法 fileinfotpl_art_dimensions
{{Photograph}} artist 写真の制作者 fileinfotpl_aut "hProduct.fn value"
{{Photograph}} institution アートワークを収蔵する施設 fileinfotpl_art_gallery
{{Photograph}} location 機関・施設内の写真の位置 fileinfotpl_art_location hProduct.locality
{{Photograph}} source ファイルの情報源 fileinfotpl_src
{{Photograph}} permission ファイルとアートワーウの使用許可やライセンス fileinfotpl_perm
{{Photograph}} other versions ファイルの他のバージョン fileinfotpl_ver
{{Photograph}} accession number 写真の受入番号 hProduct.identifier

CommonsMetadataの代替形式

定義した表 + idに基づく形式は、コモンズの情報テンプレートと同様のフォーマットではない場合、テンプレートへの付加が困難なため、CommonsMetadataはライセンステンプレートに似た代替の形式を受け入れます。情報テンプレート全体をfileinfotplクラスに内包し、特定の情報を含むタグにはfileinfotpl_*クラスを付与します(名称は上記と同じで、idではなくクラス)。

ライセンステンプレートが設定する機械的に読み取れるデータ

<span class="licensetpl_XXX">の使用が2010年10月に導入されました。

licensetpl
ライセンスを同定する要素です。完全なライセンスコードを内包してください。この要素は複数ライセンスタグには使用せず、単独のライセンスタグに対して使用してください。
licensetpl_short
“Public domain”、“CC BY-SA 3.0”, “CC by 2.0 fr”など、ライセンスの短い名前を指定します。
licensetpl_long
“Public domain”、“Creative Commons Attribution-Share Alike 3.0”など、ライセンスの長い名前を指定します。
licensetpl_attr_req
帰属表示を要するかどうかを、“true”か“false”で指定します。
licensetpl_attr
要求されている帰属表示を指定します。
licensetpl_link_req
ライセンスへのリンクを要するかどうかを、“true”か“false”で指定します。
licensetpl_link
“www.creativecommons.org/licenses/by-sa/XXX/YYY”の形でライセンス証書へのリンクを指定します。
licensetpl_nonfree
自由な利用が認められていないライセンスである場合は“true”を指定します。この要素の使用はコモンズでは認められておらず、各ウィキの権利制限法理の適用方針 (EDP)でのみ使用します。

同一の制作物に対する複数のlicensetplブロックは、licensetpl_wrapperクラスを使用しブロックに内包することをお勧めします。

これらの情報を設定するテンプレート

  • Templates setting licensetpl include:

{{PD-Layout}}, {{Cc-by-sa-3.0-migrated}}, {{Cc-by-layout}}, {{Cc-by-sa-layout}}, {{Cc-zero}}, {{FAL}}, {{GFDL}}, {{GFDL-1.2}}, {{GPL}} および {{LGPL}}.

整形テンプレートが設定する機械的に読み取れるデータ

Style formatting templates(スタイル形式テンプレート)はライセンスのないテンプレートの異なるファミリーに統一したスタイルを付与する役目があり、それらのファミリーを識別する機械可読データを内包します。

テンプレート 目的 クラス名
{{Restriction-Layout}} 制限タグで使用 restrictiontemplate
{{FoP-Layout}} 風景の自由タグで使用 foptemplate
{{Partnership-Layout}} パートナーシップ・テンプレートで使用 partnershiptemplate
{{Source-Layout}} 一般的なソーステンプレートで使用 sourcetemplate
{{Created with}} Created with ... (…で作成)テンプレートで使用 createdwithtemplate

著作権無制限テンプレートが設定する機械可読データ

著作権以外の法的規制に関するテンプレートは、特定の種類の制限を識別するためにこれらのクラスを保持します。

テンプレート 目的 クラス名
{{Trademarked}} 商標登録済み画像 restriction-trademarked
{{Copydesign}} 意匠登録済み restriction-design
{{Communist symbol}} 共産主義のシンボル restriction-communist
{{Italy-MiBAC-disclaimer}} {{Soprintendenza}} イタリアの文化遺産 restriction-ita-mibac
{{Australian Commonwealth reserve}} オーストラリアの保護区 restriction-aus-reserve
{{Personality rights}} {{Romania personality rights}} 人格権 restriction-personality
{{2257}} 児童保護及び強制猥褻法に関する警告 (アメリカ) restriction-2257
{{Costume}} 衣装 restriction-costume
{{Fan art}} ファンアート(非公認の作品) restriction-fan-art
{{Currency}} 紙幣・硬貨 restriction-currency
{{IHL Symbol}} 国際人道法上、制限を受ける象徴 restriction-ihl
{{Nazi symbol}} ナチス他関連の連邦憲法裁判所が掲出を禁じた象徴 restriction-nazi
{{Insignia}} 公式の記章 restriction-insignia

特定のテンプレートが設定する機械可読データ

機械可読データはさらに設定されます。その一部をまとめました。

{{Personality rights}}
<span class="commons-template-name" style="display:none" id="commons-template-personality-rights">Personality rights</span>
{{Credit line}}
<td id="fileinfotpl_credit" class="fileinfo-paramfield fileinfotpl_credit" style=""></td>

位置テンプレートが設定する機械可読データ

{{Location}}および類似のテンプレートは、以下の形式で機械可読な座標を追加します<span class="geo">12.34;24.68</span> (緯度経度をセミコロンで区切った浮動小数点数)。座標はWGS84世界測地系を採用(GPSや大部分のオンライン地図と同じ)。詳細はCommons:Geocodingを参照してください。

使用法

MediaWiki API

MediaWiki APIは現在、限られた数のメタデータのみ扱います。以下のクエリを考えてみましょう:

(API Sandboxで開く) これはCredit、Author、LicenseUrlやCopyrightedなどいくつかの有用なパラメーターを返し、例えばMedia Viewerで利用されています。

機械的に読み取れるデータを使用するスクリプト

外部ツール

関連項目

機械可読データを新たに定義する

  • Do NOT use HTML id's, use classes. An ID can only be used once per page and most of these fields can occur multiple times per page. Consider for instance descriptions of derivative works, which can include information about the original and the derivative.
  • When possible, wrap the actual data, not some field header. This last method is historically used for all our Information templates, but much harder to support in the long run.
  • Wrap data, not the way the data is formatted.
  • Expect that formatting is lost when converting to data. Visual dress up is not part of the information.
  • Don't wrap multiple units of information inside one field. There is a difference between a publication date and a creation date. Both are dates, but both are different 'data fields'. Also CC BY-SA-4.0-3.0-2.5 is not a license name, those would be 3 licenses with the name CC BY-SA-##.
  • Make sure that the data value has one unit, or outputs one consistent unit.

問題点

現状では以下のものは、まったく認識されないもしくは間違って認識されます。

  • Derivative works
  • Works included in works. See also Category:FoP_templates
  • licenses derivates or works included in works are a mess.
  • Author vs. Copyright holder
  • usernames vs 'real names'
  • Catalogue IDs etc
  • VRTS permissions
  • Publication date vs creation date