Ontology Grounding

Ontology Grounding subpackage. Contains modules and utilities for grounding JSON Schema with QUDT Ontology Using Either Simple LLM Prompting or Agent-based Workflow

schema_miner.ontology_grounding.agentic_qudt_grounding(llm_model_name: str, process_schema: dict | Path, result_file_path: str, save_schema: bool = False) dict | None

Ground a process schema with QUDT (QuantityKind and Unit) ontology using an agentic workflow powered by an LLM.

Parameters:
  • llm_model_name (str) – Name of the LLM model to use (e.g., “gpt-4o”).

  • process_schema (dict | Path) – Path to the JSON process schema to be grounded.

  • result_file_path (str) – Directory path where the grounded schema will be saved if save_schema is True.

  • save_schema (bool) – Whether to save the grounded schema to disk.

Returns dict | None:

The modified (grounded) schema dictionary, or None if grounding fails.

schema_miner.ontology_grounding.prompt_based_qudt_grounding(llm_model_name: str, process_schema: dict | Path, result_file_path: str, save_schema: bool = False) dict | None

Ground a process schema with QUDT (QuantityKind and Unit) ontology using a direct prompt-based approach.

Parameters:
  • llm_model_name (str) – Name of the LLM model to use (e.g., “gpt-4o”).

  • process_schema (dict | Path) – Path to the JSON process schema to be grounded.

  • result_file_path (str) – Directory path where the grounded schema will be saved if save_schema is True.

  • save_schema (bool) – Whether to save the grounded schema to disk.

Returns dict | None:

The modified (grounded) schema dictionary, or None if grounding fails.