Summary
When querying Working Memory with view: \"working-memory\", the dkg_query tool only returns triples from assertions in the context graph root, excluding any assertions stored in named sub-graphs.
Observed Behavior
- Query without sub-graph scoping returns 10 entities (root level only).
- Same context graph with
epcis-demo sub-graph contains 13 additional entities.
- Total: 23 entities, but
view: \"working-memory\" only surfaces 10.
Expected Behavior
When querying view: \"working-memory\" for a context graph, the results should include all assertions in that CG, regardless of whether they're in the root or in a named sub-graph.
Workaround
Use explicit GRAPH ?g { ... } filtering in the SPARQL query to target sub-graphs by URI pattern — but this requires knowing the sub-graph naming scheme and is not discoverable.
Steps to Reproduce
- Create a context graph with a sub-graph.
- Write assertions to the sub-graph.
- Query WM with
dkg_query view: \"working-memory\".
- Observe that sub-graph entities are missing from results.
Related
- Plan item S3 (Subgraph Explorer) UI work explicitly relies on sub-graph data being reachable via the same query path as root WM — this gap blocks the UI from rendering a coherent cross-layer sub-graph view.
- The Node UI
wmSparql in packages/node-ui/src/ui/hooks/useMemoryEntities.ts:171 uses STRSTARTS(STR(?g), \"${cgUri}/\") && CONTAINS(STR(?g), \"/assertion/\") — it correctly includes sub-graph assertions. The dkg_query tool's view: \"working-memory\" SPARQL likely uses a tighter filter (root-only).
Summary
When querying Working Memory with
view: \"working-memory\", thedkg_querytool only returns triples from assertions in the context graph root, excluding any assertions stored in named sub-graphs.Observed Behavior
epcis-demosub-graph contains 13 additional entities.view: \"working-memory\"only surfaces 10.Expected Behavior
When querying
view: \"working-memory\"for a context graph, the results should include all assertions in that CG, regardless of whether they're in the root or in a named sub-graph.Workaround
Use explicit
GRAPH ?g { ... }filtering in the SPARQL query to target sub-graphs by URI pattern — but this requires knowing the sub-graph naming scheme and is not discoverable.Steps to Reproduce
dkg_query view: \"working-memory\".Related
wmSparqlinpackages/node-ui/src/ui/hooks/useMemoryEntities.ts:171usesSTRSTARTS(STR(?g), \"${cgUri}/\") && CONTAINS(STR(?g), \"/assertion/\")— it correctly includes sub-graph assertions. Thedkg_querytool'sview: \"working-memory\"SPARQL likely uses a tighter filter (root-only).