You will need a cloud project with permissions to use BigQuery and Knowledge Catalog APIs.
export DEMO_CLOUD_PROJECT=<GCP_PROJECT_ID>Ensure that gcloud is installed and configured.
gcloud auth application-default login
gcloud config set compute/region us-central1
gcloud config set project $DEMO_CLOUD_PROJECTThis demo demonstrates working with metadata for BigQuery resources (dataset and table).
Setup
- Creates a BigQuery dataset (
demo_ecommerce) and a table (events) based on BigQuery sample data in your cloud project. - Creates a
catalog.yamlmanifest to specify the local catalog snapshot.
bun setup.ts
cat catalog.yamlCreate Metadata Snapshot
- Pull metadata from Knowledge Catalog
../../dist/kcmd pull
ls -R catalog
cat catalog/$DEMO_CLOUD_PROJECT.demo_ecommerce.yamlModify Metadata Snapshot
- Either manually edit the file, or use the following command which adds a dummy overview aspect.
bun update.ts catalog/$DEMO_CLOUD_PROJECT.demo_ecommerce.yaml
cat catalog/$DEMO_CLOUD_PROJECT.demo_ecommerce.yamlPublish Metadata Snapshot
- Push metadata to Knowledge Catalog
../../dist/kcmd pushCleanup
- Deletes the BigQuery resources created for the demo
bun cleanup.tsThis demo demonstrates working with a Knowledge Base managed in Knowledge Catalog.
Setup
- Creates a Dataplex EntryGroup (
demo_kb) and a set of document entries within it. - Creates a
catalog.yamlmanifest to specify the local catalog snapshot.
bun setup.ts
cat catalog.yamlCreate Metadata Snapshot
- Pull metadata from Knowledge Catalog
../../dist/kcmd pull
ls -R catalog
cat catalog/index.mdModify Metadata Snapshot
- Either manually edit the file, or use the following command which creates a placeholder
demo update to the content of the
indexentry using thekcmd(metadata as code) library.
bun update.ts
cat catalog/index.mdPublish Metadata Snapshot
- Push metadata to Knowledge Catalog
../../dist/kcmd pushCleanup
- Deletes the Dataplex EntryGroup
bun cleanup.tsThis demo demonstrates publishing an Open Knowledge Format
wiki bundle (a directory of markdown files with YAML frontmatter) into a
Knowledge Catalog EntryGroup via the Documents Layout. The bundle in
okf/catalog/ is a GA4 sample with indexes, references, a dataset, and a
table, 17 markdown files in total. The Documents Layout maps each .md
file to an entry whose name is derived from the file path, with the
markdown body stored on the dataplex-types.global.overview aspect.
Setup
- Creates an empty Dataplex EntryGroup (
okf_ga4). - Creates a
catalog.yamlmanifest pointing at the EntryGroup. - The
catalog/directory is already populated with the GA4 markdown bundle.
bun setup.ts
cat catalog.yaml
ls -R catalogPublish Metadata Snapshot
- Push the bundled markdown to Knowledge Catalog. Entry names mirror the
file path (e.g.
references/metrics/event_count.md→ entryreferences/metrics/event_count). Customtype:values in frontmatter that aren't valid Dataplex type refs fall back todataplex-types.global.generic.
../../dist/kcmd pushModify Metadata Snapshot
- Edit any markdown file under
catalog/directly. Both frontmatter fields (title,description,tags) and the markdown body can be changed, then push again.
../../dist/kcmd pushCleanup
- Deletes the Dataplex EntryGroup
bun cleanup.ts