Skip to content

feat: GraphQL + SPARQL trace enrichment adapter#2

Open
HexaField wants to merge 1 commit into
mainfrom
feat/sparql-1.2-cleanup
Open

feat: GraphQL + SPARQL trace enrichment adapter#2
HexaField wants to merge 1 commit into
mainfrom
feat/sparql-1.2-cleanup

Conversation

@HexaField
Copy link
Copy Markdown
Contributor

Summary

Adds the bridge adapter for the feat/sparql-1.2-cleanup branch of coasys/ad4m.

Transport: GraphQL/Apollo + SPARQL Detection

  • Same Apollo link chain interception as main (both branches use GraphQL)
  • Additionally auto-detects SPARQL query patterns in:
    • Request variables (fields named query, sparql, sparqlQuery)
    • Response data (nested sparqlResult, bindings, results structures)
  • Enriches OperationRecord with sparqlQuery and sparqlResult fields
  • The extension panel's existing SPARQL display renders these automatically

Integration

In Ad4mClient constructor (Apollo-based, same as dev):

import { initDevToolsBridge } from '@ad4m-devtools/bridge';
// After constructing ApolloClient:
initDevToolsBridge(this);

Builds

  • packages/bridge: ✅ tsc clean
  • packages/extension: ✅ vite build clean

Target

Works with coasys/ad4m#feat/sparql-1.2-cleanup

Note

Once both AD4M feature branches merge to dev, these two PRs should be merged into main and the adapters unified into a single multi-transport bridge.

- GraphQL/Apollo adapter enhanced with SPARQL detection
- Scans operation variables for SPARQL query patterns
- Scans response data for SPARQL content
- Auto-logs SPARQL traces when detected in GraphQL operations
- Supports SELECT, CONSTRUCT, ASK, DESCRIBE, INSERT, DELETE
- Compatible with coasys/ad4m feat/sparql-1.2-cleanup branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant