You're reading the v2.1.0 docs. View the latest (v2.5.8) →

Types & Ontology

Types are git-branched, schema-as-code (ADR ontology). schema_alter evolves a type in place; ontology_migrate applies a SHACL constraint set; create_link/register_edge_type wire the graph. Modules group a type pack.

14 methods across this domain. Signatures, parameters (incl. keyword-only tunable defaults), and the three SDK spellings are ported from the live SDK source; flagship methods carry a hand-written When to use + example.

RelataClient

register_type(name, **kwargs: object)

When to use. Register a new governed type with its column schema and constraints.

  • Python — client.relataclient.register_type(name, **kwargs: object)
  • TypeScript — registerType(name, spec)
  • Go — RegisterType(name, spec)

Parameters: name, **kwargs: object

Example

relata.register_type("Company", {"name": "string", "vat": "string?"}, pk="name")

schema_alter(type_name, action, column, new_column=None, col_type=None, optional=None)

When to use. Evolve a type in place (add/drop columns) without a full re-register (ADR-1307).

  • Python — client.relataclient.schema_alter(type_name, action, column, new_column=None, col_type=None, optional=None)
  • TypeScript — schemaAlter(name, action, column, opts)
  • Go — SchemaAlter(name, action, column)

Parameters: type_name, action, column, new_column=None, col_type=None, optional=None

Example

relata.schema_alter("Company", add={"lei": "string?"})

create_link(link_name, source_id, source_type, target_id, target_type)`

  • Python — client.relataclient.create_link(link_name, source_id, source_type, target_id, target_type)
  • TypeScript — createLink(params)
  • Go — CreateLink(params)

Parameters: link_name, source_id, source_type, target_id, target_type

delete_webhook(webhook_id)

delete_webhook(webhook_id)`

  • Python — client.relataclient.delete_webhook(webhook_id)
  • TypeScript — deleteWebhook(id)
  • Go — DeleteWebhook(id)

Parameters: webhook_id

deregister_type(name)

deregister_type(name)`

  • Python — client.relataclient.deregister_type(name)
  • TypeScript — deregisterType(name)
  • Go — DeregisterType(name)

Parameters: name

enrichment_rules(rules)

enrichment_rules(rules)`

  • Python — client.relataclient.enrichment_rules(rules)
  • TypeScript — enrichmentRules(rules)
  • Go — EnrichmentRules(rules)

Parameters: rules

list_edge_types()

list_edge_types()`

  • Python — client.relataclient.list_edge_types()
  • TypeScript — listEdgeTypes()
  • Go — ListEdgeTypes()

list_modules()

list_modules()`

  • Python — client.relataclient.list_modules()
  • TypeScript — listModules()
  • Go — ListModules()

list_types()

list_types()`

  • Python — client.relataclient.list_types()
  • TypeScript — listTypes()
  • Go — ListTypes()

list_webhooks()

list_webhooks()`

  • Python — client.relataclient.list_webhooks()
  • TypeScript — listWebhooks()
  • Go — ListWebhooks()

ontology_migrate(schema)

ontology_migrate(schema)`

  • Python — client.relataclient.ontology_migrate(schema)
  • TypeScript — ontologyMigrate(schema)
  • Go — OntologyMigrate(schema)

Parameters: schema

register_edge_type(from_type, to_type, label)

register_edge_type(from_type, to_type, label)`

  • Python — client.relataclient.register_edge_type(from_type, to_type, label)
  • TypeScript — registerEdgeType(fromType, toType, label)
  • Go — RegisterEdgeType(fromType, toType, label)

Parameters: from_type, to_type, label

register_webhook(url, event_types=None)

register_webhook(url, event_types=None)`

  • Python — client.relataclient.register_webhook(url, event_types=None)
  • TypeScript — registerWebhook(url, eventTypes)
  • Go — RegisterWebhook(url, eventTypes)

Parameters: url, event_types=None

type_detail(name)

type_detail(name)`

  • Python — client.relataclient.type_detail(name)
  • TypeScript — typeDetail(name)
  • Go — TypeDetail(name)

Parameters: name