SlideShare a Scribd company logo
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Formal Specification of Cypher
Nadime Francis
University of Edinburgh
Wednesday, May, 10th
1 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Property Graphs
Person, Postdoc
name : ‘Nadime’
institute : ‘UoE’
Person, Professor
name : ‘Leonid’
institute : ‘UoE’
knows
since : 2010
colleague
since : 2015
A property graph is a tuple G = (N, R, s, t, ι, λ, τ), where:
N ⊆ N: finite set of nodes
R ⊆ R: finite set of relationships
s : R → N: maps each relationship to its source
t : R → N: maps each relationship to its target
ι : (N ∪ R) × K → V: maps each x and k to x.k.
λ : N → 2L: associates a set of label to each node
τ : R → T : associates a type to each relationship
2 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Records and Tables
A record is a tuple with named fields : (a1 : v1, . . . , an : vn).
A table is a bag of uniform records.
Example:
(a : 1, b : 3), (a : ‘oCIM 2’, b : ‘London’),
(a : ‘oCIM’, b : ‘Walldorf’), (a : 1, b : 3)
a b
1 3
‘oCIM 2’ ‘London’
‘oCIM’ ‘Walldorf’
1 3
=
a b
‘oCIM’ ‘Walldorf’
1 3
‘oCIM 2’ ‘London’
1 3
3 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Operations and Expressions
An Example
MATCH (n : Person) − [: knows]−> (m : Person)
WHERE n.institute = m.institute
RETURN n.name, m.name, n.institute AS institute
4 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Operations and Expressions
An Example
MATCH (n : Person) − [: knows]−> (m : Person)
WHERE n.institute = m.institute
RETURN n.name, m.name, n.institute AS institute
4 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Operations and Expressions
An Example
MATCH (n : Person) − [: knows]−> (m : Person)
WHERE n.institute = m.institute
RETURN n.name, m.name, n.institute AS institute
n m
{name : ‘Nadime’, institute : ‘UoE’} {name : ‘Leonid’, institute : ‘UoE’}
{name : ‘Paolo’, institute : ‘UoE’} {name : ‘Nadime’, institute : ‘UoE’}
{name : ‘Nadime’, institute : ‘UoE’} {name : ‘Stefan’, institute : ‘Neo’}
{name : ‘Alastair’, institute : ‘Neo’} {name : ‘Stefan’, institute : ‘Neo’}
4 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Operations and Expressions
An Example
MATCH (n : Person) − [: knows]−> (m : Person)
WHERE n.institute = m.institute
RETURN n.name, m.name, n.institute AS institute
n m
{name : ‘Nadime’, institute : ‘UoE’} {name : ‘Leonid’, institute : ‘UoE’}
{name : ‘Paolo’, institute : ‘UoE’} {name : ‘Nadime’, institute : ‘UoE’}
{name : ‘Alastair’, institute : ‘Neo’} {name : ‘Stefan’, institute : ‘Neo’}
4 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Operations and Expressions
An Example
MATCH (n : Person) − [: knows]−> (m : Person)
WHERE n.institute = m.institute
RETURN n.name, m.name, n.institute AS institute
n.name m.name institute
‘Nadime’ ‘Leonid’ UoE
‘Paolo’ ‘Nadime’ UoE
‘Alastair’ ‘Stefan’ Neo
4 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Operations and Expressions
Q =
(α) MATCH (n : Person) − [: knows]−> (m : Person)
(β) WHERE n.institute = m.institute
(γ) RETURN n.name, m.name, n.institute AS institute
5 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Operations and Expressions
Q =
(α) MATCH (n : Person) − [: knows]−> (m : Person)
(β) WHERE n.institute = m.institute
(γ) RETURN n.name, m.name, n.institute AS institute
Operations
[[op]]G : Tables → Tables
Semantics of a query by composition
Ex: [[Q]]G = [[α]]G ◦ [[β]]G ◦ [[γ]]G
Answers to Q on G: [[Q]]G ({})
5 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Operations and Expressions
Q =
(α) MATCH (n : Person) − [: knows]−> (m : Person)
(β) WHERE n.institute = m.institute
(γ) RETURN n.name, m.name, n.institute AS institute
Operations
[[op]]G : Tables → Tables
Semantics of a query by composition
Ex: [[Q]]G = [[α]]G ◦ [[β]]G ◦ [[γ]]G
Answers to Q on G: [[Q]]G ({})
Expressions
[[exp]]G,u ∈ V where u is a record, giving binding to variables
Ex: [[β]]G (T) = u ∈ T | [[n.institute = m.institute]]G,u = true
5 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Pattern Matching
Rigid pattern satisfaction
Rigid path pattern: no variable length edge patterns.
Ex: (n : Person) − [: knows ∗ 2]−> () − [: likes]−> (m : Movie)
Unique way for a path p to satisfy a rigid pattern π wrt G, u.
Notation: (p, G, u) |= π
6 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Pattern Matching
Rigid pattern satisfaction
Rigid path pattern: no variable length edge patterns.
Ex: (n : Person) − [: knows ∗ 2]−> () − [: likes]−> (m : Movie)
Unique way for a path p to satisfy a rigid pattern π wrt G, u.
Notation: (p, G, u) |= π
Variable-length paths and free variables
rigid(π) = {π | π is rigid and π π }
Ex: () − [∗2]−> () − [∗4]−> () () − [∗1..3]−> () − [∗]−> ()
free(π, u): all names that occur in π and not in u
6 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Pattern Matching
Rigid pattern satisfaction
Rigid path pattern: no variable length edge patterns.
Ex: (n : Person) − [: knows ∗ 2]−> () − [: likes]−> (m : Movie)
Unique way for a path p to satisfy a rigid pattern π wrt G, u.
Notation: (p, G, u) |= π
Variable-length paths and free variables
rigid(π) = {π | π is rigid and π π }
Ex: () − [∗2]−> () − [∗4]−> () () − [∗1..3]−> () − [∗]−> ()
free(π, u): all names that occur in π and not in u
[[MATCH π]]G (T) =
π ∈rigid(π)
u∈T, p∈paths
(u, u )
u is uniform with free(π , u)
and (p, G, (u, u )) |= π
6 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Ambiguous and Edge Cases
7 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Nulls in Patterns
MATCH (n : Person {name : null})
RETURN (n)
8 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Nulls in Patterns
MATCH (n : Person {name : null})
RETURN (n)
1 Every node n with a name property?
2 Every node n such that n.name IS NULL = true?
3 Nothing?
8 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Nulls in Patterns
MATCH (n : Person {name : null})
RETURN (n)
1 Every node n with a name property?
2 Every node n such that n.name IS NULL = true?
3 Nothing!
Because Q is actually equivalent to:
MATCH (n : Person)
WHERE n.name = null
RETURN (n)
8 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Map Comparisons
When does {k1 : v1, . . . , kn : vn} = { 1 : w1, . . . , m : wm} return
true, false or null?
{name : null} = {}
{name : null} = {name : null}
{a : 1, b : 2} = {b : 2, a : 1}
{a : 1, a : 2} = {a : 2}
9 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Map Comparisons
When does {k1 : v1, . . . , kn : vn} = { 1 : w1, . . . , m : wm} return
true, false or null?
false
{name : null} = {}
true
{name : null} = {name : null}
true
{a : 1, b : 2} = {b : 2, a : 1}
true
{a : 1, a : 2} = {a : 2}
Neither purely syntactic, nor ∀k, m1.k = m2.k.
9 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Setting Properties using a Map
WITH {name : null} AS map
CREATE (n)
SET n = map
RETURN (n)
10 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Setting Properties using a Map
WITH {name : null} AS map
CREATE (n)
SET n = map
RETURN (n)
Returns n as {}.
The property map of n is not equal to the map it was set to.
In particular, n {.∗} = map returns false.
10 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
MATCH with no Free Variables
MATCH ()
RETURN ∗
MATCH ()
RETURN 1
11 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
MATCH with no Free Variables
Fail
MATCH ()
RETURN ∗
RETURN ∗ is not allowed with
no variable in scope.
Pass
MATCH ()
RETURN 1
Returns as many copies of 1
as nodes in the database.
After MATCH (), the active table is a bag containing multiple copies
of the empty record.
11 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Incomplete and Inconsistent Cases
12 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Repeating UNWINDs
UNWIND [1, 2, 3] AS r
UNWIND r AS s
RETURN s
UNWIND [[1, 2], 3] AS r
UNWIND r AS s
RETURN s
13 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Repeating UNWINDs
Fail
UNWIND [1, 2, 3] AS r
UNWIND r AS s
RETURN s
Type mismatch, expected List
but was Integer.
Pass
UNWIND [[1, 2], 3] AS r
UNWIND r AS s
RETURN s
Returns a column with 1, 2
and 3 as rows.
13 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Repeating UNWINDs
Fail
UNWIND [1, 2, 3] AS r
UNWIND r AS s
RETURN s
Type mismatch, expected List
but was Integer.
Pass
UNWIND [[1, 2], 3] AS r
UNWIND r AS s
RETURN s
Returns a column with 1, 2
and 3 as rows.
UNWIND [[1, 2], 3] AS r
UNWIND r AS s
UNWIND s AS t
UNWIND t AS u
RETURN u
Actually works, and returns a column with 1, 2 and 3 as rows.
13 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Violating Cyphermorphism
Q0 =
MATCH (x) − [r] − (y) − [r] − (z)
RETURN x, y, z
14 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Violating Cyphermorphism
Q0 =
MATCH (x) − [r] − (y) − [r] − (z)
RETURN x, y, z
Error: cannot use the same relationship variable ‘r’ for multiple
patterns.
14 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Violating Cyphermorphism
Q0 =
MATCH (x) − [r] − (y) − [r] − (z)
RETURN x, y, z
Error: cannot use the same relationship variable ‘r’ for multiple
patterns.
Q1 =
MATCH (x) − [r∗] − (y) − [r∗] − (z)
RETURN x, y, z
14 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Violating Cyphermorphism
Q0 =
MATCH (x) − [r] − (y) − [r] − (z)
RETURN x, y, z
Error: cannot use the same relationship variable ‘r’ for multiple
patterns.
Q1 =
MATCH (x) − [r∗] − (y) − [r∗] − (z)
RETURN x, y, z
Works and enforces the paths from x to y and from y to z to use
the same sequence of relationships, violating Cyphermorphism.
14 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Violating Cyphermorphism
Q0 =
MATCH (x) − [r] − (y) − [r] − (z)
RETURN x, y, z
Error: cannot use the same relationship variable ‘r’ for multiple
patterns.
Q1 =
MATCH (x) − [r∗] − (y) − [r∗] − (z)
RETURN x, y, z
Works and enforces the paths from x to y and from y to z to use
the same sequence of relationships, violating Cyphermorphism.
It is not included in the query Q2 below:
Q1 =
MATCH (x) − [r∗] − (y) − [s∗] − (z)
RETURN x, y, z
14 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Two Small Issues: Nulls as Indices and Keys, and Naming
RETURN 1 AS ‘0‘, 0
15 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Two Small Issues: Nulls as Indices and Keys, and Naming
Fail
RETURN 1 AS ‘0‘, 0
Multiple result columns with the same name are not supported.
Need to specify how expression naming is handled.
15 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Two Small Issues: Nulls as Indices and Keys, and Naming
Fail
RETURN 1 AS ‘0‘, 0
Multiple result columns with the same name are not supported.
Need to specify how expression naming is handled.
[1, 2, 3][null] [1, 2, 3][null..4]
{name : ‘Nadime’} [null]
15 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Two Small Issues: Nulls as Indices and Keys, and Naming
Fail
RETURN 1 AS ‘0‘, 0
Multiple result columns with the same name are not supported.
Need to specify how expression naming is handled.
Fail
[1, 2, 3][null] [1, 2, 3][null..4]
{name : ‘Nadime’} [null]
No error, never terminates.
15 / 16
Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases
Thank you!
16 / 16

