Class Neo4jGraphStore

java.lang.Object
com.tnsai.intelligence.rag.graph.Neo4jGraphStore
All Implemented Interfaces:
GraphStore

public final class Neo4jGraphStore extends Object implements GraphStore
GraphStore over a Neo4j property graph.

The driver is never imported here: Neo4jGraphStore.CypherSession is the only I/O seam so tnsai-intelligence can compile and run without Neo4j on the classpath. Production code uses the reflective session in Neo4jGraphStoreProvider.

Since:
0.14.0
  • Constructor Details

    • Neo4jGraphStore

      public Neo4jGraphStore(Neo4jGraphStore.CypherSession session, String defaultSource)
      Parameters:
      session - Cypher execution seam
      defaultSource - source stamp when a node omits source
  • Method Details

    • findSeeds

      public List<GraphStore.Seed> findSeeds(String query, int limit)
      Description copied from interface: GraphStore
      Finds graph nodes that can seed traversal for a query.
      Specified by:
      findSeeds in interface GraphStore
      Parameters:
      query - query text, never null
      limit - maximum number of seeds requested
      Returns:
      seeds, never null
    • neighbors

      public List<GraphStore.Neighbor> neighbors(String nodeId)
      Description copied from interface: GraphStore
      Returns the outgoing edges and destination nodes for a node.
      Specified by:
      neighbors in interface GraphStore
      Parameters:
      nodeId - expanded node identifier
      Returns:
      neighbors, never null
    • ingest

      public void ingest(List<FileGraphCorpus.Document> documents)
      Writes FILE-extracted entities and relations through the Cypher seam.
      Parameters:
      documents - ingested FILE chunks