ontocast.tool.ontology_manager
¶
Ontology management tool for OntoCast.
This module provides functionality for managing multiple ontologies, including loading, updating, and retrieving ontologies by name or IRI.
OntologyManager
¶
Bases: Tool
Manager for handling multiple ontologies.
This class provides functionality for managing a collection of ontologies, including selection and retrieval operations.
Attributes:
Name | Type | Description |
---|---|---|
ontologies |
list[Ontology]
|
List of managed ontologies. |
Source code in ontocast/tool/ontology_manager.py
__init__(**kwargs)
¶
Initialize the ontology manager.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Additional keyword arguments passed to the parent class. |
{}
|
get_ontology(short_name)
¶
Get an ontology by its short name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
short_name
|
str
|
The short name of the ontology to retrieve. |
required |
Returns:
Name | Type | Description |
---|---|---|
Ontology |
Ontology
|
The matching ontology if found, NULL_ONTOLOGY otherwise. |
Source code in ontocast/tool/ontology_manager.py
get_ontology_names()
¶
Get a list of all ontology short names.
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: List of ontology short names. |
update_ontology(short_name, ontology_addendum)
¶
Update an existing ontology with additional triples.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
short_name
|
str
|
The short name of the ontology to update. |
required |
ontology_addendum
|
RDFGraph
|
The RDF graph containing additional triples to add. |
required |