1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
//! Comprehensive Oxigraph wrapper with full Store API coverage
//!
//! This module provides a complete, type-safe wrapper around Oxigraph's RDF store
//! with intelligent caching, thread-safety, and comprehensive feature coverage.
//!
//! ## Oxigraph 0.5 Best Practices
//!
//! **Error Handling Pattern**: Always use explicit `.map_err()` for oxigraph error conversion
//! instead of the `?` operator, because oxigraph errors don't implement `From` for
//! `crate::utils::error::Error`. This pattern ensures proper error context and prevents
//! compilation errors.
//!
//! ```rust,no_run
//! // ✅ Correct: Explicit error conversion
//! store.load_from_reader(format, reader)
//! .map_err(|e| Error::new(&format!("Failed to load RDF: {}", e)))?;
//!
//! // ❌ Incorrect: ? operator (won't compile)
//! store.load_from_reader(format, reader)?;
//! ```
//!
//! **RdfSerializer Pattern**: Use `RdfSerializer::from_format().for_writer()` pattern for
//! serialization, then iterate over quads and call `serialize_quad()`, finally call `finish()`.
//!
//! **Resource Management**: Store instances are managed via `Arc` for thread-safe sharing.
//! Temporary stores are used when necessary (e.g., loading into named graphs).
//!
//! ## Module Structure
//!
//! - [`Graph`] - Main wrapper with SPARQL query caching and epoch-based invalidation
//! - [`GraphStore`] - Storage operations (persistent storage, file I/O)
//! - [`GraphUpdate`] - SPARQL Update operations (INSERT, DELETE, UPDATE, etc.)
//! - [`GraphQuery`] - Advanced query building and execution
//! - [`GraphExport`] - RDF serialization in all formats using Oxigraph's RdfSerializer API
//!
//! ## Features
//!
//! - **Full Oxigraph API Coverage**: All Store methods wrapped
//! - **SPARQL 1.1**: Query and Update support
//! - **Named Graphs**: Full support for RDF datasets
//! - **Thread-Safe**: Cheap cloning via Arc for concurrent access
//! - **Query Caching**: LRU cache with epoch-based invalidation
//! - **Multiple RDF Formats**: Turtle, N-Triples, RDF/XML, TriG, N-Quads
//! - **Persistent Storage**: On-disk database support
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use crate::graph::{Graph, GraphUpdate, GraphExport};
//!
//! # fn main() -> crate::utils::error::Result<()> {
//! // Create in-memory graph
//! let graph = Graph::new()?;
//!
//! // Load RDF data
//! graph.insert_turtle(r#"
//! @prefix ex: <http://example.org/> .
//! ex:alice a ex:Person .
//! "#)?;
//!
//! // Query
//! let results = graph.query("SELECT ?s WHERE { ?s ?p ?o }")?;
//!
//! // Update
//! let update = GraphUpdate::new(&graph);
//! update.insert("INSERT DATA { ex:bob a ex:Person }")?;
//!
//! // Export
//! let export = GraphExport::new(&graph);
//! export.write_to_file("output.ttl", oxigraph::io::RdfFormat::Turtle)?;
//! # Ok(())
//! # }
//! ```
// #[cfg(test)]
// mod core_fs_tests; // Requires chicago_tdd_tools::testcontainers
// #[cfg(test)]
// mod export_tests; // Requires chicago_tdd_tools::testcontainers
// #[cfg(test)]
// mod store_tests; // Requires chicago_tdd_tools::testcontainers
// Re-export main types
pub use ConstructExecutor;
pub use ;
pub use ;
pub use ;
pub use GraphExport;
pub use GraphQuery;
pub use GraphStore;
pub use CachedResult;
pub use GraphUpdate;