Skip to content

dkg_query view: "working-memory" does not include data from sub-graphs #675

@Jurij89

Description

@Jurij89

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

  1. Create a context graph with a sub-graph.
  2. Write assertions to the sub-graph.
  3. Query WM with dkg_query view: \"working-memory\".
  4. 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpre-mainnetMust land before mainnet launchpriority:highMust-fix: protocol correctness, security, economics, or headline flow broken

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions