The infrastructure managed by Smart City systems includes mainly linear structures, such as pipelines, electric power lines, railway lines, etc.. In this paper, we propose the transcription of linear infrastructure to graph representation and storing needed meta-data in a graph database, merged with the traditional relational database used for device management. Such an approach enables fast acquisition of data about infrastructure's properties and allows merging information about the structure of the managed infrastructure with information devices' properties and statistics. We develop a graph generator that generates virtual network basing on representative examples of linear infrastructure, incorporation of a data from existing metering systems with the generated structure, which automates the deployment and allows to evaluate the performance of Smart City monitoring and management system. We present results of performance tests that show and the creation time of graph database structures in Neo4j and the difference between the performance of the Microsoft SQL Server database and the Neo4j database in a few Smart City use cases. The results show that the use of the graph database to execute queries related to linear infrastructure allows decreasing the response time up to 9 times.