More Related Content

What's hot

CCG
CCGCCG
CCG
jie cao
 
Chapter 1.1
Chapter 1.1Chapter 1.1
Chapter 1.1
Ismaya Gharini
 
11.2 Arithmetic Sequences and Series
11.2 Arithmetic Sequences and Series11.2 Arithmetic Sequences and Series
11.2 Arithmetic Sequences and Series
smiller5
 
5.5 parallel and perpendicular lines (equations) day 1
5.5 parallel and perpendicular lines (equations)   day 15.5 parallel and perpendicular lines (equations)   day 1
5.5 parallel and perpendicular lines (equations) day 1
bweldon
 
Inverse Limits in Holomorphic Dynamics
Inverse Limits in Holomorphic DynamicsInverse Limits in Holomorphic Dynamics
Inverse Limits in Holomorphic Dynamics
Avraham Goldstein
 
Applications of graphs
Applications of graphsApplications of graphs
Applications of graphs
Tech_MX
 
1.2 the graphs of quadratic equations
1.2 the graphs of quadratic equations1.2 the graphs of quadratic equations
1.2 the graphs of quadratic equations
math123c
 
Graph Theory Introduction
Graph Theory IntroductionGraph Theory Introduction
Graph Theory Introduction
MANISH T I
 
Lecture co1 math 21-1
Lecture co1 math 21-1Lecture co1 math 21-1
Lecture co1 math 21-1
Lawrence De Vera
 
