接続の確立
コネクタ内で利用可能なオブジェクトは、"cdata.rest" モジュールからアクセスできます。モジュールのオブジェクトを直接使用するには:
- モジュールを以下のようにインポートします。
import cdata.rest as mod
- 接続を確立するには、以下のような適切な接続文字列を使用してコネクタオブジェクトからconnect() メソッドを呼び出します。
mod.connect("DataModel=Relational;URI=C:\people.xml;Format=XML")
XML/JSON/CSV データのモデル化
DataModel プロパティは、データをテーブルにどのように表現するかを制御するプロパティです。
- Document (デフォルト):REST データのトップレベルのドキュメントビューをモデル化します。本製品 は、ネストされたオブジェクト配列を集約されたXML/JSON/CSV オブジェクトとして返します。
- FlattenedDocuments:ネストされた配列オブジェクトと親オブジェクトを、単一テーブルに暗黙的に結合します。
- Relational:ネストされたオブジェクト配列を、親ドキュメントにリンクする主キーと外部キーを含む個々の関連テーブルとして表示します。
Set Format to XML, JSON, or CSV in accordance with the data structuring standard used by the REST source you want to connect to. and set DataModel to more closely match the data representation to the structure of your data.
Next Steps
- See REST データのモデリング for information on customizing schema discovery and executing SQL to REST.
- See データアクセスのファインチューニング for more advanced connection settings: fine-tune the default data modeling settings, connect through a firewall, or troubleshoot connections.