liveBook · Manning

Inline graph pattern matching

As explained in Graph Algorithms for Data Science

Inline graph pattern matching is the expression of graph patterns directly in Cypher pattern syntax, including their labels and properties.

Inline graph pattern matching expresses nodes and relationships directly in Cypher syntax, including labels and properties. It lets a declarative query specify the desired pattern while the query engine retrieves matching data. section 3.1.2

Match a named person

MATCH (p:Person {name:'Satish'}) RETURN p section 3.1.2

Use inline patterns alongside filtering and result naming:

  • Place labels and simple property matches inside the pattern. section 3.1.2
  • Move additional conditions into WHERE; equivalent inline and WHERE forms can produce the same plan and results. section 3.1.2
  • Remember that WHERE applies only to the preceding MATCH, and use AS to make returned columns clearer. section 3.1.2
Listing 3.6 Cypher statement that searches and retrieves any nodes with a label Person and a name property with a value of Satish
MATCH (p:Person {name:'Satish'})
RETURN p

View the complete Cypher listing for matching a Person node by label and name. section 3.1.2

How Graph Algorithms for Data Science covers it

How deep it goes
Defines inline syntax, contrasts it with WHERE, and addresses aliases and MATCH scope without covering query-engine internals.
Examples
Uses Person nodes, Satish and Elaine names, FRIEND relationships, and optional Book or Organization matches.
What it assumes
Assumes familiarity with describing node and relationship patterns, while teaching their use within the MATCH clause.
What you can do after
Apply it via Cypher to retrieve labeled nodes, filter properties, combine matches, and return readable results.
How it connects
Connects Cypher with MATCH, WHERE, AS, CREATE, and OPTIONAL MATCH clauses.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Graph Algorithms for Data Science. The section links point to the parts of the book it draws on.