JSON (Graph Transport)
Knowledge GraphsJSON (Graph Transport) as a transport layer for knowledge graphs is a pattern that enables transferring graph structure between different tools in the semantic audit pipeline — between Python, Neo4j, and LLMs. Instead of working with native graph formats, you convert graph data into JSON format consisting of a nodes list and an edges list with labels. This JSON becomes the universal exchange format. LLMs understand JSON natively, while Python can parse it using the json library. Neo4j imports it via APOC or MERGE scripts.
This approach solves interoperability challenges across the semantic audit pipeline by providing a common data structure that all tools can process. The typical structure includes separate arrays for nodes and edges with labels. For example: {nodes: [{id: 'cortisol', type: 'entity'}, {id: 'morning_level', type: 'attribute'}], edges: [{source: 'cortisol', target: 'morning_level', label: 'HAS_ATTRIBUTE'}]}.
Best practice involves defining a consistent JSON schema upfront, as changing the format mid-pipeline requires rewriting all processing steps.