Properties of straight lines
Properties of straight linesProperties of straight lines
Properties of straight lines
florian Manzanilla
 
Presentation on graphs
Presentation on graphsPresentation on graphs
Presentation on graphs
ForwardBlog Enewzletter
 
Graph theory presentation
Graph theory presentationGraph theory presentation
Graph theory presentation
Aliul Kadir Akib
 
Math14 lesson 5
Math14 lesson 5Math14 lesson 5
Math14 lesson 5
Warren Cunanan
 
Completeness
CompletenessCompleteness
Completeness
andrejko
 
Higher Maths 1.1 - Straight Line
Higher Maths 1.1 - Straight LineHigher Maths 1.1 - Straight Line
Higher Maths 1.1 - Straight Line
timschmitz
 
Basic graph theory
Basic graph theoryBasic graph theory
Basic graph theory
JayaLakshmi277
 
Linear function and slopes of a line
Linear function and slopes of a lineLinear function and slopes of a line
Linear function and slopes of a line
Jerlyn Fernandez
 
Basics on Graph Theory
Basics on Graph TheoryBasics on Graph Theory
Basics on Graph Theory
Guillaume Guérard
 
Straight Lines ( Especially For XI )
Straight Lines ( Especially For XI ) Straight Lines ( Especially For XI )
Straight Lines ( Especially For XI )
Atit Gaonkar
 
Tracing of cartesian curve
Tracing of cartesian curveTracing of cartesian curve
Tracing of cartesian curve
Kaushal Patel
 

What's hot (20)

CCG
CCGCCG
CCG
 
Chapter 1.1
Chapter 1.1Chapter 1.1
Chapter 1.1
 
11.2 Arithmetic Sequences and Series
11.2 Arithmetic Sequences and Series11.2 Arithmetic Sequences and Series
11.2 Arithmetic Sequences and Series
 
5.5 parallel and perpendicular lines (equations) day 1
5.5 parallel and perpendicular lines (equations)   day 15.5 parallel and perpendicular lines (equations)   day 1
5.5 parallel and perpendicular lines (equations) day 1
 
Inverse Limits in Holomorphic Dynamics
Inverse Limits in Holomorphic DynamicsInverse Limits in Holomorphic Dynamics
Inverse Limits in Holomorphic Dynamics
 
Applications of graphs
Applications of graphsApplications of graphs
Applications of graphs
 
1.2 the graphs of quadratic equations
1.2 the graphs of quadratic equations1.2 the graphs of quadratic equations
1.2 the graphs of quadratic equations
 
Graph Theory Introduction
Graph Theory IntroductionGraph Theory Introduction
Graph Theory Introduction
 
Lecture co1 math 21-1
Lecture co1 math 21-1Lecture co1 math 21-1
Lecture co1 math 21-1
 
Properties of straight lines
Properties of straight linesProperties of straight lines
Properties of straight lines
 
Presentation on graphs
Presentation on graphsPresentation on graphs
Presentation on graphs
 
Graph theory presentation
Graph theory presentationGraph theory presentation
Graph theory presentation
 
Math14 lesson 5
Math14 lesson 5Math14 lesson 5
Math14 lesson 5
 
