Commit 921e067
Recognise top-level JSON-LD in Operation.process_json
A dict carrying any JSON-LD reserved key (@context, @graph, @id,
@type) is now parsed to an rdflib.Graph by Operation.process_json
itself, ahead of the existing generic-dict recursion. Previously
every consuming op (POST, PUT, Merge, ldh-Create*/Add*) re-parsed
the same JSON-LD payload in its own execute_json — the runtime
treated bare JSON-LD as opaque JSON to recurse into, only the ops
at the boundary knew its semantics.
Symmetric with the bare-value auto-wrap (json_to_rdflib): a JSON
scalar becomes a Literal, a JSON-LD object becomes a Graph.
Unblocks the chat-extraction case: an LLM that emits JSON-LD as
its final answer (image metadata, structured extraction) gets a
real Graph result the renderer can lay out, rather than a dict of
Literals that renders as raw text.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 7e79866 commit 921e067
1 file changed
Lines changed: 26 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
12 | 20 | | |
13 | 21 | | |
14 | 22 | | |
| |||
91 | 99 | | |
92 | 100 | | |
93 | 101 | | |
94 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
95 | 120 | | |
96 | 121 | | |
97 | 122 | | |
| |||
0 commit comments