Extension:External Data

From mediawiki.org
This page is a translated version of the page Extension:External Data and the translation is 30% complete.
Outdated translations are marked like this.
MediaWiki 拡張機能マニュアル
External Data
リリースの状態: 安定
実装 パーサー関数 , 特別ページ
説明 外部URLやSOAPサービス、ローカルのWikiページやローカルファイル(CSV、JSON、XMLなどの形式)、データベーステーブル、LDAPサーバー、ローカルプログラムの出力など、さまざまなソースから取得した値を使用・表示できるようにするものです。
作者 Yaron Koren, Alexander Mashin and others
最新バージョン 3.3 (2023年11月)
互換性の方針 master は後方互換性を維持しています。
MediaWiki 1.37+
データベースの変更 はい
Composer mediawiki/external-data
テーブル ed_url_cache
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード See Download and installation
A page containing information retrieved from an external CSV file
  • $wgSources
  • $wgConnectors
  • $wgAllowGetters
  • $wgIntegratedConnectors
  • $wgVerbose
  • $wgParsers
問題点 未解決のタスク · バグを報告

External Data拡張機能により、MediaWikiページが1つ以上のソースから構造化データを取得し、フィルタリングし、フォーマットすることができます。 これらのソースには、外部URLやSOAPサービス、通常のWikiページ、アップロードされたファイル、ローカルサーバー上のファイル、データベース、LDAPディレクトリ、ローカルプログラムの出力などが含まれることがあります。

拡張機能は、次のパーサー関数 を定義します。

  • Data retrieval and handling functions, which set local variables and then display or store them:
    • #external_value - displays the value of any such variable.
    • #for_external_table - 変数のセットに対して取得したすべての値を循環させ、それぞれ変数に対して同じ「コンテナ」テキストを表示します。
    • #display_external_table - 変数のセットから取得したすべての値を循環させ、テンプレートを使用して各「行」を表示します。
    • #format_external_table - available only if Cargo is installed. Formats the retrieved external data the same way as #cargo_query.
    • #store_external_table - cycles through a table of values, storing them as semantic data via the Semantic MediaWiki extension, by mimicking a call to SMW's #subobject function for each row.
  • In the Legacy mode the extension also defines data retrieval functions, which set local variables available with wikipage scope that can later be displayed using the above functions:
    • #get_external_data - retrieves data from various sources, thus replacing any of the below parser functions, and assigns it to variables that can be accessed on the page.
    • #get_web_data - URLからCSV、GFF、JSON、XML、HTML、または自由形式のデータを取得し、ページでアクセスできる変数に割り当てます。
    • #get_soap_data - SOAPプロトコルを介してURLからデータを取得します。
    • #get_file_data - retrieves data from a file on the local server, in the same formats as #get_web_data.
    • #get_db_data - データベースからデータを取得します。
    • #get_ldap_data - retrieves data from an LDAP server.
    • #get_program_data - retrieves data returned by a program run server-side.
    • #get_inline_data - parses data passed to it, in the same formats as #get_web_data.
    • and also #clear_external_data 取得したデータの現在のセットを消去します。

It also defines a Lua function mw.ext.externalData.getExternalData that retrieves data and returns it as Lua table.

In the Legacy mode, the following additional Lua functions are also defined (there is one-to-one correspondence between parser functions retrieving data and Lua functions evident from their names):

  • mw.ext.externalData.getWebData
  • mw.ext.externalData.getFileData
  • mw.ext.externalData.getDbData
  • mw.ext.externalData.getSoapData
  • mw.ext.externalData.getLdapData
  • mw.ext.externalData.getProgramData
  • mw.ext.externalData.getInlineData

In tag emulation mode, the wiki site administrator can define additional parser tags.

This version of the External Data extension requires MediaWiki 1.37+.

Click through the pages in the navigation bar above to learn more about External Data, how it works, how to use it, and how to install it.