Graph Data Processing with Cypher by Ravindranatha Anthapu

Graph Data Processing with Cypher by Ravindranatha Anthapu

Author:Ravindranatha Anthapu
Language: eng
Format: epub
Publisher: Packt Publishing Pvt. Ltd.
Published: 2022-12-02T00:00:00+00:00


Figure 6.12 – Usage of list comprehensions and the reduce function

We can see from the result that we can get a single by filtering the list for even numbers from the original list and using the reduce function to calculate the sum of squares.

We will take a look at using UNION cypher queries in the next section.

Working with UNION in Cypher

The UNION clause combines the results of two or more queries and returns the results. It works pretty similarly to how it works in SQL queries. Normally, we use the UNION clause when we want to combine the results of multiple, disparate queries returning similar datasets.

Let’s look at an example usage of the UNION clause:

MATCH (p:Patient)-[:HAS_ENCOUNTER]->()-[:HAS_DIAGNOSIS]->(d) WHERE p.id='f237e253-9052-a038-7c9e-dbd9a1d7da32' RETURN d.code as drug UNION MATCH (p:Patient)-[:HAS_ENCOUNTER]->()-[:HAS_DIAGNOSIS]->(d) WHERE p.id='ffa580de-08e5-9a47-b12a-db312ad6825b' RETURN d.code as drug

This query returns the diagnosis codes used among two patients, as shown in the following figure:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Popular ebooks
Developing Robust Date and Time Oriented Applications in Oracle Cloud by Michal Kvet(5130)
Practical Guide to Azure Cognitive Services by Chris Seferlis & Christopher Nellis & Andy Roberts(4211)
Serverless ETL and Analytics with AWS Glue by Vishal Pathak Subramanya Vajiraya Noritaka Sekiyama Tomohiro Tanaka Albert Quiroga Ishan Gaur(3812)
Unity Artificial Intelligence Programming - Fifth Edition by Dr. Davide Aversa(3811)
Open Source Projects - Beyond Code by John Mertic(2865)
The AI Product Manager's Handbook by Irene Bratsis(2849)
Graph Data Modeling in Python by Gary Hutson and Matt Jackson(2827)
Cloud Auditing Best Practices by Shinesa Cambric & Michael Ratemo(2471)
Aligning Security Operations with the MITRE ATT&CK Framework by Rebecca Blair(2463)
Applied Machine Learning and High-Performance Computing on AWS by Mani Khanuja | Farooq Sabir | Shreyas Subramanian | Trenton Potgieter(1256)
Graph Data Processing with Cypher by Ravindranatha Anthapu(1256)
Data Literacy in Practice by Angelika Klidas Kevin Hanegan(1239)
Fuzzing Against the Machine: Automate vulnerability research with emulated IoT devices on QEMU by Antonio Nappa Eduardo Blazquez(1111)
Implementing Multifactor Authentication: Protect your applications from cyberattacks with the help of MFA by Marco Fanti(1106)
The AI Product Manager's Handbook: Develop a product that takes advantage of machine learning to solve AI problems by Irene Bratsis(978)
Data Literacy in Practice - A complete guide to data literacy and making smarter decisions with data through intelligent actions (2022) by Packt(966)
Graph Data Processing with Cypher by Anthapu Ravindranatha;(908)
The SQL Workshop by Frank Solomon(901)
Serverless Machine Learning with Amazon Redshift ML: Create, train, and deploy machine learning models using familiar SQL commands by Debu Panda Phil Bates Bhanu Pittampally Sumeet Joshi(869)
Network Automation with Go by Nicolas Leiva & Michael Kashin(740)