Completeness
CompletenessCompleteness
Completeness
 
Higher Maths 1.1 - Straight Line
Higher Maths 1.1 - Straight LineHigher Maths 1.1 - Straight Line
Higher Maths 1.1 - Straight Line
 
Basic graph theory
Basic graph theoryBasic graph theory
Basic graph theory
 
Linear function and slopes of a line
Linear function and slopes of a lineLinear function and slopes of a line
Linear function and slopes of a line
 
Basics on Graph Theory
Basics on Graph TheoryBasics on Graph Theory
Basics on Graph Theory
 
Straight Lines ( Especially For XI )
Straight Lines ( Especially For XI ) Straight Lines ( Especially For XI )
Straight Lines ( Especially For XI )
 
Tracing of cartesian curve
Tracing of cartesian curveTracing of cartesian curve
Tracing of cartesian curve
 

Similar to Formal Specification of Cypher

Complex function
Complex functionComplex function
Complex function
Shrey Patel
 
Pertemuan 5_Relation Matriks_01 (17)
Pertemuan 5_Relation Matriks_01 (17)Pertemuan 5_Relation Matriks_01 (17)
Pertemuan 5_Relation Matriks_01 (17)
Evert Sandye Taasiringan
 
Compiler components and their generators traditional parsing algorithms
Compiler components and their generators  traditional parsing algorithmsCompiler components and their generators  traditional parsing algorithms
Compiler components and their generators traditional parsing algorithms
PeshrowKareem1
 
Lexical Analysis
Lexical AnalysisLexical Analysis
Lexical Analysis
Eelco Visser
 
Geometry Section 1-7 1112
Geometry Section 1-7 1112Geometry Section 1-7 1112
Geometry Section 1-7 1112
Jimbo Lamb
 
Dialectica and Kolmogorov Problems
Dialectica and Kolmogorov ProblemsDialectica and Kolmogorov Problems
Dialectica and Kolmogorov Problems
Valeria de Paiva
 
A Tutorial on Computational Geometry
A Tutorial on Computational GeometryA Tutorial on Computational Geometry
A Tutorial on Computational Geometry
Minh-Tri Pham
 
Chapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata TheoryChapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata Theory
Tsegazeab Asgedom
 
algorithm_3graphs.pdf
algorithm_3graphs.pdfalgorithm_3graphs.pdf
algorithm_3graphs.pdf
HsuChi Chen
 
Csr2011 june17 11_30_vyalyi
Csr2011 june17 11_30_vyalyiCsr2011 june17 11_30_vyalyi
Csr2011 june17 11_30_vyalyi
CSR2011
 
Representation of Integer Positive Number as A Sum of Natural Summands
Representation of Integer Positive Number as A Sum of Natural SummandsRepresentation of Integer Positive Number as A Sum of Natural Summands
Representation of Integer Positive Number as A Sum of Natural Summands
IJERA Editor
 
Lesson 1-1: Basic Geometric Figures
Lesson 1-1: Basic Geometric FiguresLesson 1-1: Basic Geometric Figures
Lesson 1-1: Basic Geometric Figures
Hunter Patton
 
Csr2011 june17 11_30_vyalyi
Csr2011 june17 11_30_vyalyiCsr2011 june17 11_30_vyalyi
Csr2011 june17 11_30_vyalyi
CSR2011
 
Chapterdug84356_ch09a.qxd 91410 211.docx
Chapterdug84356_ch09a.qxd  91410  211.docxChapterdug84356_ch09a.qxd  91410  211.docx
Chapterdug84356_ch09a.qxd 91410 211.docx
christinemaritza
 
4.6 Relative product and composition
4.6 Relative product and composition4.6 Relative product and composition
4.6 Relative product and composition
Jan Plaza
 
Graphs
GraphsGraphs
Introduction to Neo4j - a hands-on crash course
Introduction to Neo4j - a hands-on crash courseIntroduction to Neo4j - a hands-on crash course
Introduction to Neo4j - a hands-on crash course
Neo4j
 
Parity arguments in problem solving
Parity arguments in problem solvingParity arguments in problem solving
Parity arguments in problem solving
talegari
 
Darmon Points: an overview
Darmon Points: an overviewDarmon Points: an overview
Darmon Points: an overview
mmasdeu
 
Rough sets and fuzzy rough sets in Decision Making
Rough sets and  fuzzy rough sets in Decision MakingRough sets and  fuzzy rough sets in Decision Making
Rough sets and fuzzy rough sets in Decision Making
DrATAMILARASIMCA
 

Similar to Formal Specification of Cypher (20)

Complex function
Complex functionComplex function
Complex function
 
Pertemuan 5_Relation Matriks_01 (17)
Pertemuan 5_Relation Matriks_01 (17)Pertemuan 5_Relation Matriks_01 (17)
Pertemuan 5_Relation Matriks_01 (17)
 
Compiler components and their generators traditional parsing algorithms
Compiler components and their generators  traditional parsing algorithmsCompiler components and their generators  traditional parsing algorithms
Compiler components and their generators traditional parsing algorithms
 
Lexical Analysis
Lexical AnalysisLexical Analysis
Lexical Analysis
 
Geometry Section 1-7 1112
Geometry Section 1-7 1112Geometry Section 1-7 1112
Geometry Section 1-7 1112
 
Dialectica and Kolmogorov Problems
Dialectica and Kolmogorov ProblemsDialectica and Kolmogorov Problems
Dialectica and Kolmogorov Problems
 
