(&self, graph: &mut KgSubgraph, subject: &str, raw: &str, predicate: P, path: &str)
| 237 | } |
| 238 | |
| 239 | fn link(&self, graph: &mut KgSubgraph, subject: &str, raw: &str, predicate: P, path: &str) { |
| 240 | if let Some((target, class)) = self.resolve(raw) { |
| 241 | // The referring entry owns the edge, never the target's metadata. |
| 242 | // In particular, a child type does not imply local ownership. |
| 243 | graph |
| 244 | .nodes |
| 245 | .push(KgNode::new(&target, class, raw, "vault_reference")); |
| 246 | graph.edges.push( |
| 247 | KgEdge::new(subject, target, predicate) |
| 248 | .with_metadata(serde_json::json!({"rdf_target": raw})), |
| 249 | ); |
| 250 | } else { |
| 251 | self.finding( |
| 252 | graph, |
| 253 | subject, |
| 254 | if raw.starts_with("urn:atomic:todo:") { |
| 255 | "UnresolvedLegacyTodo" |
| 256 | } else { |
| 257 | "UnresolvedReference" |
| 258 | }, |
| 259 | &format!("Unresolved reference: {raw}"), |
| 260 | path, |
| 261 | ); |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | pub(super) fn extract( |
| 266 | &self, |
no test coverage detected