Pattern Matching and Path Traversals

In general, working with graph-based query languages is similar to relational query languages, such as SQL. However, there are some markedly different aspects:

  • There is a proliferation of use cases that tend to be more semantic in nature than legacy applications – hence the popularity of the Knowledge Graph paradigm
  • The query specification is much more visual, even in character-based interfaces the traversal paths are visualized by intuitive syntax elements (for edges / relationships etc.)
  • The graph pattern matching capabilities are very powerful and support very complex, highly related data
  • Many graph algorithms – coming out of academic research – are available in graph query languages, such as shortest path, clustering and many more.

Syntax-wise, some graph query languages are influenced by SQL, with the visual path-oriented extensions mentioned above.

Physical Constraints and Patterns

When it comes to physical constraints and implementation patterns there are, and will continue to be, great variation between the vendor offerings. Not least use cases with multi-join requirements and large data sets may benefit from using graph database technology.

Graph Query Language Standards

The oldest (1999) graph language standards are those of the World Wide Web Consortium (W3C). The core is the RDF-language (Resource Definition Framework) and the standard has been enhanced in different directions over the years. This is known as the Semantic Web, Open Linked Data and also Knowlede Graphs.

10 years later followed what today is known as Apache Tinkerpop with the Gremlin query language. It is a property graph language.

Today (2023), the new SQL Property Graph Queries, ISO/IEC DIS 9075-16, Information technology — Database languages SQL — Part 16: Property Graph Queries (SQL/PGQ) is a (draft) international standard for making property graph queries on top of SQL databases.

The very same ISO committee is working on ISO/IEC CD 39075.2 Information Technology — Database Languages — GQL, a new Graph Query Language sharing parts of SQL. GQL is a declarative graph query language supporting acyclic, directed, labelled property graphs. It supports queries etc. as well as data definition and query language functionalities such as procedures etc. Properties may reside on nodes / vertices and / or edges / relationships. This is a very versatile paradigm for many use cases, both simple and complex as well as operational applications, analytics, knowledge graphs and special graph algorithms such as centrality, community detection, machine learning and many more. There are many similarities between the graph pattern matching facilities of SQL Property Graph Queries, ISO/IEC DIS 9075-16, Information technology — Database languages SQL — Part 16: Property Graph Queries (SQL/PGQ) and those of GQL. However, GQL is a pure and comprehensive graph database language that does not require the presence of SQL.
You may follow the sequence or explore the site as you wish:

The guy behind this site is Thomas Frisendal:

Stacks Image 112