SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

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

🎓 beginner 15 min. SAP HANABeginnerSAP HANA CloudExpress EditionSql

You will learn

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

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

Learn more →