Context
A context is a logical graph container. It groups related statements, assets, and computations so they can be exported, viewed, or registered together.
Contexts matter because they define the boundary of a manifest and the unit of organization for a workflow. If you want to keep different projects, runs, customers, or Governance Studio graphs separate, use different contexts. Parent-child contexts are useful when you want multiple runs or subgraphs to roll up under a larger project-level graph.
Most users should create a context early, pass it to init(default_context=...), and then let assets and computations attach to that context by default. Use Context.from_uuid(...) when you want the graph to correspond to an existing Governance Studio project, and use export(...), import_manifest(...), or register(...) when moving the graph between local state and external systems.
A structure for organizing related statements hierarchically in the database. Graph context groups statements together with optional parent-child relationships, enabling organizational structure for lineage graphs.
id
property
id: UUID
Unique identifier
name
property
name: str
Human-readable name
parent
property
parent: Optional[UUID]
Optional parent ID for hierarchical organization
new
staticmethod
new(name: str) -> Context
Creates a new root context with the given name. Use this to start a new local lineage graph that does not have a parent context. If the global config is initialized, the context is persisted to sqlite immediately and can be used as the default context for subsequent asset and computation registration.
with_parent
staticmethod
with_parent(parent: Context) -> ContextFactory
Returns a factory that creates contexts with the provided parent.
from_uuid
staticmethod
from_uuid(project_id: UUID) -> Context
Creates a new context with the given uuid.
register
register(service: Service) -> None
Registers this context, its ancestors, statements, and blobs with a service.
export
export(path: PathLike[str]) -> None
Exports this context's statements and blobs to a manifest JSON file.
import_manifest
import_manifest(path: PathLike[str]) -> None
Imports the statements and blobs from a manifest file to this context.