Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Once you have an idea what Types you want, what methods you want, What and ActionRuntimes you want in your C3 Package, it's time to put it all together. This serves as an overview for the rules surrounding the creation of a C3 PackageAI Suite package.

As an example, here is a typical directory tree you might find for a C3 Package:

Code Block
- repository.json
- myPackageDirectory
  - package.json
  - seed
    - CanonicalTypeName
      - TypeName.csv
    - FileSourceCollection
      - CanonicalTypeName.json
  - src
    - canonicals
      - CanonicalTypeName.c3typ
    - transforms
      - TransformCanonicalTypeNameToTypeName.c3typ
    - types
      - TypeName.c3typ
      - TypeName.py
      - TypeName.js
  - ui
    ...
- dependencyDirectory
  - package.json
  - seed
    ...
  - src
    ...
  - ui
    ...
...

Generally, at the top , we have the 'repository.json' file. This decribes describes the repository. Then, we have package subdirectories. One for each package. Within each package subdirectory, we have a 'package.json' file which describes the C3 Package includingpackage, as detailed below.

repository.json File

At the top of your C3 package you need a repository.json file. Here's an example from the base covid datalake repository:

Code Block
{
  "name": "dtiTraining",
  "version": "1.0.0",
  "description": "DTI research/training environment",
  "dependencies": {
      "base": "7.12.0+1206",
      "c3aiDataLake": "1.0.4+4",
      "server": "7.12.0.10137"
  }
}

The fields of note here are:

  • name: The name of the repository.
  • version: The version of the repository.
  • description: A human readable description of the repository.
  • dependencies: A list of C3 AI Suite dependencies and their versions.

...

Within the package subdirectory, we have the package.json file.:

Code Block
{
    "name": "baseCovidDataLake",
    "description": "Base Covid Datalake",
    "author": "Matthew Krafczyk <krafczyk.matthew@gmail.com>",
    "dependencies": [
        "covid19DataLake",
        "uiFramework"
    ]
}

The fields of note here are:

  • name: The name of the package.
  • description: A human readable description of the package.
  • author: The author of the package.
  • dependencies: A list of the C3 Package dependencies required for this package.

...

Additional Resources

  • Developer Documentation

    seed directory

    The seed directory contains seed data for your package. This includes Data for canonicals, .json files defining metrics, AcitionRuntimes, and other types Types such as FileSourceCollections.C3.ai resources on the seed directory:

    Additional Resources

    src directory

    The The src directory contains all the .c3typ and method implementation files your C3 package needs. There is no rule about where specific .c3typ files should go, they should just be somewhere under the src directory. Usually people organize this directory into compartments for broad type categories such as 'types', 'canonicals', and 'transforms'. The implementation files should appear in the same directory as the type Type definition that requires them.C3.ai resources on the src directory:

    Additional Resources

    resource directory

    See https://developer.c3.ai/docs/7.912.1025/topic/resource.

    ui directory

    All files for your application UI are placed in the /ui/c3/meta subdirectory of your application package. This subdirectory contains the:

    • UI pages configuration files.
    • UI components configuration files.

    The /ui/c3/meta/ directory of your package can be organized in any manner desired.

    See the official C3 AI developer documentation here for more details.The 'ui' directory contains information about UI elements your C3 Package can manage. This discussion will be expanded in the future. See https://developer.c3.ai/docs/7.9.10/topic/ui