# Robust Text-to-Cypher Using Combination of BERT, GraphSAGE, and Transformer (CoBGT) Model
## 1 Introduction  
With the exponential growth of digital data, social networks, and the Internet of Things (IoT), many databases have been introduced to meet the demand for handling vast amounts of data in industry and academia [1]. Among them, Neo4j is a promising database like the trendiest product [2]. In Neo4j, the query language Cypher (QLC) is recommended as the optimal language to access the database [3]. However, the syntax and operations of Cypher are complex and require a considerable learning curve for users. Thus, question-to-Cypher query research aims to enhance accessibility by allowing nontechnical users to interact with graph databases using natural language, making data retrieval more intuitive and user-friendly. The text-to-Cypher model can be useful in practical application. For example, in customer management systems, users can ask questions about customer interactions and behaviors using natural language, such as \"Find customers who purchased both products X and Y\". This makes it easier for marketing professionals to obtain the customer information without learning Cypher. Recently, with the development of artificial intelligence (AI), deep learning (DL) and machine learning (ML) models have been applied to many fields such as speech recognition [4, 5], image processing [6, 7], network security [8, 9], etc. In particular, DLand ML models have also been highly recommended to design and build the language translators [10; 11]. Additionally, translating from natural language to query language is a sub-task of language translation. Thus, to convert the natural language into queries, many sequence-to-sequence (Seq2 Seq) models have been used, such as long short-term memory (LSTM) [12], ChatGPT [13], and Transformer [14]. In [15], the authors used Neural Attention to convert language to logical form with the program descriptions predefined from [16]. T5-SR model was proposed in [17] to improve the performance of converting natural language queries into SQLs. With the above studies, DL and ML models have also achieved high performance in text-to-query tasks. However, previous studies about text-to-query have not provided any methods and models converting the natural language to Cypher query. Like SQL, Cypher (QLC) is used to present text query language with a specific focus on graphs. Cypher also includes similar statements, expressions, and keywords such as WHERE, ORDER BY, SKIP LIMIT, AND, etc. However, unlike SQL, which handles table data, Cypher focuses on the data with graph form that include nodes and edges; as mentioned in [18], text-to-Cypher is more challenging due to more complex scenarios, the difficulty of leveraging database contents, and the absence of elements such as schema, primary key, and foreign key. Thus, existing text-to-SQL and text-to-SPARQL models [19; 20; 21; 22; 23] are not suitable for translating natural language to Cypher. Seq2 Seq models were among the first to be applied to the text-to-SQL task. These models convert natural language input into an SQL query. However, Seq2 Seq models often struggle with complex queries, especially those involving nested structures or multiple tables or when the database schema is complex. Moreover, the experiments illustrate that the Seq2 Seq framework yields undesirable results on the text-to-Cypher task, hence pressing for subsequent research that considers the characteristics of the text-to-Cypher task [18]. So, question-to-Cypher query research also finds a suitable strategy for solving the task. Schema-aware models like [24] incorporate knowledge of the database schema into the query generation process, allowing them to better understand and utilize the structure of the database. However, schema-aware models rely heavily on the quality of the schema representation. They can struggle with databases that have complex, poorly defined or rich information contained schemas. A schema-linking approach is also being used in various text-to-SQL models [25; 26].