org.llm4s.knowledgegraph.storage
Members list
Type members
Classlikes
Represents a pair of an edge with its target node during traversal.
Represents a pair of an edge with its target node during traversal.
Value parameters
- edge
-
The edge traversed
- node
-
The target node
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Filter criteria for graph queries.
Filter criteria for graph queries.
Value parameters
- nodeLabel
-
Optional filter by node label
- propertyKey
-
Optional property name to filter by
- propertyValue
-
Optional property value to filter by (compared as string)
- relationshipType
-
Optional filter by relationship type
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Statistics about a graph.
Statistics about a graph.
Value parameters
- averageDegree
-
Average number of connections per node
- densestNodeId
-
Node with the most connections (if any)
- edgeCount
-
Total number of edges
- nodeCount
-
Total number of nodes
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Abstract interface for persisting and querying Knowledge Graphs.
Abstract interface for persisting and querying Knowledge Graphs.
All implementations must:
- Return consistent results for the same operations
- Use BFS-based traversal by default for consistent result ordering
- Return Left(Error) consistently for missing nodes/edges
- Support property filtering uniformly or document limitations
- Be thread-safe or explicitly document thread-safety guarantees
This trait is designed to be engine-agnostic, allowing implementations for various graph databases (Neo4j, TinkerPop, SPARQL, etc.) while maintaining a consistent interface.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class InMemoryGraphStoreclass JsonGraphStore
In-memory implementation of GraphStore using atomic references for thread-safe updates.
In-memory implementation of GraphStore using atomic references for thread-safe updates.
Thread-safety: This implementation is thread-safe via CAS (Compare-And-Swap) atomic operations. All mutations use linearizable atomic updates to ensure consistency under concurrent access.
Performance: Optimal for testing and small to medium graphs (<100k nodes). Not suitable for graphs requiring persistence.
Value parameters
- initialGraph
-
Optional initial graph state (defaults to empty)
Attributes
- Supertypes
JSON-based implementation of GraphStore.
JSON-based implementation of GraphStore.
Thread-safety note: This implementation is NOT thread-safe. For concurrent access, wrap with synchronization or use a thread-safe alternative.
Value parameters
- path
-
The file path to save/load the graph
Attributes
- Supertypes
Configuration for graph traversal operations.
Configuration for graph traversal operations.
Value parameters
- direction
-
Direction of traversal (Outgoing, Incoming, Both). Controls whether traversal follows outgoing, incoming, or all edges from each node.
- maxDepth
-
Maximum number of hops/edges to traverse from the start node (inclusive)
- visitedNodeIds
-
Optional set of already-visited nodes to exclude
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all