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

Function result_json

atomic-shacl/src/lib.rs:134–146  ·  view source on GitHub ↗
(result: &ValidationResult)

Source from the content-addressed store, hash-verified

132}
133
134fn result_json(result: &ValidationResult) -> Value {
135 json!({
136 "focus_node": term_value(&result.focus_node),
137 "result_path": result.result_path.as_ref().map(term_value),
138 "path_structure": result.path_structure.as_ref().map(path_json),
139 "source_shape": term_value(&result.source_shape),
140 "source_constraint_component": result.source_constraint_component.as_str(),
141 "result_severity": result.severity.iri(),
142 "result_messages": result.messages.iter().map(|message| json!({"value": message.value(), "rdf_literal": Term::Literal(message.clone()).to_string()})).collect::<Vec<_>>(),
143 "value": result.value.as_ref().map(term_value),
144 "details": result.details.iter().map(result_json).collect::<Vec<_>>(),
145 })
146}
147
148/// One parsed snapshot and one parsed shapes/import closure are reused for
149/// target coverage and validation. Focus selection is performed by PurRDF;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected