Skip to main content

Ontology Versioning - SDK Support

Support Functions

Use these functions to return the latest ontology version change tables through the carbonarc python SDK.

get_library_version_changes()

Track changes to data library - datasets, schemas, configurations.

Parameters:

  • version: Ending version (such as Latest)
  • size: Results per page (default: 100)

Use cases:

  • Release management
  • Impact analysis for updates
  • Audit trails
  • Migration planning

get_ontology_version_changes_for_entities()

Track changes to specific entities across ontology versions.

Parameters:

  • entity_ids: List of entity IDs to monitor
  • entity_type: "brand", "company", "category"

Use cases:

  • Monitor critical business entities
  • Track relationship changes
  • Validate hierarchy updates

Implementation

Basic Usage

# Library changes
library_changes = client.data.get_library_version_changes("latest")
print(library_changes)


# Entity monitoring
entity_changes = ca.ontology.get_ontology_version_changes_for_entities(
entity_ids=[18433, 30245, 48291], #Nike, #Adidas, #Reebok
entity_type="brand"
)

Export to CSV

import pandas as pd
from datetime import datetime

changes = client.data.get_library_version_changes()
df = pd.DataFrame(changes['changes'])
df.to_csv(f"library_changes_{datetime.now():%Y%m%d}.csv", index=False)

Response Structure

Both functions return:

  • Pagination: page, size
  • Version info: from_version, to_version
  • Change details: change_type, timestamp, old_value, new_value
  • Entity context: entity_name, entity_type

Error Handling

try:
changes = client.ontology.get_library_version_changes()
except Exception as e:
print(f"Version check failed: {e}")