src.dackar.knowledge_graph.visualize_schema

Functions

_iter_relations(relations_section)

Yield (relation_name, relation_entry) for each concrete relation entry.

_collect_nodes(schema)

_collect_relations(schema)

createInteractiveFile(schema_list[, output_file, ...])

Build an interactive HTML visualization from a list of parsed schema dicts.

Module Contents

src.dackar.knowledge_graph.visualize_schema._iter_relations(relations_section)[source]

Yield (relation_name, relation_entry) for each concrete relation entry. Supports both:

  • relation_name -> dict

  • relation_name -> list[dict]

Parameters:

relations_section (Dict[str, Any])

Return type:

Iterable[Tuple[str, Dict[str, Any]]]

src.dackar.knowledge_graph.visualize_schema._collect_nodes(schema)[source]
Parameters:

schema (Dict[str, Any])

Return type:

Dict[str, Dict[str, Any]]

src.dackar.knowledge_graph.visualize_schema._collect_relations(schema)[source]
Parameters:

schema (Dict[str, Any])

Return type:

List[Tuple[str, Dict[str, Any]]]

src.dackar.knowledge_graph.visualize_schema.createInteractiveFile(schema_list, output_file='knowledge_graph_schema_interactive.html', namespace_by_schema=False, raise_on_collision=True)[source]

Build an interactive HTML visualization from a list of parsed schema dicts.

Parameters:
  • schema_list (list[dict]) – Each dict is a parsed TOML schema with ‘node’ and ‘relation’.

  • output_file (str) – Where to write the HTML.

  • namespace_by_schema (bool) – If True, prefix node and relation labels with schema index to prevent collisions.

  • raise_on_collision (bool) – If True, raise on duplicate node or relation names; else, log warning and overwrite.

Return type:

None