ontocast.toolbox
¶
ToolBox
¶
A container class for all tools used in the ontology processing workflow.
This class initializes and manages various tools needed for document processing, ontology management, and LLM interactions.
Attributes:
Name | Type | Description |
---|---|---|
llm |
LLMTool
|
LLM tool for text processing and analysis. |
triple_store_manager |
TripleStoreManager
|
Manager for RDF triple storage. |
ontology_manager |
OntologyManager
|
Manager for ontology operations. |
converter |
ConverterTool
|
Tool for document conversion. |
chunker |
ChunkerTool
|
Tool for text chunking. |
aggregator |
ChunkRDFGraphAggregator
|
Tool for aggregating RDF graphs. |
Source code in ontocast/toolbox.py
__init__(**kwargs)
¶
Initialize the ToolBox with required tools.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
working_directory
|
Path to the working directory. |
required | |
ontology_directory
|
Optional path to ontology directory. |
required | |
model_name
|
Name of the LLM model to use. |
required | |
llm_base_url
|
Optional base URL for LLM API. |
required | |
temperature
|
Temperature setting for LLM. |
required | |
llm_provider
|
Provider for LLM service (default: "openai"). |
required |
Source code in ontocast/toolbox.py
init_toolbox(toolbox)
¶
Initialize the toolbox with ontologies and their properties.
This function fetches ontologies from the triple store and updates their properties using the LLM tool.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
toolbox
|
ToolBox
|
The ToolBox instance to initialize. |
required |
Source code in ontocast/toolbox.py
render_ontology_summary(graph, llm_tool)
¶
Generate a summary of ontology properties using LLM analysis.
This function uses the LLM tool to analyze an RDF graph and generate a structured summary of its properties.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
graph
|
RDFGraph
|
The RDF graph to analyze. |
required |
llm_tool
|
The LLM tool instance for analysis. |
required |
Returns:
Name | Type | Description |
---|---|---|
OntologyProperties |
OntologyProperties
|
A structured summary of the ontology properties. |
Source code in ontocast/toolbox.py
update_ontology_manager(om, llm_tool)
¶
Update properties for all ontologies in the manager.
This function iterates through all ontologies in the manager and updates their properties using the LLM tool.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
om
|
OntologyManager
|
The ontology manager containing ontologies to update. |
required |
llm_tool
|
LLMTool
|
The LLM tool instance for analysis. |
required |
Source code in ontocast/toolbox.py
update_ontology_properties(o, llm_tool)
¶
Update ontology properties using LLM analysis.
This function uses the LLM tool to analyze and update the properties of a given ontology based on its graph content.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
o
|
Ontology
|
The ontology to update. |
required |
llm_tool
|
LLMTool
|
The LLM tool instance for analysis. |
required |