# Gaining Insights into Conceptual Models: A Graph-Theoretic Querying Approach
## 3 Queries and Databases
### Graphs and Graph Databases  
A graph consists of a set of nodes (vertices) connected by links (edges) [22]. Each node and each link contain metadata that describes its type and optionally additional properties. A set of vertices \(v\) connected by a set of edges \(e\) forms a mathematical structure for a graph \(G=(v,e)\). Graph nodes can have properties. Nodes in the graph can be objects, and edges--relationships between the objects [23]. Graphs are used in multiple domains, such as computer science, where graph algorithms are a major research and application field. Graphs describe pivotal subjects, such as communication, flow of computation, and data organization. Graphs can be stored in a graph database (GDB), which is geared towards storing and querying graph-structured data. GDBs use an index-free adjacency technique: every node has an implicit link to the adjacent node, providing for millions of records to be traversed quickly. In a GDB, the main emphasis is on the connections between data items, which provide schema-less and efficient storage of semi-structured data. GDBs serve in a variety of applications, such as social networking, recommendation software, bioinformatics, content management, security and access control, network, and cloud management. GDB queries are expressed as graph traversals, making them much faster than relational database queries. They are scalable and whiteboard-friendly, allowing for expressiveness in data modeling by drawing nodes and relationships, and only then implementing the metadata related to the nodes and the relationships [24]. GDBs are ACID-compliant and offer rollback support. They usually require only a single query to retrieve linked data. In relational databases, however, extracting the same information would require complex queries that perform inefficient and expensive joins over multiple tables. A GDB query language is not SQL, as it is designed to traverse a graph [25]. Unlike the case with SQL for relational DBMSs, as of 2018 no universal standard has been adopted as the GDB query language of choice. However, several QLs, such as Gremlin [26], SPARQL [12], and Cypher [27], are very popular; they are supported and distributed by multiple vendors and used by many organizations. A notable Database as a Service (DBaaS) provider that uses a GDB is Neo4j. Since Neo4j is used in this research, we discuss it next. Neo4j is an open source, NOSQL native graph database [28]. Its initial development began in 2003, but it has been publicly available since 2007. The source code, written in Java and Scala, is available for free on GitHub. Considered a world-leading, high-performance graph database, Neo4j is a native GDB because it efficiently implements the property graph model down to the storage level. This means that the data is stored exactly as expected, and the database uses pointers to navigate and traverse the graph [29]. Neo4j is currently the top-rated graph databasemanagement system [30], scoring almost twice as high as that of Microsoft Azure Cosmos DB, which ranks second (see Table 1). The current Neo4j version 3.5.14 uses Cypher [27] as its query language. Cypher is a declarative, SQL-inspired language for describing patterns in graphs visually using an ascii-art syntax. Cypher allows stating what to select, insert, update, or delete from the data expressed by the graph, without requiring an exact description of how to do it. Neo4j uses the Atomic, Consistent, Isolation, and Durable (ACID) model to ensure that the data is safe and stored consistently [31], making it reliable, highly available, and scalable. It offers a Representational State Transfer (REST) {XE \"REST:Representational State Transfer\"} interface, a coordinated set of architectural constraints that attempt to minimize latency and network communication [32], and a convenient Java API that can be embedded into JAR files.