SAP

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
⤢ Open full site

Pattern Matching Using OpenCypher in SQL

Execute pattern matching queries in SAP HANA Graph using OpenCypher.

Overview

You will learn

  • How to execute OpenCypher pattern matching queries
Markus Fath M Markus Fath March 7, 2023
Created on January 14, 2021
Contributors

More from Markus Fath

See all 13 tutorials by Markus Fath →

Prerequisites

Prerequisites

Steps

Step 1 OpenCypher in SAP HANA SQL

OpenCypher is a declarative graph query language for graph pattern matching developed by the OpenCypher Implementers Group.

SAP HANA Graph allows you to use OpenCypher directly in SQL. For more please refer to online documentation for SAP HANA Cloud.

Go to the SQL Console and execute the following query.

SQL
SELECT * FROM OPENCYPHER_TABLE( GRAPH WORKSPACE "SKIING"."SKIING" QUERY
    '
    MATCH (point1)
    WHERE point1.ticket_office = ''TRUE''
    RETURN point1.node_id as station_id, point1.ticket_office as is_ticket_office
    '
) ORDER BY "station_id"

Only matched nodes with ticket_office = ‘TRUE’ have been selected.

Ticket Offices
Ticket Offices

Step 2 More examples with OpenCypher
+
Step 3 Pattern Matching in calculation scenarios in SAP HANA 2.0
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 3
1. OpenCypher in SAP HANA SQL 2. More examples with OpenCypher 3. Pattern Matching in calculation scenarios in SAP HANA 2.0