Loading config/ontology/schema.yaml +1 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ settings: - name: ImportedSymbol exclude_properties: [traversal_path, commit_sha] edge_table: name: gl_edge columns: - {name: source_id, type: int64} - {name: source_kind, type: string} Loading config/schemas/ontology.schema.json +5 −1 Original line number Diff line number Diff line Loading @@ -399,8 +399,12 @@ "edge_table": { "type": "object", "description": "Edge table schema for the local DuckDB graph.", "required": ["columns"], "required": ["name", "columns"], "properties": { "name": { "type": "string", "description": "Table name for the local edge table." }, "columns": { "type": "array", "items": { Loading crates/ontology/src/lib.rs +11 −1 Original line number Diff line number Diff line Loading @@ -111,6 +111,8 @@ pub struct Ontology { /// Local entity configs keyed by entity name. Each entry lists /// properties to exclude from the local DuckDB table. pub(crate) local_entities: BTreeMap<String, Vec<String>>, /// Local edge table name, if declared. pub(crate) local_edge_table_name: Option<String>, /// Local edge table columns, if declared. pub(crate) local_edge_columns: Vec<EdgeColumn>, } Loading Loading @@ -158,6 +160,7 @@ impl Ontology { internal_column_prefix: "_gkg_".to_string(), skip_security_filter_for_tables: Vec::new(), local_entities: BTreeMap::new(), local_edge_table_name: None, local_edge_columns: Vec::new(), } } Loading Loading @@ -590,6 +593,12 @@ impl Ontology { ) } /// Name of the local edge table, if declared. #[must_use] pub fn local_edge_table_name(&self) -> Option<&str> { self.local_edge_table_name.as_deref() } /// Column definitions for the local edge table, if declared. #[must_use] pub fn local_edge_columns(&self) -> &[EdgeColumn] { Loading Loading @@ -1820,8 +1829,9 @@ properties: } #[test] fn local_edge_columns_loaded_from_ontology() { fn local_edge_table_loaded_from_ontology() { let ontology = Ontology::load_from_dir(fixtures_dir()).expect("should load ontology"); assert_eq!(ontology.local_edge_table_name(), Some("gl_edge")); let cols = ontology.local_edge_columns(); assert!(!cols.is_empty()); let names: Vec<&str> = cols.iter().map(|c| c.name.as_str()).collect(); Loading crates/ontology/src/loading/mod.rs +1 −0 Original line number Diff line number Diff line Loading @@ -300,6 +300,7 @@ pub(crate) fn load_with(reader: &impl ReadOntologyFile) -> Result<Ontology, Onto } } ontology.local_edge_table_name = Some(edge_table.name); ontology.local_edge_columns = edge_table .columns .into_iter() Loading crates/ontology/src/loading/schema.rs +1 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ pub(super) struct LocalSettingsYaml { #[derive(Debug, Deserialize)] pub(super) struct LocalEdgeTableYaml { pub name: String, pub columns: Vec<EdgeColumnYaml>, } Loading Loading
config/ontology/schema.yaml +1 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ settings: - name: ImportedSymbol exclude_properties: [traversal_path, commit_sha] edge_table: name: gl_edge columns: - {name: source_id, type: int64} - {name: source_kind, type: string} Loading
config/schemas/ontology.schema.json +5 −1 Original line number Diff line number Diff line Loading @@ -399,8 +399,12 @@ "edge_table": { "type": "object", "description": "Edge table schema for the local DuckDB graph.", "required": ["columns"], "required": ["name", "columns"], "properties": { "name": { "type": "string", "description": "Table name for the local edge table." }, "columns": { "type": "array", "items": { Loading
crates/ontology/src/lib.rs +11 −1 Original line number Diff line number Diff line Loading @@ -111,6 +111,8 @@ pub struct Ontology { /// Local entity configs keyed by entity name. Each entry lists /// properties to exclude from the local DuckDB table. pub(crate) local_entities: BTreeMap<String, Vec<String>>, /// Local edge table name, if declared. pub(crate) local_edge_table_name: Option<String>, /// Local edge table columns, if declared. pub(crate) local_edge_columns: Vec<EdgeColumn>, } Loading Loading @@ -158,6 +160,7 @@ impl Ontology { internal_column_prefix: "_gkg_".to_string(), skip_security_filter_for_tables: Vec::new(), local_entities: BTreeMap::new(), local_edge_table_name: None, local_edge_columns: Vec::new(), } } Loading Loading @@ -590,6 +593,12 @@ impl Ontology { ) } /// Name of the local edge table, if declared. #[must_use] pub fn local_edge_table_name(&self) -> Option<&str> { self.local_edge_table_name.as_deref() } /// Column definitions for the local edge table, if declared. #[must_use] pub fn local_edge_columns(&self) -> &[EdgeColumn] { Loading Loading @@ -1820,8 +1829,9 @@ properties: } #[test] fn local_edge_columns_loaded_from_ontology() { fn local_edge_table_loaded_from_ontology() { let ontology = Ontology::load_from_dir(fixtures_dir()).expect("should load ontology"); assert_eq!(ontology.local_edge_table_name(), Some("gl_edge")); let cols = ontology.local_edge_columns(); assert!(!cols.is_empty()); let names: Vec<&str> = cols.iter().map(|c| c.name.as_str()).collect(); Loading
crates/ontology/src/loading/mod.rs +1 −0 Original line number Diff line number Diff line Loading @@ -300,6 +300,7 @@ pub(crate) fn load_with(reader: &impl ReadOntologyFile) -> Result<Ontology, Onto } } ontology.local_edge_table_name = Some(edge_table.name); ontology.local_edge_columns = edge_table .columns .into_iter() Loading
crates/ontology/src/loading/schema.rs +1 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ pub(super) struct LocalSettingsYaml { #[derive(Debug, Deserialize)] pub(super) struct LocalEdgeTableYaml { pub name: String, pub columns: Vec<EdgeColumnYaml>, } Loading