{"record":{"id":"53c227a3d595684e","repo":"run-llama/llama_index","slug":"client-not-implemented-for-simplepropertygraphstor","errorCode":null,"errorMessage":"Client not implemented for SimplePropertyGraphStore.","messagePattern":"Client not implemented for SimplePropertyGraphStore\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/graph_stores/simple_labelled.py","lineNumber":258,"sourceCode":"        self, query: str, param_map: Optional[Dict[str, Any]] = None\n    ) -> Any:\n        \"\"\"Query the graph store with statement and parameters.\"\"\"\n        raise NotImplementedError(\n            \"Structured query not implemented for SimplePropertyGraphStore.\"\n        )\n\n    def vector_query(\n        self, query: VectorStoreQuery, **kwargs: Any\n    ) -> Tuple[List[LabelledNode], List[float]]:\n        \"\"\"Query the graph store with a vector store query.\"\"\"\n        raise NotImplementedError(\n            \"Vector query not implemented for SimplePropertyGraphStore.\"\n        )\n\n    @property\n    def client(self) -> Any:\n        \"\"\"Get client.\"\"\"\n        raise NotImplementedError(\n            \"Client not implemented for SimplePropertyGraphStore.\"\n        )\n\n    def save_networkx_graph(self, name: str = \"kg.html\") -> None:\n        \"\"\"Display the graph store, useful for debugging.\"\"\"\n        import networkx as nx\n\n        G = nx.DiGraph()\n        for node in self.graph.nodes.values():\n            G.add_node(node.id, label=node.id)\n        for triplet in self.graph.triplets:\n            G.add_edge(triplet[0], triplet[2], label=triplet[1])\n\n        # save to html file\n        from pyvis.network import Network\n\n        net = Network(notebook=False, directed=True)\n        net.from_nx(G)","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/graph_stores/simple_labelled.py#L240-L276","documentation":"The client property on SimplePropertyGraphStore is declared to satisfy the PropertyGraphStore interface but raises NotImplementedError because an in-memory dict-based store has no database client to expose. Accessing .client raises immediately rather than returning None, so introspection code that touches store.client fails loudly.","triggerScenarios":"Accessing simple_store.client; generic diagnostics or admin tooling that iterates graph stores and reads .client; attempting to pass the store's client to another library (e.g. running raw Cypher via the underlying driver).","commonSituations":"Porting code written against Neo4jPropertyGraphStore (where .client is a Neo4j Driver) to the default simple store; notebook inspection of the store object; feature-detection code that assumes client is always present.","solutions":["Use a real backend store (Neo4j, Kuzu, FalkorDB) if you need the underlying database client.","Guard access with hasattr/try-except if you only want a client when one exists.","Use the store's public Python API (get, get_triplets, etc.) instead of reaching through .client.","If you just need to run raw queries, note that structured_query is also unimplemented on this store — the simple store is data-only."],"exampleFix":"# before\nclient = index.property_graph_store.client  # NotImplementedError\n\n# after\nstore = index.property_graph_store\nclient = getattr(store, \"client\", None) if type(store).__name__ != \"SimplePropertyGraphStore\" else None","handlingStrategy":"type-guard","validationCode":"has_client = hasattr(type(store), 'client') and not getattr(type(store).client, '_is_not_implemented', False)\n# simplest: check concrete type\nfrom llama_index.core.graph_stores import SimplePropertyGraphStore\nhas_client = not isinstance(store, SimplePropertyGraphStore)","typeGuard":"def has_backend_client(store) -> bool:\n    try:\n        store.client\n        return True\n    except NotImplementedError:\n        return False","tryCatchPattern":"try:\n    client = store.client\nexcept NotImplementedError:\n    client = None  # in-memory store; use Python API instead","preventionTips":["Treat .client as optional on PropertyGraphStore implementations.","Prefer the store's abstract API (get/get_triplets) over reaching into backend clients."],"tags":["graph-store","client","not-implemented","property-graph"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}