A Tutorial on Computational Geometry
A Tutorial on Computational GeometryA Tutorial on Computational Geometry
A Tutorial on Computational Geometry
 
Chapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata TheoryChapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata Theory
 
algorithm_3graphs.pdf
algorithm_3graphs.pdfalgorithm_3graphs.pdf
algorithm_3graphs.pdf
 
Csr2011 june17 11_30_vyalyi
Csr2011 june17 11_30_vyalyiCsr2011 june17 11_30_vyalyi
Csr2011 june17 11_30_vyalyi
 
Representation of Integer Positive Number as A Sum of Natural Summands
Representation of Integer Positive Number as A Sum of Natural SummandsRepresentation of Integer Positive Number as A Sum of Natural Summands
Representation of Integer Positive Number as A Sum of Natural Summands
 
Lesson 1-1: Basic Geometric Figures
Lesson 1-1: Basic Geometric FiguresLesson 1-1: Basic Geometric Figures
Lesson 1-1: Basic Geometric Figures
 
Csr2011 june17 11_30_vyalyi
Csr2011 june17 11_30_vyalyiCsr2011 june17 11_30_vyalyi
Csr2011 june17 11_30_vyalyi
 
Chapterdug84356_ch09a.qxd 91410 211.docx
Chapterdug84356_ch09a.qxd  91410  211.docxChapterdug84356_ch09a.qxd  91410  211.docx
Chapterdug84356_ch09a.qxd 91410 211.docx
 
4.6 Relative product and composition
4.6 Relative product and composition4.6 Relative product and composition
4.6 Relative product and composition
 
Graphs
GraphsGraphs
Graphs
 
Introduction to Neo4j - a hands-on crash course
Introduction to Neo4j - a hands-on crash courseIntroduction to Neo4j - a hands-on crash course
Introduction to Neo4j - a hands-on crash course
 
Parity arguments in problem solving
Parity arguments in problem solvingParity arguments in problem solving
Parity arguments in problem solving
 
Darmon Points: an overview
Darmon Points: an overviewDarmon Points: an overview
Darmon Points: an overview
 
Rough sets and fuzzy rough sets in Decision Making
Rough sets and  fuzzy rough sets in Decision MakingRough sets and  fuzzy rough sets in Decision Making
Rough sets and fuzzy rough sets in Decision Making
 

More from openCypher

Learning Timed Automata with Cypher
Learning Timed Automata with CypherLearning Timed Automata with Cypher
Learning Timed Automata with Cypher
openCypher
 
Incremental View Maintenance for openCypher Queries
Incremental View Maintenance for openCypher QueriesIncremental View Maintenance for openCypher Queries
Incremental View Maintenance for openCypher Queries
openCypher
 
Formal semantics for Cypher queries and updates
Formal semantics for Cypher queries and updatesFormal semantics for Cypher queries and updates
Formal semantics for Cypher queries and updates
openCypher
 
Cypher.PL: an executable specification of Cypher semantics
Cypher.PL: an executable specification of Cypher semanticsCypher.PL: an executable specification of Cypher semantics
Cypher.PL: an executable specification of Cypher semantics
openCypher
 
Multiple Graphs: Updatable Views
Multiple Graphs: Updatable ViewsMultiple Graphs: Updatable Views
Multiple Graphs: Updatable Views
openCypher
 
Micro-Servicing Linked Data
Micro-Servicing Linked DataMicro-Servicing Linked Data
Micro-Servicing Linked Data
openCypher
 
Graph abstraction
Graph abstractionGraph abstraction
Graph abstraction
openCypher
 
From Cypher 9 to GQL: Conceptual overview of multiple named graphs and compos...
From Cypher 9 to GQL: Conceptual overview of multiple named graphs and compos...From Cypher 9 to GQL: Conceptual overview of multiple named graphs and compos...
From Cypher 9 to GQL: Conceptual overview of multiple named graphs and compos...
openCypher
 
Cypher for Gremlin
Cypher for GremlinCypher for Gremlin
Cypher for Gremlin
openCypher
 
Comparing PGQL, G-Core and Cypher
Comparing PGQL, G-Core and CypherComparing PGQL, G-Core and Cypher
Comparing PGQL, G-Core and Cypher
openCypher
 
Multiple graphs in openCypher
Multiple graphs in openCypherMultiple graphs in openCypher
Multiple graphs in openCypher
openCypher
 
Eighth openCypher Implementers Group Meeting: Status Update
Eighth openCypher Implementers Group Meeting: Status UpdateEighth openCypher Implementers Group Meeting: Status Update
Eighth openCypher Implementers Group Meeting: Status Update
openCypher
 
Cypher for Gremlin
Cypher for GremlinCypher for Gremlin
Cypher for Gremlin
openCypher
 
Supporting dates and times in Cypher
Supporting dates and times in CypherSupporting dates and times in Cypher
Supporting dates and times in Cypher
openCypher
 
Seventh openCypher Implementers Group Meeting: Status Update
Seventh openCypher Implementers Group Meeting: Status UpdateSeventh openCypher Implementers Group Meeting: Status Update
Seventh openCypher Implementers Group Meeting: Status Update
openCypher
 
Academic research on graph processing: connecting recent findings to industri...
Academic research on graph processing: connecting recent findings to industri...Academic research on graph processing: connecting recent findings to industri...
Academic research on graph processing: connecting recent findings to industri...
openCypher
 
Property Graphs with Time
Property Graphs with TimeProperty Graphs with Time
Property Graphs with Time
openCypher
 
