ontocast.tool.triple_manager
¶
Triple store management tools for OntoCast.
This module provides functionality for managing RDF triple stores, including abstract interfaces and filesystem-based implementations.
FilesystemTripleStoreManager
¶
Bases: TripleStoreManager
Filesystem-based implementation of triple store management.
This class provides a concrete implementation of triple store management using the local filesystem for storage.
Attributes:
Name | Type | Description |
---|---|---|
working_directory |
Path
|
Path to the working directory for storing data. |
ontology_path |
Optional[Path]
|
Optional path to the ontology directory. |
Source code in ontocast/tool/triple_manager.py
__init__(**kwargs)
¶
Initialize the filesystem triple store manager.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Additional keyword arguments passed to the parent class. |
{}
|
fetch_ontologies()
¶
Fetch all available ontologies from the filesystem.
Returns:
Type | Description |
---|---|
list[Ontology]
|
list[Ontology]: List of available ontologies. |
Source code in ontocast/tool/triple_manager.py
serialize_facts(g, **kwargs)
¶
Store a graph in the filesystem.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
g
|
Graph
|
The graph to store. |
required |
**kwargs
|
Additional keyword arguments for serialization. spec: Optional specification for the filename. |
{}
|
Source code in ontocast/tool/triple_manager.py
serialize_ontology(o, **kwargs)
¶
Store an ontology in the filesystem.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
o
|
Ontology
|
The ontology to store. |
required |
**kwargs
|
Additional keyword arguments for serialization. |
{}
|
Source code in ontocast/tool/triple_manager.py
TripleStoreManager
¶
Bases: Tool
Base class for managing RDF triple stores.
This class defines the interface for triple store management operations, including fetching and storing ontologies and their graphs.
Source code in ontocast/tool/triple_manager.py
__init__(**kwargs)
¶
Initialize the triple store manager.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Additional keyword arguments passed to the parent class. |
{}
|
fetch_ontologies()
abstractmethod
¶
Fetch all available ontologies.
Returns:
Type | Description |
---|---|
list[Ontology]
|
list[Ontology]: List of available ontologies. |
serialize_facts(g, **kwargs)
abstractmethod
¶
Store a graph with a given name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
g
|
Graph
|
The graph to store. |
required |
**kwargs
|
Additional keyword arguments for serialization. |
{}
|