{"record":{"id":"7f4481264a161db9","repo":"run-llama/llama_index","slug":"structured-query-not-implemented-for-simplepropert","errorCode":null,"errorMessage":"Structured query not implemented for SimplePropertyGraphStore.","messagePattern":"Structured query 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":243,"sourceCode":"        return cls(graph)\n\n    def to_dict(self) -> dict:\n        \"\"\"Convert to dict.\"\"\"\n        return self.graph.model_dump()\n\n    # NOTE: Unimplemented methods for SimplePropertyGraphStore\n\n    def get_schema(self, refresh: bool = False) -> str:\n        \"\"\"Get the schema of the graph store.\"\"\"\n        raise NotImplementedError(\n            \"Schema not implemented for SimplePropertyGraphStore.\"\n        )\n\n    def structured_query(\n        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","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/graph_stores/simple_labelled.py#L225-L261","documentation":"SimplePropertyGraphStore.structured_query() unconditionally raises NotImplementedError. The store keeps plain in-memory node/edge dicts and deliberately omits any query-language engine; the sibling methods get_schema() and vector_query() are stubbed the same way, so only the direct node/edge accessor APIs are usable.","triggerScenarios":"Calling structured_query('MATCH (n:Entity) RETURN n') or any Cypher-like statement on a SimplePropertyGraphStore — e.g. a PropertyGraphIndex retriever configured for structured retrieval, or LLM-generated query strings routed to the default store.","commonSituations":"Building a graph RAG prototype with the default store and later enabling Cypher-based custom retrievers; migrating from Neo4j-backed development to the in-memory store for tests; agent tooling that assumes every store can execute queries.","solutions":["Move to a query-capable property graph store (Neo4j, Kuzu, Neptune, etc.) when structured queries are required.","With SimplePropertyGraphStore, fetch data via its supported accessors (get, get_triplets, node/edge lookups) and filter in Python.","Feature-detect with a NotImplementedError guard in any generic query layer so the store can be swapped safely."],"exampleFix":"# before\nrows = store.structured_query(\"MATCH (n) RETURN n\", param_map={})\n\n# after\ntry:\n    rows = store.structured_query(query)\nexcept NotImplementedError:\n    nodes = [store.graph.nodes[k] for k in store.graph.nodes]  # direct access","handlingStrategy":"fallback","validationCode":"from llama_index.core.graph_stores.simple_labelled import SimplePropertyGraphStore\n\nif isinstance(store, SimplePropertyGraphStore):\n    nodes = list(store.graph.nodes.values())  # direct in-memory access\nelse:\n    rows = store.structured_query(cypher, param_map=params)","typeGuard":"def supports_structured_query(store) -> bool:\n    return not isinstance(store, SimplePropertyGraphStore)","tryCatchPattern":"try:\n    rows = store.structured_query(query, param_map=params)\nexcept NotImplementedError:\n    rows = list(store.graph.nodes.values())  # degrade to direct access","preventionTips":["Do not enable Cypher-based retrievers on the in-memory property graph store.","Access nodes/edges via supported accessors when prototyping.","Guard generic query layers with NotImplementedError handling so backends stay swappable."],"tags":["not-implemented","property-graph","query-language","unsupported-operation"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}