Cypher.PL: Executable Specification of Cypher written in Prolog
Cypher.PL: Executable Specification of Cypher written in PrologCypher.PL: Executable Specification of Cypher written in Prolog
Cypher.PL: Executable Specification of Cypher written in Prolog
openCypher
 
Use case: processing multiple graphs
Use case: processing multiple graphsUse case: processing multiple graphs
Use case: processing multiple graphs
openCypher
 
openCypher Technology Compatibility Kit (TCK)
openCypher Technology Compatibility Kit (TCK)openCypher Technology Compatibility Kit (TCK)
openCypher Technology Compatibility Kit (TCK)
openCypher
 

More from openCypher (20)

Learning Timed Automata with Cypher
Learning Timed Automata with CypherLearning Timed Automata with Cypher
Learning Timed Automata with Cypher
 
Incremental View Maintenance for openCypher Queries
Incremental View Maintenance for openCypher QueriesIncremental View Maintenance for openCypher Queries
Incremental View Maintenance for openCypher Queries
 
Formal semantics for Cypher queries and updates
Formal semantics for Cypher queries and updatesFormal semantics for Cypher queries and updates
Formal semantics for Cypher queries and updates
 
Cypher.PL: an executable specification of Cypher semantics
Cypher.PL: an executable specification of Cypher semanticsCypher.PL: an executable specification of Cypher semantics
Cypher.PL: an executable specification of Cypher semantics
 
Multiple Graphs: Updatable Views
Multiple Graphs: Updatable ViewsMultiple Graphs: Updatable Views
Multiple Graphs: Updatable Views
 
Micro-Servicing Linked Data
Micro-Servicing Linked DataMicro-Servicing Linked Data
Micro-Servicing Linked Data
 
Graph abstraction
Graph abstractionGraph abstraction
Graph abstraction
 
From Cypher 9 to GQL: Conceptual overview of multiple named graphs and compos...
From Cypher 9 to GQL: Conceptual overview of multiple named graphs and compos...From Cypher 9 to GQL: Conceptual overview of multiple named graphs and compos...
From Cypher 9 to GQL: Conceptual overview of multiple named graphs and compos...
 
Cypher for Gremlin
Cypher for GremlinCypher for Gremlin
Cypher for Gremlin
 
Comparing PGQL, G-Core and Cypher
Comparing PGQL, G-Core and CypherComparing PGQL, G-Core and Cypher
Comparing PGQL, G-Core and Cypher
 
Multiple graphs in openCypher
Multiple graphs in openCypherMultiple graphs in openCypher
Multiple graphs in openCypher
 
Eighth openCypher Implementers Group Meeting: Status Update
Eighth openCypher Implementers Group Meeting: Status UpdateEighth openCypher Implementers Group Meeting: Status Update
Eighth openCypher Implementers Group Meeting: Status Update
 
Cypher for Gremlin
Cypher for GremlinCypher for Gremlin
Cypher for Gremlin
 
Supporting dates and times in Cypher
Supporting dates and times in CypherSupporting dates and times in Cypher
Supporting dates and times in Cypher
 
Seventh openCypher Implementers Group Meeting: Status Update
Seventh openCypher Implementers Group Meeting: Status UpdateSeventh openCypher Implementers Group Meeting: Status Update
Seventh openCypher Implementers Group Meeting: Status Update
 
Academic research on graph processing: connecting recent findings to industri...
Academic research on graph processing: connecting recent findings to industri...Academic research on graph processing: connecting recent findings to industri...
Academic research on graph processing: connecting recent findings to industri...
 
Property Graphs with Time
Property Graphs with TimeProperty Graphs with Time
Property Graphs with Time
 
Cypher.PL: Executable Specification of Cypher written in Prolog
Cypher.PL: Executable Specification of Cypher written in PrologCypher.PL: Executable Specification of Cypher written in Prolog
Cypher.PL: Executable Specification of Cypher written in Prolog
 
Use case: processing multiple graphs
Use case: processing multiple graphsUse case: processing multiple graphs
Use case: processing multiple graphs
 
openCypher Technology Compatibility Kit (TCK)
openCypher Technology Compatibility Kit (TCK)openCypher Technology Compatibility Kit (TCK)
openCypher Technology Compatibility Kit (TCK)
 

Recently uploaded

Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 

Recently uploaded (20)

Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 

