Accuracy Calculation for Rule-Based Semantic Query in Neo4j Graph Database
Nang Nandar Tun, Nyo Nyo Yee · International Journal For Multidisciplinary Research · 2025
Graph databases, particularly Neo4j, have gained widespread adoption due to their ability to model complex relationships between entities. However, retrieving accurate and relevant results remains a challenge when dealing with Natural Language Queries (NLQ). Traditional keyword-based retrieval methods often fail to capture contextual meanings, leading to inaccurate query results. This paper explores the use of rule-based semantic query conversion in Neo4j, focusing on accuracy calculation through cosine similarity. The proposed method transforms NLQ into Cypher queries based on predefined rules, improving retrieval efficiency. To evaluate accuracy, we apply precision, recall, and F1-score, measuring the effectiveness of our approach. Experimental results demonstrate that rule-based query conversion significantly enhances accuracy compared to traditional keyword searches. The findings suggest that semantic rule-based transformation is a viable approach for improving query interpretation in graph databases.