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

Function defined_terms

atomic-canonical/src/context.rs:20–26  ·  view source on GitHub ↗

The set of term keys defined by the context (terms + namespace prefixes). Parsed from the embedded document.

()

Source from the content-addressed store, hash-verified

18/// The set of term keys defined by the context (terms + namespace prefixes).
19/// Parsed from the embedded document.
20pub fn defined_terms() -> BTreeSet<String> {
21 let doc: Value = serde_json::from_str(CONTEXT_JSONLD).expect("ctx.jsonld is valid JSON");
22 doc.get("@context")
23 .and_then(Value::as_object)
24 .map(|m| m.keys().cloned().collect())
25 .unwrap_or_default()
26}
27
28/// Collect every object key appearing anywhere in `value`.
29pub fn collect_keys(value: &Value, out: &mut BTreeSet<String>) {

Callers 1

undefined_termsFunction · 0.85

Calls 2

getMethod · 0.65
collectMethod · 0.45

Tested by

no test coverage detected