スキーマ ワークフロー
スキーマは、データの構造とその内容の両方を含む、各partition
layer
内のデータの組織を定義します。
HERE platform では 、プロトコルバッファを使用してスキーマが定義されます。 これらの概念の詳細については 、「スキーマ」を参照してください。
OLP CLI には、次のようなスキーマを管理するためのツールがあります。
- 新しいスキーマを作成します
- スキーマの詳細を表示します
- アクセス権のあるすべてのスキーマを一覧表示します
- スキーマパッケージをダウンロードします
- スキーマに権限を付与します
- スキーマの権限を削除します
- スキーマ を削除します
詳細については 、「スキーマ コマンド」を参照してください。
新しいスキーマを作成します
新しいスキーマプロジェクトを作成するには、次の手順に従います。
- 提供された原型を使用してスキーマプロジェクトを生成します。
- データスキーマを定義します。
- スキーマアーティファクトを公開します
詳細については、 HERE Workspace for Java and Scala Developers を参照してください。
スキーマの詳細を表示します
HERE platform にパブリッシュされたスキーマ の詳細を確認するに olp schema show
は、コマンドを実行します。 このコマンドを実行する には、スキーマの HERE リソースネーム ( HERE リソースネーム )を把握している必要があります。
スキーマ HERE リソースネーム を学習するには、次のいずれかの操作を行います。
- プラットフォーム ポータル に移動し、 ランチャから [ データ ] を選択して 、 [ スキーマ ] タブに移動します。 の名前、説明、またはグループ ( スキーマプロジェクトの POM ファイルで指定されているとおり ) でスキーマを検索します。 次に、スキーマをクリックし、 概要 タブを選択して、スキーマの HERE リソースネーム をクリップボードにコピーします。
olp schema list
コマンドを使用 filter
して、スキーマの名前、概要、またはその一部をパラメータに渡します。 出力には、スキーマ の HERE リソースネーム が含まれています。
たとえば hrn:here:schema::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0
、 HERE リソースネーム を使用してスキーマの詳細を表示するには、次のコマンドを実行します。
olp schema show \
hrn:here:schema::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0 --json
olp schema show ^
hrn:here:schema::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0 --json
コマンドを実行すると、次の結果が表示されます。
{
"summary": "Schema project for OLP",
"schemaValidationResults": [
{
"fileExtension": true,
"module": "proto",
"packageConsistency": false,
"backwardsCompatibility": true,
"googleStyle": true,
"majorVersionInPackage": true
},
{
"fileExtension": false,
"module": "ds",
"packageConsistency": true,
"backwardsCompatibility": false,
"googleStyle": false,
"majorVersionInPackage": false
}
],
"hrn": "hrn:here:schema::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0",
"created": "2018-06-26T11:36:30.321Z",
"groupId": "com.here.platform.cli.schema.test",
"name": "Schema",
"artifactId": "olp_cli_example_schema_v1",
"type": "proto",
"updated": "2018-06-26T11:36:40.745Z",
"version": "1.0.0",
"variants": [{
"id": "ds",
"url": "/artifact/hrn:here:artifact::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1_ds:1.0.0/olp_cli_example_schema_v1_ds-1.0.0.zip"
}],
"artifacts": [
{
"hrn": "hrn:here:artifact::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1_java:1.0.0",
"created": "2018-06-26T11:36:30.321Z",
"groupId": "com.here.platform.cli.schema.test",
"artifactId": "olp_cli_example_schema_v1_java",
"version": "1.0.0",
"updated": "2018-06-26T11:36:40.745Z"
},
{
"hrn": "hrn:here:artifact::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1_proto:1.0.0",
"created": "2018-06-26T11:36:30.321Z",
"groupId": com.here.platform.cli.schema.test",
"artifactId": "olp_cli_example_schema_v1_proto",
"version": "1.0.0",
"updated": "2018-06-26T11:36:40.745Z"
},
{
"hrn": "hrn:here:artifact::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1_scala:1.0.0",
"created": "2018-06-26T11:36:30.321Z",
"groupId": "com.here.platform.cli.schema.test",
"artifactId": "olp_cli_example_schema_v1_scala",
"version": "1.0.0",
"updated": "2018-06-26T11:36:40.745Z"
}
]
}
hrn:here:schema::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0
上記の例のスキーマ HERE リソースネーム は、独自のスキーマの HERE リソースネーム を渡すプレースホルダーとして機能します。
スキーマの検証結果の詳細については、「 HERE Workspace for Java and Scala Developers 」を参照してください。
すべてのスキーマを一覧表示します
アクセス権を持つスキーマを一覧表示するに olp schema list
は、コマンドを実行します。
olp schema list
このコマンドを使用すると、アクセス権を持つスキーマの HRNS が新しい行に一覧表示されます。
hrn:here:schema::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0
hrn:here:schema::org:com.here.platform.cli.schema.test:public_schema1_v1:1.0.0
hrn:here:schema::org:com.here.platform.cli.schema.test:public_schema2_v1:1.0.0
Use olp schema show <schema HRN> to display more information about a schema
スキーマ パッケージをダウンロードします
スキーマパッケージは、次のものを含むデータバンドルです。
- ローカルスキーマ定義ファイル
- スキーマの依存関係の定義ファイル
- トップレベルのメッセージを宣言するマニフェスト
- JavaScript レンダラ ( 利用可能な場合 )
スキーマ パッケージをダウンロードするには olp schema get
、コマンドを実行します。
olp schema get \
hrn:here:schema::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0 \
--output /tmp/ds_bundle
olp schema get ^
hrn:here:schema::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0 ^
--output /tmp/ds_bundle
コマンドを実行すると、次の結果が表示されます。
Schema package was successfully downloaded to /tmp/ds_bundle/olp_cli_example_schema_v1_ds-1.0.0.zip
権限を付与します
任意のアプリ、グループ、またはユーザーにスキーマ権限を付与できます。
次の手順では、アプリケーションにスキーマ権限を付与する方法を示します。
-
アプリを作成するか、または既存の を使用します。
- アプリ を作成するに は、
olp app create
コマンドに--json
フラグを付けて使用し、次のステップで使用するAPP_ID
値を保存します。
-
アプリ に、スキーマ で選択したアクションを実行する権限を付与するに olp schema permission grant
は、コマンドを使用します。
olp schema permission grant \
hrn:here:schema::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0 \
--app APP_ID --read --modify --share
olp schema permission grant ^
hrn:here:schema::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0 ^
--app APP_ID --read --modify --share
Granted read, modify, share access for the app APP_ID to the schema hrn:here:schema::org:com.here.example:test_schema_v1:1.0.0
権限を削除します
アプリ からスキーマ への権限を削除するに olp schema permission revoke
は、コマンドを使用します。
olp schema permission revoke \
hrn:here:schema::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0 \
--app APP_ID --read --modify --share
olp schema permission revoke ^
hrn:here:schema::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0 ^
--app APP_ID --read --modify --share
Revoked read, modify, share access for the app APP_ID to the schema hrn:here:schema::org:com.here.example:test_schema_v1:1.0.0
スキーマ を削除します
olp schema delete
コマンドを入力し、 スキーマ HERE リソースネーム を指定します。
olp schema delete \
hrn:here:schema::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0
olp schema delete ^
hrn:here:schema::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0
コマンドを実行すると、次の結果が表示されます。
Schema hrn:here:schema::org:com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0
has been removed