Skip to main content

aml

These commands work with modeling/analytics files within your project's local directory. Holistics uses AML as the code-based modeling language.

Root Directory

In order to use AML-related commands, the current working directory must be the root directory of a valid AML repository.

compile

Compiles AML files listed in <files...> to JSON objects.

$ holistics aml compile <files...> [-o|--out-dir <output_dir>]
  • <files...>: The AML files to compile.
  • -o, --out-dir <output_dir>: The output directory for the compiled JSON objects.

By default, the compiled JSON object will be printed to stdout. If the --out-dir option is provided, the compiled JSON objects will be saved to the specified directory.

Examples

Given the following AML repository

aml-repo/
├── models/
│ ├── a.aml
│ └── submodel/
│ └── b.aml

Compile AML files and print to stdout:

holistics aml compile models/a.aml models/submodel/b.aml

The output will be printed to stdout, with the following content:

{
"models/a.aml": {
"label": "Model A",
"description": "This is model A",
"owner": "[email protected]",
"__fqn__": "a",
// ...
},
"models/submodel/b.aml": {
"label": "Model B",
"description": "This is model B",
"owner": "[email protected]",
"__fqn__": "b",
// ...
}
}

Compile AML files and save to a directory:

holistics aml compile models/a.aml models/submodel/b.aml -o dist    

The compiled JSON objects will be saved to the dist directory. The directory structure will be the same as the AML repository.

aml-repo/
├── models/
│ ├── a.aml
│ └── submodel/
│ └── b.aml
├── dist/
│ ├── models/
│ │ ├── a.aml.json
│ │ └── submodel/
│ │ └── b.aml.json

The compiled JSON files will be saved in the following format:

models/a.aml.json
{
"label": "Model A",
"description": "This is model A",
"owner": "[email protected]",
"__fqn__": "a",
// ...
}
models/submodel/b.aml.json
{
"label": "Model B",
"description": "This is model B",
"owner": "[email protected]",
"__fqn__": "b",
// ...
}

validate

Similar to the compile command but only a dry run will be performed, and no JSON objects will be generated.

$ holistics aml validate <files...>
  • <files...>: The AML files to validate.

The exit code will be 0 if the validation passes, and 1 if the validation fails.

Example: Validate all AML files in the current directory
$ holistics aml validate **/*.model.aml

Let us know what you think about this document :)