[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-84628-en":3,"doc-seo-84628-105":29,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":13,"seo_description":14,"update_tm":27,"read_time":28},84628,1649267921044,"Ava Thompson","https://us-avatar.wpscdn.com/avatar/1800007509477c92dfb?_k=1782875107921204101",8,"Research & Report","A Compact Urban Knowledge Graph for Semantic and Spatial Queries using LLMs","CityGML is an OGC standard for semantic 3D city models, but its XML-oriented exchange format and complex relational mappings make analysis and querying difficult. pykci (Python Knowledge Graph for Cities) converts CityGML 2.0 datasets into a compact Neo4j urban knowledge graph with a schema covering all thematic modules and spatial indexing via an R-tree. A Python pipeline ingests data, supports interactive visualization with OGC 3D Tiles, and enables lossless round-trip export back to CityGML. Natural-language questions are translated into Cypher using a model-agnostic text-to-Cypher mechanism grounded in exact city data, reducing hallucination while enabling auditable provenance. The approach supports demanding semantic and spatial tasks such as finding roof surfaces suitable for greening.","pykci: A Compact Urban Knowledge Graph for Semantic and  \nSpatial Queries using LLMs  \nHuynh Duc An Son Nguyen  \n[son.nguyen@hcu-hamburg.de](son.nguyen@hcu-hamburg.de)[ ](son.nguyen@hcu-hamburg.de)HafenCity University Hamburg, Computational Methods Lab Hamburg, Germany  \nLukas Arzoumanidis  \nlukas.arzoumanidis@hcu[hamburg.de](hamburg.de)  \nHafenCity University Hamburg, Computational Methods Lab Hamburg, Germany  \nYouness Dehbi  \nyouness.dehbi@hcu-hamburg.de HafenCity University Hamburg, Computational Methods Lab Hamburg, Germany  \narXiv :2607 .0 1605v 1 [ cs .DB] 2 Jul 2026  \nFigure 1: Urban knowledge graph of the HafenCity district, Hamburg, automatically generated by pykci. Nodes represent city objects such as buildings, boundary surfaces, and polygons; edges represent semantic and spatial relationships. The graph is spatially aligned with the corresponding CityGML LoD2 building models rendered as OGC 3D Tiles.  \nAbstract  \nCityGML, the OGC standard for the modeling, storage, and exchange of semantic 3D city models, describes urban objects with detailed semantics, geometry, and topology. Yet this richness is difficult to query directly: CityGML’s XML encoding is designed for exchange rather than analysis, and relational mappings expose it through schemas that demand expert knowledge. We present pykci (Python Knowledge Graph for Cities), an open-source system that transforms CityGML 2.0 datasets into a compact urban knowledge graph in Neo4j and makes it queryable in plain natural language. The graph schema covers all thematic feature modules of CityGML 2.0 across all levels of detail and is spatially indexed with an R-tree for efficient geometric retrieval. A complete end-toend Python pipeline ingests CityGML datasets into the knowledge graph, exports them to OGC 3D Tiles for interactive visualization, and supports lossless round-trip export of all modeled content back to CityGML. For querying, the graph is paired with a large language model through a model-agnostic text-to-Cypher mechanism: the graph schema is supplied as context, and the model translates natural-language questions into Cypher queries executed directly against the graph. We evaluate both a locally running open-weight model, which keeps sensitive city data on-premise, and a stateof-the-art commercial model for the most demanding spatial and semantic queries. Answers are thereby grounded in exact city data rather than the model’s parametric memory, reducing hallucination and providing auditable provenance for every response. We demonstrate the system on open-government CityGML LoD2 datasets from Hamburg, Germany, including complex semantic and spatial  \nqueries such as identifying roof surfaces suitable for greening. pykci enables urban planners, GIS practitioners, and citizens to interact with semantic 3D city models without expertise in query languages and database schemas.  \nCCS Concepts  \n• Information systems → Graph-based database models; Geographic information systems; • Computing methodologies → Natural language generation.  \nKeywords  \nKnowledge Graph, Database, Semantic, Spatial, LLM, CityGML  \n1 Introduction  \nMore than 4.2 billion people, over 55% of the global population, live in cities today, and the United Nations projects this proportion will reach 68% by 2050 [43] . Supporting this growth imposes increasing demands on infrastructure, urban planning, and data management. In Germany alone, the national 3D Building Model at Level of Detail 2 (LoD2-DE) already comprises 58 million buildings [3], each represented with detailed semantics, geometry, and topology: typed boundary surfaces, precise three-dimensional geometry, and thematic attributes such as function, roof form, and measured height. Such data increasingly forms the backbone of urban digital twins (UDTs), virtual replicas ofthe physical city used for planning, simulation, and decision-making [25, 29] . At the core of any UDT lies a queryable digital knowledge base, and how easily  \nits en","cbCaijq1V6DuJcHQ","https://ap.wps.com/l/cbCaijq1V6DuJcHQ","pdf",4029058,1,14,"English","en",105,"# Introduction\n## Background and motivation\n## CityGML querying challenges\n## Graph and knowledge graph foundations\n## LLMs as a natural-language query interface","[{\"question\":\"What is pykci and what problem does it solve for CityGML data?\",\"answer\":\"pykci transforms CityGML 2.0 datasets into a compact Neo4j knowledge graph that is queryable in natural language, addressing the difficulty of directly querying CityGML’s XML encoding and complex relational schemas.\"},{\"question\":\"How does pykci improve efficient semantic and spatial retrieval?\",\"answer\":\"It uses a graph schema aligned with CityGML feature modules and spatially indexes geometry with an R-tree to speed up geometric retrieval for spatial queries.\"},{\"question\":\"How does pykci connect a language model to execute queries on the graph?\",\"answer\":\"A model-agnostic text-to-Cypher mechanism supplies the graph schema as context, allowing the LLM to translate natural-language questions into Cypher queries executed directly on the Neo4j graph.\"}]",1784197290,35,{"code":4,"msg":30,"data":31},"ok",{"site_id":24,"language":23,"slug":32,"title":13,"keywords":33,"description":14,"schema_data":34,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":27},"a-compact-urban-knowledge-graph-for-semantic-and-spatial-queries-using-llms","",{"@graph":35,"@context":85},[36,53,68],{"@type":37,"itemListElement":38},"BreadcrumbList",[39,43,47,50],{"item":40,"name":41,"@type":42,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":44,"name":45,"@type":42,"position":46},"https://docshare.wps.com/document/","Document",2,{"item":48,"name":12,"@type":42,"position":49},"https://docshare.wps.com/document/research-report/",3,{"item":51,"name":13,"@type":42,"position":52},"https://docshare.wps.com/document/a-compact-urban-knowledge-graph-for-semantic-and-spatial-queries-using-llms/84628/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":23,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":40,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-17","2026-07-16",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"What is pykci and what problem does it solve for CityGML data?","Question",{"text":75,"@type":76},"pykci transforms CityGML 2.0 datasets into a compact Neo4j knowledge graph that is queryable in natural language, addressing the difficulty of directly querying CityGML’s XML encoding and complex relational schemas.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"How does pykci improve efficient semantic and spatial retrieval?",{"text":80,"@type":76},"It uses a graph schema aligned with CityGML feature modules and spatially indexes geometry with an R-tree to speed up geometric retrieval for spatial queries.",{"name":82,"@type":73,"acceptedAnswer":83},"How does pykci connect a language model to execute queries on the graph?",{"text":84,"@type":76},"A model-agnostic text-to-Cypher mechanism supplies the graph schema as context, allowing the LLM to translate natural-language questions into Cypher queries executed directly on the Neo4j graph.","https://schema.org",{"og:url":51,"og:type":87,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":89,"canonical":51},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,120,123,128,131,135],{"id":20,"doc_module":4,"doc_module_name":45,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":46,"doc_module":4,"doc_module_name":45,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":45,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":45,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":45,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":45,"category_name":117,"show_sort_weight":118,"slug":119},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":45,"category_name":12,"show_sort_weight":121,"slug":122},30,"research-report",{"id":124,"doc_module":4,"doc_module_name":45,"category_name":125,"show_sort_weight":126,"slug":127},9,"Religion & Spirituality",20,"religion-spirituality",{"id":126,"doc_module":4,"doc_module_name":45,"category_name":129,"show_sort_weight":126,"slug":130},"World Cup","world-cup",{"id":132,"doc_module":4,"doc_module_name":45,"category_name":133,"show_sort_weight":132,"slug":134},10,"Lifestyle","lifestyle",{"id":136,"doc_module":4,"doc_module_name":45,"category_name":137,"show_sort_weight":106,"slug":138},19,"General","general"]