Formal Specification of Cypher

  • 1. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Formal Specification of Cypher Nadime Francis University of Edinburgh Wednesday, May, 10th 1 / 16
  • 2. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Property Graphs Person, Postdoc name : ‘Nadime’ institute : ‘UoE’ Person, Professor name : ‘Leonid’ institute : ‘UoE’ knows since : 2010 colleague since : 2015 A property graph is a tuple G = (N, R, s, t, ι, λ, τ), where: N ⊆ N: finite set of nodes R ⊆ R: finite set of relationships s : R → N: maps each relationship to its source t : R → N: maps each relationship to its target ι : (N ∪ R) × K → V: maps each x and k to x.k. λ : N → 2L: associates a set of label to each node τ : R → T : associates a type to each relationship 2 / 16
  • 3. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Records and Tables A record is a tuple with named fields : (a1 : v1, . . . , an : vn). A table is a bag of uniform records. Example: (a : 1, b : 3), (a : ‘oCIM 2’, b : ‘London’), (a : ‘oCIM’, b : ‘Walldorf’), (a : 1, b : 3) a b 1 3 ‘oCIM 2’ ‘London’ ‘oCIM’ ‘Walldorf’ 1 3 = a b ‘oCIM’ ‘Walldorf’ 1 3 ‘oCIM 2’ ‘London’ 1 3 3 / 16
  • 4. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Operations and Expressions An Example MATCH (n : Person) − [: knows]−> (m : Person) WHERE n.institute = m.institute RETURN n.name, m.name, n.institute AS institute 4 / 16
  • 5. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Operations and Expressions An Example MATCH (n : Person) − [: knows]−> (m : Person) WHERE n.institute = m.institute RETURN n.name, m.name, n.institute AS institute 4 / 16
  • 6. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Operations and Expressions An Example MATCH (n : Person) − [: knows]−> (m : Person) WHERE n.institute = m.institute RETURN n.name, m.name, n.institute AS institute n m {name : ‘Nadime’, institute : ‘UoE’} {name : ‘Leonid’, institute : ‘UoE’} {name : ‘Paolo’, institute : ‘UoE’} {name : ‘Nadime’, institute : ‘UoE’} {name : ‘Nadime’, institute : ‘UoE’} {name : ‘Stefan’, institute : ‘Neo’} {name : ‘Alastair’, institute : ‘Neo’} {name : ‘Stefan’, institute : ‘Neo’} 4 / 16
  • 7. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Operations and Expressions An Example MATCH (n : Person) − [: knows]−> (m : Person) WHERE n.institute = m.institute RETURN n.name, m.name, n.institute AS institute n m {name : ‘Nadime’, institute : ‘UoE’} {name : ‘Leonid’, institute : ‘UoE’} {name : ‘Paolo’, institute : ‘UoE’} {name : ‘Nadime’, institute : ‘UoE’} {name : ‘Alastair’, institute : ‘Neo’} {name : ‘Stefan’, institute : ‘Neo’} 4 / 16
  • 8. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Operations and Expressions An Example MATCH (n : Person) − [: knows]−> (m : Person) WHERE n.institute = m.institute RETURN n.name, m.name, n.institute AS institute n.name m.name institute ‘Nadime’ ‘Leonid’ UoE ‘Paolo’ ‘Nadime’ UoE ‘Alastair’ ‘Stefan’ Neo 4 / 16
  • 9. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Operations and Expressions Q = (α) MATCH (n : Person) − [: knows]−> (m : Person) (β) WHERE n.institute = m.institute (γ) RETURN n.name, m.name, n.institute AS institute 5 / 16
  • 10. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Operations and Expressions Q = (α) MATCH (n : Person) − [: knows]−> (m : Person) (β) WHERE n.institute = m.institute (γ) RETURN n.name, m.name, n.institute AS institute Operations [[op]]G : Tables → Tables Semantics of a query by composition Ex: [[Q]]G = [[α]]G ◦ [[β]]G ◦ [[γ]]G Answers to Q on G: [[Q]]G ({}) 5 / 16
  • 11. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Operations and Expressions Q = (α) MATCH (n : Person) − [: knows]−> (m : Person) (β) WHERE n.institute = m.institute (γ) RETURN n.name, m.name, n.institute AS institute Operations [[op]]G : Tables → Tables Semantics of a query by composition Ex: [[Q]]G = [[α]]G ◦ [[β]]G ◦ [[γ]]G Answers to Q on G: [[Q]]G ({}) Expressions [[exp]]G,u ∈ V where u is a record, giving binding to variables Ex: [[β]]G (T) = u ∈ T | [[n.institute = m.institute]]G,u = true 5 / 16
  • 12. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Pattern Matching Rigid pattern satisfaction Rigid path pattern: no variable length edge patterns. Ex: (n : Person) − [: knows ∗ 2]−> () − [: likes]−> (m : Movie) Unique way for a path p to satisfy a rigid pattern π wrt G, u. Notation: (p, G, u) |= π 6 / 16
  • 13. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Pattern Matching Rigid pattern satisfaction Rigid path pattern: no variable length edge patterns. Ex: (n : Person) − [: knows ∗ 2]−> () − [: likes]−> (m : Movie) Unique way for a path p to satisfy a rigid pattern π wrt G, u. Notation: (p, G, u) |= π Variable-length paths and free variables rigid(π) = {π | π is rigid and π π } Ex: () − [∗2]−> () − [∗4]−> () () − [∗1..3]−> () − [∗]−> () free(π, u): all names that occur in π and not in u 6 / 16
  • 14. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Pattern Matching Rigid pattern satisfaction Rigid path pattern: no variable length edge patterns. Ex: (n : Person) − [: knows ∗ 2]−> () − [: likes]−> (m : Movie) Unique way for a path p to satisfy a rigid pattern π wrt G, u. Notation: (p, G, u) |= π Variable-length paths and free variables rigid(π) = {π | π is rigid and π π } Ex: () − [∗2]−> () − [∗4]−> () () − [∗1..3]−> () − [∗]−> () free(π, u): all names that occur in π and not in u [[MATCH π]]G (T) = π ∈rigid(π) u∈T, p∈paths (u, u ) u is uniform with free(π , u) and (p, G, (u, u )) |= π 6 / 16
  • 15. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Ambiguous and Edge Cases 7 / 16
  • 16. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Nulls in Patterns MATCH (n : Person {name : null}) RETURN (n) 8 / 16
  • 17. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Nulls in Patterns MATCH (n : Person {name : null}) RETURN (n) 1 Every node n with a name property? 2 Every node n such that n.name IS NULL = true? 3 Nothing? 8 / 16
  • 18. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Nulls in Patterns MATCH (n : Person {name : null}) RETURN (n) 1 Every node n with a name property? 2 Every node n such that n.name IS NULL = true? 3 Nothing! Because Q is actually equivalent to: MATCH (n : Person) WHERE n.name = null RETURN (n) 8 / 16
  • 19. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Map Comparisons When does {k1 : v1, . . . , kn : vn} = { 1 : w1, . . . , m : wm} return true, false or null? {name : null} = {} {name : null} = {name : null} {a : 1, b : 2} = {b : 2, a : 1} {a : 1, a : 2} = {a : 2} 9 / 16
  • 20. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Map Comparisons When does {k1 : v1, . . . , kn : vn} = { 1 : w1, . . . , m : wm} return true, false or null? false {name : null} = {} true {name : null} = {name : null} true {a : 1, b : 2} = {b : 2, a : 1} true {a : 1, a : 2} = {a : 2} Neither purely syntactic, nor ∀k, m1.k = m2.k. 9 / 16
  • 21. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Setting Properties using a Map WITH {name : null} AS map CREATE (n) SET n = map RETURN (n) 10 / 16
  • 22. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Setting Properties using a Map WITH {name : null} AS map CREATE (n) SET n = map RETURN (n) Returns n as {}. The property map of n is not equal to the map it was set to. In particular, n {.∗} = map returns false. 10 / 16
  • 23. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases MATCH with no Free Variables MATCH () RETURN ∗ MATCH () RETURN 1 11 / 16
  • 24. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases MATCH with no Free Variables Fail MATCH () RETURN ∗ RETURN ∗ is not allowed with no variable in scope. Pass MATCH () RETURN 1 Returns as many copies of 1 as nodes in the database. After MATCH (), the active table is a bag containing multiple copies of the empty record. 11 / 16
  • 25. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Incomplete and Inconsistent Cases 12 / 16
  • 26. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Repeating UNWINDs UNWIND [1, 2, 3] AS r UNWIND r AS s RETURN s UNWIND [[1, 2], 3] AS r UNWIND r AS s RETURN s 13 / 16
  • 27. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Repeating UNWINDs Fail UNWIND [1, 2, 3] AS r UNWIND r AS s RETURN s Type mismatch, expected List but was Integer. Pass UNWIND [[1, 2], 3] AS r UNWIND r AS s RETURN s Returns a column with 1, 2 and 3 as rows. 13 / 16
  • 28. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Repeating UNWINDs Fail UNWIND [1, 2, 3] AS r UNWIND r AS s RETURN s Type mismatch, expected List but was Integer. Pass UNWIND [[1, 2], 3] AS r UNWIND r AS s RETURN s Returns a column with 1, 2 and 3 as rows. UNWIND [[1, 2], 3] AS r UNWIND r AS s UNWIND s AS t UNWIND t AS u RETURN u Actually works, and returns a column with 1, 2 and 3 as rows. 13 / 16
  • 29. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Violating Cyphermorphism Q0 = MATCH (x) − [r] − (y) − [r] − (z) RETURN x, y, z 14 / 16
  • 30. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Violating Cyphermorphism Q0 = MATCH (x) − [r] − (y) − [r] − (z) RETURN x, y, z Error: cannot use the same relationship variable ‘r’ for multiple patterns. 14 / 16
  • 31. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Violating Cyphermorphism Q0 = MATCH (x) − [r] − (y) − [r] − (z) RETURN x, y, z Error: cannot use the same relationship variable ‘r’ for multiple patterns. Q1 = MATCH (x) − [r∗] − (y) − [r∗] − (z) RETURN x, y, z 14 / 16
  • 32. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Violating Cyphermorphism Q0 = MATCH (x) − [r] − (y) − [r] − (z) RETURN x, y, z Error: cannot use the same relationship variable ‘r’ for multiple patterns. Q1 = MATCH (x) − [r∗] − (y) − [r∗] − (z) RETURN x, y, z Works and enforces the paths from x to y and from y to z to use the same sequence of relationships, violating Cyphermorphism. 14 / 16
  • 33. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Violating Cyphermorphism Q0 = MATCH (x) − [r] − (y) − [r] − (z) RETURN x, y, z Error: cannot use the same relationship variable ‘r’ for multiple patterns. Q1 = MATCH (x) − [r∗] − (y) − [r∗] − (z) RETURN x, y, z Works and enforces the paths from x to y and from y to z to use the same sequence of relationships, violating Cyphermorphism. It is not included in the query Q2 below: Q1 = MATCH (x) − [r∗] − (y) − [s∗] − (z) RETURN x, y, z 14 / 16
  • 34. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Two Small Issues: Nulls as Indices and Keys, and Naming RETURN 1 AS ‘0‘, 0 15 / 16
  • 35. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Two Small Issues: Nulls as Indices and Keys, and Naming Fail RETURN 1 AS ‘0‘, 0 Multiple result columns with the same name are not supported. Need to specify how expression naming is handled. 15 / 16
  • 36. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Two Small Issues: Nulls as Indices and Keys, and Naming Fail RETURN 1 AS ‘0‘, 0 Multiple result columns with the same name are not supported. Need to specify how expression naming is handled. [1, 2, 3][null] [1, 2, 3][null..4] {name : ‘Nadime’} [null] 15 / 16
  • 37. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Two Small Issues: Nulls as Indices and Keys, and Naming Fail RETURN 1 AS ‘0‘, 0 Multiple result columns with the same name are not supported. Need to specify how expression naming is handled. Fail [1, 2, 3][null] [1, 2, 3][null..4] {name : ‘Nadime’} [null] No error, never terminates. 15 / 16
  • 38. Semantics Overview Ambiguous and Edge Cases Incomplete and Inconsistent Cases Thank you! 16 / 16