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
//! RDF metadata management for templates using Oxigraph
//!
//! This module provides comprehensive RDF support for template metadata, including
//! schema definitions, SHACL validation, SPARQL querying, and template relationship
//! management. It enables semantic understanding of templates and their dependencies.
//!
//! ## Features
//!
//! - **Ggen Ontology**: Type-safe ontology builder with namespace constants
//! - **Template Metadata**: Extract, store, and query template metadata from RDF
//! - **SHACL Validation**: Validate template structure and relationships
//! - **Template Relationships**: Track dependencies, variants, and compositions
//! - **Variable Extraction**: Extract template variables from RDF annotations
//!
//! ## Architecture
//!
//! The module uses Oxigraph as the RDF store and provides:
//! - Schema definitions (`schema.rs`) - Ggen ontology and namespace constants
//! - Metadata management (`template_metadata.rs`) - Store and query template metadata
//! - Validation (`validation.rs`) - SHACL-based validation rules
//!
//! ## Examples
//!
//! ### Using the Ggen Ontology
//!
//! ```rust
//! use crate::rdf::schema::GgenOntology;
//!
//! let template_uri = GgenOntology::template();
//! assert!(template_uri.contains("Template"));
//! ```
//!
//! ### Storing Template Metadata
//!
//! ```rust,no_run
//! use crate::rdf::template_metadata::{TemplateMetadataStore, TemplateMetadata};
//!
//! # fn main() -> crate::utils::error::Result<()> {
//! let store = TemplateMetadataStore::new()?;
//!
//! let metadata = TemplateMetadata::new(
//! "template://example/rust-cli".to_string(),
//! "Rust CLI Template".to_string(),
//! );
//! store.store_metadata(&metadata)?;
//! # Ok(())
//! # }
//! ```
//!
//! ### Validating Template Metadata
//!
//! ```rust,no_run
//! use crate::rdf::validation::Validator;
//! use crate::rdf::template_metadata::TemplateMetadata;
//!
//! # fn main() -> crate::utils::error::Result<()> {
//! let validator = Validator::new();
//! let metadata = TemplateMetadata::new(
//! "template://example/rust-cli".to_string(),
//! "Rust CLI Template".to_string(),
//! );
//!
//! let result = validator.validate(&metadata)?;
//! if result.is_valid() {
//! println!("Template metadata is valid");
//! }
//! # Ok(())
//! # }
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;