ontocast.tool
¶
Tool package for OntoCast.
This package provides a collection of tools that support the OntoCast workflow, including document processing, ontology management, triple store operations, and LLM interactions.
The package includes: - LLMTool: Language model interaction and prompting - OntologyManager: Ontology loading and management - TripleStoreManager: Abstract interface for triple store operations - FusekiTripleStoreManager: Fuseki-specific triple store implementation (preferred) - Neo4jTripleStoreManager: Neo4j-specific triple store implementation - FilesystemTripleStoreManager: Filesystem-based triple store implementation - ConverterTool: Document format conversion utilities - ChunkerTool: Text chunking and segmentation
All tools inherit from the base Tool class and provide standardized interfaces for integration into the OntoCast workflow.
Example
from ontocast.tool import LLMTool, OntologyManager llm = LLMTool.create(provider="openai", model="gpt-4") om = OntologyManager()
ConverterTool
¶
Bases: Tool
Tool for converting documents to structured data.
This class provides functionality for converting various document formats into structured data that can be processed by the OntoCast system.
Attributes:
Name | Type | Description |
---|---|---|
supported_extensions |
set[str]
|
Set of supported file extensions. |
Source code in ontocast/tool/converter.py
__call__(file_input)
¶
Convert a document to structured data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_input
|
Union[bytes, str]
|
The input file as either a BytesIO object or file path. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: The converted document data. |
Source code in ontocast/tool/converter.py
__init__(**kwargs)
¶
Initialize the converter tool.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Additional keyword arguments passed to the parent class. |
{}
|
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. It reads and writes ontologies and facts as Turtle (.ttl) files in specified directories.
The manager supports: - Loading ontologies from a dedicated ontology directory - Storing ontologies with versioned filenames - Storing facts with customizable filenames based on specifications - Error handling for file operations
Attributes:
Name | Type | Description |
---|---|---|
working_directory |
Optional[Path]
|
Path to the working directory for storing data. |
ontology_path |
Optional[Path]
|
Optional path to the ontology directory for loading ontologies. |
Source code in ontocast/tool/triple_manager/filesystem_manager.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
__init__(**kwargs)
¶
Initialize the filesystem triple store manager.
This method sets up the filesystem manager with the specified working and ontology directories.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Additional keyword arguments passed to the parent class. working_directory: Path to the working directory for storing data. ontology_path: Path to the ontology directory for loading ontologies. |
{}
|
Example
manager = FilesystemTripleStoreManager( ... working_directory="/path/to/work", ... ontology_path="/path/to/ontologies" ... )
Source code in ontocast/tool/triple_manager/filesystem_manager.py
fetch_ontologies()
¶
Fetch all available ontologies from the filesystem.
This method scans the ontology directory for Turtle (.ttl) files and loads each one as an Ontology object. Files are processed in sorted order for consistent results.
Returns:
Type | Description |
---|---|
list[Ontology]
|
list[Ontology]: List of all ontologies found in the ontology directory. |
Example
ontologies = manager.fetch_ontologies() for onto in ontologies: ... print(f"Loaded ontology: {onto.ontology_id}")
Source code in ontocast/tool/triple_manager/filesystem_manager.py
serialize_facts(g, **kwargs)
¶
Store a graph with facts in the filesystem.
This method stores the given RDF graph containing facts as a Turtle file in the working directory. The filename can be customized using the spec parameter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
g
|
Graph
|
The RDF graph containing facts to store. |
required |
**kwargs
|
Additional keyword arguments for serialization. spec: Optional specification for the filename. If provided as a string, it will be processed to create a meaningful filename. |
{}
|
Raises:
Type | Description |
---|---|
TypeError
|
If spec is provided but not a string. |
Example
facts = RDFGraph() manager.serialize_facts(facts, spec="domain/subdomain")
Creates: working_directory/facts_domain_subdomain.ttl¶
Source code in ontocast/tool/triple_manager/filesystem_manager.py
serialize_ontology(o, **kwargs)
¶
Store an ontology in the filesystem.
This method stores the given ontology as a Turtle file in the working directory. The filename is generated using the ontology ID and version to ensure uniqueness.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
o
|
Ontology
|
The ontology to store. |
required |
**kwargs
|
Additional keyword arguments for serialization (not used). |
{}
|
Example
ontology = Ontology(ontology_id="test", version="1.0", graph=graph) manager.serialize_ontology(ontology)
Creates: working_directory/ontology_test_1.0.ttl¶
Source code in ontocast/tool/triple_manager/filesystem_manager.py
FusekiTripleStoreManager
¶
Bases: TripleStoreManagerWithAuth
Fuseki-based triple store manager.
This class provides a concrete implementation of triple store management using Apache Fuseki. It stores ontologies as named graphs using their URIs as graph names, and supports dataset creation and cleanup.
The manager uses Fuseki's REST API for all operations, including: - Dataset creation and management - Named graph operations for ontologies - SPARQL queries for ontology discovery - Graph-level data operations
Attributes:
Name | Type | Description |
---|---|---|
dataset |
Optional[str]
|
The Fuseki dataset name to use for storage. |
clean |
Whether to clean the dataset on initialization. |
Source code in ontocast/tool/triple_manager/fuseki.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
|
__init__(uri=None, auth=None, dataset=None, clean=False, **kwargs)
¶
Initialize the Fuseki triple store manager.
This method sets up the connection to Fuseki, creates the dataset if it doesn't exist, and optionally cleans all data from the dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uri
|
Fuseki server URI (e.g., "http://localhost:3030"). |
None
|
|
auth
|
Authentication tuple (username, password) or string in "user/password" format. |
None
|
|
dataset
|
Dataset name to use for storage. |
None
|
|
clean
|
If True, delete all data from the dataset on initialization. |
False
|
|
**kwargs
|
Additional keyword arguments passed to the parent class. |
{}
|
Raises:
Type | Description |
---|---|
ValueError
|
If dataset is not specified in URI or as argument. |
Example
manager = FusekiTripleStoreManager( ... uri="http://localhost:3030", ... dataset="test", ... clean=True ... )
Source code in ontocast/tool/triple_manager/fuseki.py
fetch_ontologies()
¶
Fetch all ontologies from their corresponding named graphs.
This method discovers all ontologies in the Fuseki dataset and fetches each one from its corresponding named graph. It uses a two-step process:
- Discovery: Query for all ontology URIs using SPARQL
- Fetching: Retrieve each ontology from its named graph
The method handles both named graphs and the default graph, and verifies that each ontology is properly typed as owl:Ontology.
Returns:
Type | Description |
---|---|
list[Ontology]
|
list[Ontology]: List of all ontologies found in the dataset. |
Example
ontologies = manager.fetch_ontologies() for onto in ontologies: ... print(f"Found ontology: {onto.iri}")
Source code in ontocast/tool/triple_manager/fuseki.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|
init_dataset(dataset_name)
¶
Initialize a Fuseki dataset.
This method creates a new dataset in Fuseki if it doesn't already exist. It uses Fuseki's admin API to create the dataset with TDB2 storage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_name
|
Name of the dataset to create. |
required |
Note
This method will not fail if the dataset already exists.
Source code in ontocast/tool/triple_manager/fuseki.py
serialize_facts(g, **kwargs)
¶
Store facts (RDF graph) as a named graph in Fuseki.
This method stores the given RDF graph containing facts as a named graph in Fuseki. The graph name is taken from the chunk_uri parameter or defaults to "urn:chunk:default".
Parameters:
Name | Type | Description | Default |
---|---|---|---|
g
|
Graph
|
The RDF graph containing facts to store. |
required |
**kwargs
|
Additional keyword arguments. chunk_uri: URI to use as the named graph name (optional). |
{}
|
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the facts were successfully stored, False otherwise. |
Example
facts = RDFGraph() success = manager.serialize_facts(facts, chunk_uri="http://example.org/chunk1")
Source code in ontocast/tool/triple_manager/fuseki.py
serialize_ontology(o, **kwargs)
¶
Store an ontology as a named graph in Fuseki.
This method stores the given ontology as a named graph in Fuseki, using the ontology's IRI as the graph name. This ensures that each ontology is stored separately and can be retrieved individually.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
o
|
Ontology
|
The ontology to store. |
required |
**kwargs
|
Additional keyword arguments (not used). |
{}
|
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the ontology was successfully stored, False otherwise. |
Example
ontology = Ontology(iri="http://example.org/onto", graph=graph) success = manager.serialize_ontology(ontology)
Source code in ontocast/tool/triple_manager/fuseki.py
LLMTool
¶
Bases: Tool
Tool for interacting with language models.
This class provides a unified interface for working with different language model providers (OpenAI, Ollama) through LangChain. It supports both synchronous and asynchronous operations.
Attributes:
Name | Type | Description |
---|---|---|
provider |
str
|
The LLM provider to use (default: "openai"). |
model |
str
|
The specific model to use (default: "gpt-4o-mini"). |
api_key |
Optional[str]
|
Optional API key for the provider. |
base_url |
Optional[str]
|
Optional base URL for the provider. |
temperature |
float
|
Temperature parameter for generation (default: 0.1). |
Source code in ontocast/tool/llm.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
|
llm
property
¶
Get the underlying language model instance.
Returns:
Name | Type | Description |
---|---|---|
BaseChatModel |
BaseChatModel
|
The configured language model. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the LLM has not been properly initialized. |
__call__(*args, **kwds)
¶
Call the language model directly.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*args
|
Any
|
Positional arguments passed to the LLM. |
()
|
**kwds
|
Any
|
Keyword arguments passed to the LLM. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
Any |
Any
|
The LLM's response. |
Source code in ontocast/tool/llm.py
__init__(**kwargs)
¶
Initialize the LLM tool.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Additional keyword arguments passed to the parent class. |
{}
|
acreate(**kwargs)
async
classmethod
¶
Create a new LLM tool instance asynchronously.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Keyword arguments for initialization. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
LLMTool |
A new instance of the LLM tool. |
Source code in ontocast/tool/llm.py
complete(prompt, **kwargs)
async
¶
Generate a completion for the given prompt.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prompt
|
str
|
The input prompt for generation. |
required |
**kwargs
|
Additional keyword arguments for generation. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
Any |
Any
|
The generated completion. |
Source code in ontocast/tool/llm.py
create(**kwargs)
classmethod
¶
Create a new LLM tool instance synchronously.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Keyword arguments for initialization. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
LLMTool |
A new instance of the LLM tool. |
Source code in ontocast/tool/llm.py
extract(prompt, output_schema, **kwargs)
async
¶
Extract structured data from the prompt according to a schema.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prompt
|
str
|
The input prompt for extraction. |
required |
output_schema
|
Type[T]
|
The Pydantic model class defining the output structure. |
required |
**kwargs
|
Additional keyword arguments for extraction. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
T |
T
|
The extracted data conforming to the output schema. |
Source code in ontocast/tool/llm.py
setup()
async
¶
Set up the language model based on the configured provider.
Raises:
Type | Description |
---|---|
ValueError
|
If the provider is not supported. |
Source code in ontocast/tool/llm.py
Neo4jTripleStoreManager
¶
Bases: TripleStoreManagerWithAuth
Neo4j-based triple store manager using n10s (neosemantics) plugin.
This implementation handles RDF data more faithfully by using both the n10s property graph representation and raw RDF triple storage for accurate reconstruction. It provides comprehensive ontology management with namespace-based organization.
The manager uses Neo4j's n10s plugin for RDF operations, including: - RDF import and export via n10s - Ontology metadata storage and retrieval - Namespace-based ontology organization - Faithful RDF graph reconstruction
Attributes:
Name | Type | Description |
---|---|---|
clean |
bool
|
Whether to clean the database on initialization. |
_driver |
Private Neo4j driver instance. |
Source code in ontocast/tool/triple_manager/neo4j.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 |
|
__init__(uri=None, auth=None, clean=False, **kwargs)
¶
Initialize the Neo4j triple store manager.
This method sets up the connection to Neo4j, initializes the n10s plugin configuration, creates necessary constraints and indexes, and optionally cleans all data from the database.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uri
|
Neo4j connection URI (e.g., "bolt://localhost:7687"). |
None
|
|
auth
|
Authentication tuple (username, password) or string in "user/password" format. |
None
|
|
clean
|
If True, delete all nodes in the database on initialization. |
False
|
|
**kwargs
|
Additional keyword arguments passed to the parent class. |
{}
|
Raises:
Type | Description |
---|---|
ImportError
|
If the neo4j Python driver is not installed. |
Example
manager = Neo4jTripleStoreManager( ... uri="bolt://localhost:7687", ... auth="neo4j/password", ... clean=True ... )
Source code in ontocast/tool/triple_manager/neo4j.py
close()
¶
Close the Neo4j driver connection.
This method should be called when the manager is no longer needed to properly close the database connection and free resources.
Source code in ontocast/tool/triple_manager/neo4j.py
fetch_ontologies()
¶
Fetch ontologies from Neo4j with faithful RDF reconstruction.
This method retrieves all ontologies from Neo4j and reconstructs their RDF graphs faithfully. It uses a multi-step process:
- Identifies distinct ontologies by their namespace URIs
- Fetches all entities belonging to each ontology
- Reconstructs the RDF graph faithfully using stored triples when available
- Falls back to n10s property graph conversion when needed
Returns:
Type | Description |
---|---|
list[Ontology]
|
list[Ontology]: List of all ontologies found in the database. |
Example
ontologies = manager.fetch_ontologies() for onto in ontologies: ... print(f"Found ontology: {onto.iri}")
Source code in ontocast/tool/triple_manager/neo4j.py
serialize_facts(g, **kwargs)
¶
Serialize facts (RDF graph) to Neo4j.
This method stores the given RDF graph containing facts in Neo4j using the n10s plugin for RDF import.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
g
|
RDFGraph
|
The RDF graph containing facts to store. |
required |
**kwargs
|
Additional keyword arguments (not used). |
{}
|
Returns:
Name | Type | Description |
---|---|---|
Any |
The result summary from n10s import operation. |
Source code in ontocast/tool/triple_manager/neo4j.py
serialize_ontology(o, **kwargs)
¶
Serialize an ontology to Neo4j with both n10s and raw triple storage.
This method stores the given ontology in Neo4j using the n10s plugin for RDF import. The ontology is stored as RDF triples that can be faithfully reconstructed later.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
o
|
Ontology
|
The ontology to store. |
required |
**kwargs
|
Additional keyword arguments (not used). |
{}
|
Returns:
Name | Type | Description |
---|---|---|
Any |
The result summary from n10s import operation. |
Source code in ontocast/tool/triple_manager/neo4j.py
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(ontology_id=None, ontology_iri=None)
¶
Get an ontology by its short name or IRI.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ontology_id
|
str
|
The short name of the ontology to retrieve (optional). |
None
|
ontology_iri
|
str
|
The IRI of the ontology to retrieve (optional). |
None
|
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(ontology_id, ontology_addendum)
¶
Update an existing ontology with additional triples.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ontology_id
|
str
|
The short name of the ontology to update. |
required |
ontology_addendum
|
RDFGraph
|
The RDF graph containing additional triples to add. |
required |
Source code in ontocast/tool/ontology_manager.py
Tool
¶
Bases: BasePydanticModel
Base class for all OntoCast tools.
This class serves as the foundation for all tools in the OntoCast system. It provides common functionality and interface that all tools must implement. Tools should inherit from this class and implement their specific functionality.
Source code in ontocast/tool/onto.py
__init__(**kwargs)
¶
Initialize the tool.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Keyword arguments passed to the parent class. |
{}
|
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. All concrete triple store implementations should inherit from this class.
This is an abstract base class that must be implemented by specific triple store backends (e.g., Neo4j, Fuseki, Filesystem).
Source code in ontocast/tool/triple_manager/core.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 from the triple store.
This method should retrieve all ontologies stored in the triple store and return them as Ontology objects with their associated RDF graphs.
Returns:
Type | Description |
---|---|
list[Ontology]
|
list[Ontology]: List of available ontologies with their graphs. |
Source code in ontocast/tool/triple_manager/core.py
serialize_facts(g, **kwargs)
abstractmethod
¶
Store a graph with facts in the triple store.
This method should store the given RDF graph containing facts in the triple store. The implementation may choose how to organize the storage (e.g., as named graphs, in specific collections, etc.).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
g
|
Graph
|
The RDF graph containing facts to store. |
required |
**kwargs
|
Additional keyword arguments for serialization. |
{}
|
Source code in ontocast/tool/triple_manager/core.py
serialize_ontology(o, **kwargs)
abstractmethod
¶
Store an ontology in the triple store.
This method should store the given ontology and its associated RDF graph in the triple store. The implementation may choose how to organize the storage (e.g., as named graphs, in specific collections, etc.).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
o
|
Ontology
|
The ontology to store. |
required |
**kwargs
|
Additional keyword arguments for serialization. |
{}
|