データワークフロー

HERE platform では 、カタログ、レイヤー、パーティションの 3 つの主要な概念に従ってデータが整理されます。 プラットフォームは、 1 つ以上のレイヤーを持つ複数のカタログをホストし、パーティションに分割されます。

これらの概念の詳細について は、『 Data API 』を参照してください。

OLP CLI には、次のようなデータ管理ツールがあります。

  • アクセス権を持つすべてのカタログを一覧表示します
  • 新しいカタログとレイヤーを作成します
  • カタログにデータをアップロードします

詳細については 、「カタログ コマンド」を参照してください。

すべてのカタログを一覧表示します

アクセス権を持つカタログを一覧表示するには olp catalog list 、コマンドを入力します。

olp catalog list

このコマンドを使用すると、アクセス権を持つカタログの HRNS が新しい行に一覧表示されます。

新しいカタログとレイヤーを作成します

次の手順に従って、新しいカタログおよびレイヤーを作成します。

  1. olp catalog create コマンドを入力します。

    Linux
    olp catalog create first-catalog-example-id first-catalog-example \
        --summary "This catalog contains a sample layer containing data in CSV format"
    olp catalog create first-catalog-example-id first-catalog-example ^
        --summary "This catalog contains a sample layer containing data in CSV format"
  2. カタログにレイヤーを追加するには olp catalog layer add 、コマンドを入力します。

    Linux
    olp catalog layer add hrn:here:data::org:first-catalog-example-id example-layer-id \
         "Example layer" --versioned --summary "This layer contains simple data in CSV format" \
         --description "A longer description of the layer contents" --content-type=text/csv
    olp catalog layer add hrn:here:data::org:first-catalog-example-id example-layer-id ^
        "Example layer" --versioned --summary "This layer contains simple data in CSV format" ^
        --description "A longer description of the layer contents" --content-type=text/csv

    上記のコマンド を使用すると、 IDexample-layer-id と名前Example layerversionedレイヤーがhrn:here:data::org:first-catalog-example-idカタログに追加されます。 このレイヤーのコンテンツタイプはに設定 text/csvされています。

    Example layerは、次のパラメータが明示的に使用されておらず、デフォルト値に設定されています。

    • --content-encoding uncompressed レイヤーのコンテンツエンコーディング。 このパラメータを指定すると、レイヤー内のすべてのデータが指定したアルゴリズムで圧縮されます。 デフォルト値はです uncompressed。つまり、圧縮は行われません。
    • --partitioning generic レイヤーのパーティション分割方式heretile またはgenericのいずれか です。 で heretiletile levels 、などのコンマで区切って指定でき heretile:level1,level2ます。 プラットフォームは、 1 ~ 15 のタイルレベルをサポートしています。 HERE Tile Partitioningの詳細 について は、「パーティションタイル ID の計算」チュートリアルを参照してください。 デフォルト値はです generic
  3. カタログの設定を確認するには olp catalog show 、コマンドを入力します。

    
        olp catalog show hrn:here:data::org:first-catalog-example-id --json
        

    コマンドを実行すると、次の結果が表示されます。

    
        {
            "summary": "This catalog contains sample layers containing simple text",
            "owner": {
                "creator": {"id": "mzLcb1rL8nskvDQpCFEF"},
                "organisation": {"id": "org"}
            },
            "billingTags": [],
            "hrn": "hrn:here:data::org:first-catalog-example-id",
            "created": "2018-03-26T12:48:10.315Z",
            "name": "first-catalog-example",
            "layers": [{
                "summary": "This layer contains simple data in CSV format",
                "volume": {
                     "volumeType": "durable"
                },
                "layerType": "versioned",
                "billingTags": [],
                "name": "Example layer",
                "description": "A longer description of the layer contents",
                "partitioningScheme": "generic",
                "partitioning": {
                     "scheme": "generic"
                },
                "id": "example-layer-id",
                "contentType": "text/csv",
                "tags": []
            }],
            "description": "",
            "notifications": {
                "enabled": false
             },
            "marketplaceReady": false,
            "id": "first-catalog-example-id",
            "version": -1,
            "tags": []
        }
        

    上記のコマンド出力から、 HERE リソースネーム を含むカタログが hrn:here:data::org:first-catalog-example-id 正常に作成されたことを確認できます。 1 つの versioned 種類のレイヤーが含まれているため、カタログ内の他のレイヤーと論理的に整合性を保つ必要がある、徐々に変化するデータが保存されます。

    このレイヤーには、 ID と example-layer-id 次のプロパティがあります。

    • volumeType: durable レイヤーのストレージの詳細について説明します。 versioned レイヤー内のデータは 1 つのバージョンのスコープで変更されていないため、このレイヤーにはdurableストレージボリュームタイプがあります。
    • billingTags: [] 請求タグのリスト。請求レコードをグループ化するための自由形式のタグです。 このレイヤーには、請求タグがありません。
    • partitioningScheme: generic スキーマ をレイヤーに関連付けて、データの構造とエンコードを定義します。 このレイヤーでは、パーティション分割スキームがに設定 genericされます。これは、最も単純なパーティション分割形式です。 この場合、パーティション名には意味はありません。 詳細については 、パーティションのドキュメントを参照してください。
    • contentType: text/csv このレイヤーに保存されているデータの MIME タイプです。 text/csv テキストベースのフィールドを処理するための MIME タイプが作成されました。

    レイヤーの詳細について は、 Data ユーザー ガイドを参照してください。

カタログにデータをアップロードします

  1. partition-0.csv の例のように、アップロードする詳細情報を含むファイルを作成します。

     City,Country
     Berlin,Germany
     Seattle,USA
     Chicago,USA
     Boston,USA
    
  2. olp catalog layer partition put コマンドを入力します。

    Linux
    olp catalog layer partition put hrn:here:data::org:first-catalog-example-id \
         example-layer-id --partitions testPart0:<path_to_file>/partition-0.csv
    olp catalog layer partition put hrn:here:data::org:first-catalog-example-id ^
        example-layer-id --partitions testPart0:<path_to_file>\partition-0.csv

    このコマンドを実行すると、次の結果が返されます。

     Uploading the files into partitions.
    
      100% [=======================================] 1/1 (0:00:01 / 0:00:00)
     The data was successfully added to the partitions: [testPart0]
    
  3. パーティション を確認するには olp catalog layer partition list 、コマンドを入力します。

    
        olp catalog layer partition list hrn:here:data::org:first-catalog-example-id example-layer-id
        

    コンソールに次のテキストが表示されます。

     partition           size                checksum
     testPart0           23                  665d2817c51cbccd4312eb22699163c05b9d5a0a
    
     Total size: 23 B
     Use olp catalog layer partition get <catalog HRN> <layer ID> to download partitions
    
  4. partition-0.csv からファイルを取得 olpcli-example-catalog-idするには olp catalog layer partition get 、コマンドを入力します。

    Linux
    olp catalog layer partition get \
         hrn:here:data::org:first-catalog-example-id example-layer-id --partitions testPart0
    olp catalog layer partition get ^
        hrn:here:data::org:first-catalog-example-id example-layer-id --partitions testPart0

    コンソールには partition-0.csv 、ファイルに保存されているテキストが表示されます。

     City,Country
     Berlin,Germany
     Seattle,USA
     Chicago,USA
     Boston,USA
    

使用可能なコマンドの完全なリストを取得するには、を入力 olp --helpします。

」に一致する結果は 件です

    」に一致する結果はありません