Schema Workflows

Schemas define the organization of data in each partition of a layer, including both the structure of the data and its content.

In the HERE platform, schemas are defined using Protocol Buffers. For more information on these concepts, see Schemas.

The OLP CLI provides tools for managing schemas, such as:

For more details, see Schema Commands.

Create a New Schema

Follow the steps below to create a new schema project:

  1. Generate a schema project using the provided archetype.
  2. Define a data schema.
  3. Publish the schema artifact.

For more details, see Archetypes Developer Guide

Show the Details of the Schema

To verify the details of the schema published to the HERE platform, run the schema show command. To run this command, you need to know the schema's HERE Resource Name (HRN).

To learn your schema HRN, do one of the following:

  • Go to the platform portal, select the Data tab, click Browse schemas, and look the schema up by its name, description, or group (as specified in the schema project POM file). Then, click the schema, select the Overview tab, and copy the schema's HRN to clipboard.

  • Use the schema list command and pass your schema's name or summary, or part of it, to the filter parameter. In the output, you'll find the HRN of your schema.

For example, to view the details of the schema with the hrn:here:schema::olp-here:com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0 HRN, you can execute the following command:

Linux
Windows
olp schema show \
   hrn:here:schema::olp-here:com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0 --json
olp schema show ^
   hrn:here:schema::olp-here:com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0 --json

The command displays the following results:


{
    "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:::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",
    "updated": "2018-06-26T11:36:40.745Z",
    "version": "1.0.0"
}

Note that the hrn:here:schema:::com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0 schema HRN in the example above serves as a placeholder where you should pass the HRN of your own schema.

For more details about schema validation results, see Configuring Protobuf Validators

List All Schemas

To list the schemas to which you have access, run the schema list command.

olp schema list

The command lists the HRNs of the schemas to which you have access, each in a new line.

Download the Schema Package

A schema package is a data bundle that contains:

  • Local schema definition file(s)
  • Any definition files for schema dependencies
  • A manifest that declares the top-level Message
  • A JavaScript renderer (if available)

To download a schema package, run the schema get command.

Linux
Windows
olp schema get \
   hrn:here:schema:::com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0 \
   --output /tmp/ds_bundle
olp schema get ^
   hrn:here:schema:::com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0 ^
   --output /tmp/ds_bundle

The command displays the following results:

Schema package was successfully downloaded to /tmp/ds_bundle/olp_cli_example_schema_v1_ds-1.0.0.zip

Delete the Schema

Enter the schema delete command and specify your schema HRN.

Linux
Windows
olp schema delete \
   hrn:here:schema:::com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0
olp schema delete ^
   hrn:here:schema:::com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0

The command displays the following results:


Schema hrn:here:schema:::com.here.platform.cli.schema.test:olp_cli_example_schema_v1:1.0.0
has been removed.

results matching ""

    No results matching ""