MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / link

Method link

atomic-repository/src/repository/vault_projection.rs:239–263  ·  view source on GitHub ↗
(&self, graph: &mut KgSubgraph, subject: &str, raw: &str, predicate: P, path: &str)

Source from the content-addressed store, hash-verified

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,

Callers 2

extractMethod · 0.80

Calls 4

findingMethod · 0.80
resolveMethod · 0.45
pushMethod · 0.45
with_metadataMethod · 0.45

Tested by

no test coverage detected