Skip to content
Skills Library
Data & analytics · Analysis

cmf-query

/cmf-query

Use when querying CMF metadata programmatically — listing pipelines, stages, executions, artifacts; tracing lineage; comparing hyperparameters across runs; or exporting metadata for analysis. Uses the CmfQuery Python API or CLI listing commands.

Repository
cmf ↗
Licence
Apache-2.0
Last repository change
15.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
0
HTML comments
0
URLs in SKILL.md
4
Deprecation

No signals detected. Repository changed on 15.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Use when querying CMF metadata programmatically — listing pipelines, stages, executions, artifacts; tracing lineage; comparing hyperparameters across runs; or exporting metadata for analysis. Uses the CmfQuery Python API or CLI listing commands.

Original author description

Use when querying CMF metadata programmatically — listing pipelines, stages, executions, artifacts; tracing lineage; comparing hyperparameters across runs; or exporting metadata for analysis. Uses the CmfQuery Python API or CLI listing commands.

How it works

  1. Initialize
  2. Common patterns
  3. CLI quick inspection
  4. Troubleshooting
Original SKILL.md headings · 79 lines, 276 words
SKILL.md preview
---
name: cmf-query
description: >
  Use when querying CMF metadata programmatically — listing pipelines, stages, executions,
  artifacts; tracing lineage; comparing hyperparameters across runs; or exporting metadata
  for analysis. Uses the CmfQuery Python API or CLI listing commands.
version: 1.0.0
---

Write the query the user needs using `CmfQuery` or the CMF CLI. Identify what they want to find (pipeline overview, lineage, hyperparameter comparison, specific artifacts) and produce the code.

## Initialize

```python
from cmflib.cmfquery import CmfQuery
query = CmfQuery(filepath="mlmd")   # or path to a downloaded mlmd file
```

## Common patterns

### List pipelines and stages
```python
pipelines = query.get_pipeline_names()           # ['my_pipeline', ...]
stages = query.get_pipeline_stages("my_pipeline") # ['Prepare', 'Train', ...]
```

### Executions with hyperparameters
```python
runs = query.get_all_executions_in_stage("Train")
# runs is a pandas DataFrame — one row per run, columns = custom_properties
print(runs[["name", "learning_rate", "n_estimators"]])
```

### Artifact lineage
```python
# What fed INTO this artifact?
parents = query.get_one_hop_parent_artifacts("models/rf.pkl")

# What was produced FROM this artifact?
children = query.get_one_hop_child_artifacts("data/train.csv")

# Which execution produced this artifact?
execs = query.get_one_hop_parent_executions("models/rf.pkl")
```

### Compare runs across a stage
```python
runs = query.get_all_executions_in_stage("Train")
print(runs[["name", "learning_rate", "n_estimators"]].sort_values("learning_rate"))
```

### Walk full lineage (two hops)
```python
model = "models/rf.pkl"
parents = query.get_one_hop_parent_artifacts(model)
for p in parents["name"].tolist():
    grandparents = query.get_one_hop_parent_artifacts(p)
    print(f"{p} ← {grandparents['name'].tolist()}")
```

### All models in a pipeline
```python
artifacts = query.get_all_artifacts_for_pipeline("my_pipeline")
models = artifacts[artifacts["type"] == "Model"]
print(models[["name", "uri"]])
```

## CLI quick inspection

```bash
cmf pipeline list
cmf execution list -p my_pipeline
cmf artifact list  -p my_pipeline
```

See [references/query-api.md](references/query-api.md) for the full CmfQuery method reference.

## Troubleshooting

- **Empty DataFrame** — check pipeline/stage names with `get_pipeline_names()` / `get_pipeline_stages(pipeline)`
- **`mlmd file not found`** — run `cmf metadata pull -p <name>` first if querying a teammate's data
- **`AttributeError`** — query results are `pandas.DataFrame`; use `.tolist()` or standard DataFrame operations

---

**Docs:** [CmfQuery API reference](https://hewlettpackard.github.io/cmf/api/public/cmfquery/) · [Web UI executions](https://hewlettpackard.github.io/cmf/ui/executions/) · [Web UI lineage](https://hewlettpackard.github.io/cmf/ui/lineage/) · [MCP for natural language queries](https://hewlettpackard.github.io/cmf/mcp/)
Files in this package (3)
  • SKILL.md 3 KB
  • sources.md 1 KB
  • references/query-api.md 1 KB

Versions

The database has no other skills named cmf-query.

Database snapshot: 13.11.2026 · package version 9f60c404e2ff (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100cmf
    Use when working with the Common Metadata Framework (CMF) — initializing CMF in a project, instrumenting ML pipeline code, syncing metadata and artifacts with a CMF Server, querying lineage and artifacts, or setting up the CMF MCP server for AI assistant integration. Routes to…
  • 100cmf-instrument
    Use when adding CMF metadata tracking to existing Python ML pipeline code, or writing new CMF-instrumented pipeline stages from scratch. Covers the Cmf() API: create_context, create_execution, log_dataset, log_model, log_metric, commit_metrics, log_execution_metrics, and…
  • 100data-lineage-tracker
    Track data lineage tracker operations. Auto-activating skill for Data Pipelines. Triggers on: data lineage tracker, data lineage tracker Part of the Data Pipelines skill category. Use when working with data lineage tracker functionality. Trigger with phrases like "data lineage…
  • 100push-ingestion
    Expert guide for Monte Carlo's push ingestion model. Use this skill whenever a customer or engineer mentions: pushing data to Monte Carlo, the IngestionService, pycarlo push APIs, build me a collection script, push metadata/lineage/query logs, invocation_id tracing, custom…
  • 100marmot
    Interact with a Marmot data catalog instance. Use this skill when the user wants to search for data assets, view lineage, browse glossary terms, check pipeline runs, manage tags or owners, view metrics, query catalogued data, or do anything related to their data catalog. Covers…
  • 100data-catalog-metadata-lineage-openlineage
    Use this skill when tracking end-to-end data lineage, asset discovery, and governance metadata using OpenLineage and Marquez.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.