(path: &ShapePath)
| 116 | } |
| 117 | |
| 118 | fn path_json(path: &ShapePath) -> Value { |
| 119 | match path { |
| 120 | ShapePath::Predicate(iri) => json!({"predicate": iri.as_str()}), |
| 121 | ShapePath::Inverse(path) => json!({"inverse": path_json(path)}), |
| 122 | ShapePath::Sequence(paths) => { |
| 123 | json!({"sequence": paths.iter().map(path_json).collect::<Vec<_>>()}) |
| 124 | } |
| 125 | ShapePath::Alternative(paths) => { |
| 126 | json!({"alternative": paths.iter().map(path_json).collect::<Vec<_>>()}) |
| 127 | } |
| 128 | ShapePath::ZeroOrMore(path) => json!({"zero_or_more": path_json(path)}), |
| 129 | ShapePath::OneOrMore(path) => json!({"one_or_more": path_json(path)}), |
| 130 | ShapePath::ZeroOrOne(path) => json!({"zero_or_one": path_json(path)}), |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | fn result_json(result: &ValidationResult) -> Value { |
| 135 | json!({ |
nothing calls this directly
no outgoing calls
no test coverage detected