Skip to main content

Module resolver

Module resolver 

Source
Expand description

Project conventions resolver

This module provides functionality for discovering and resolving project conventions from the file system. It automatically detects RDF files, templates, SPARQL queries, and output directories based on common patterns, with support for custom overrides via .ggen/conventions.toml.

§Features

  • Automatic Discovery: Find RDF files, templates, and queries in standard locations
  • Convention Presets: Support for presets like “clap-noun-verb” and “default”
  • Custom Overrides: Override patterns via configuration file
  • File Watching: Track directories for changes (for watch mode)

§Convention Structure

Conventions define:

  • RDF file patterns (e.g., domain/**/*.ttl)
  • Template patterns (e.g., templates/**/*.tmpl)
  • Query patterns (e.g., queries/**/*.rq)
  • Output directory location

§Examples

§Resolving Conventions

use ggen_cli_lib::conventions::resolver::ConventionResolver;

let conventions = ConventionResolver::new(".").discover()?;
println!("Found {} RDF files", conventions.rdf_files.len());
println!("Found {} templates", conventions.templates.len());

Structs§

ConventionResolver
Convention resolver that discovers project structure
ProjectConventions
Project conventions discovered from the file system