SlideShare a Scribd company logo
1 of 12
Download to read offline
opencypher.org | opencypher@googlegroups.comopencypher.org | opencypher@googlegroups.com
Multiple Graph Processing
Naming and Addressing
Alastair Green
Neo Technology Cypher Language Group
opencypher.org | opencypher@googlegroups.com
Problem #1 Loading and saving
> 1 Store → > 1 persistent graph
Local File
System
BOLT
opencypher.org | opencypher@googlegroups.com
Problem #1 Loading and saving
Neo4j instance
= 1 graph
Local File
System
BOLT GraphX/Frame
conventional
V+E files = 1
graph
Neo4j CSV
fileset = 1 graph
.graphml = 1
graph
.nq = n graphs
opencypher.org | opencypher@googlegroups.com
Containers and storage (rep + encoding) standards
Storage type Container type URI scheme Storage Format PG?
Neo4j Neo4j Server bolt:// Opaque Y
CSV fileset LFS, HDFS ... file://, hdfs:// Under-specified Y
.graphml LFS, HDFS ... file://, hdfs:// Well-specified N
GraphX/Frames
V+E files
HDFS, LFS, ... file://, hdfs:// Under-specified N
N-Quads LFS, HDFS, ... file://, hdfs:// Well-specified N
...
opencypher.org | opencypher@googlegroups.com
URI [+ directory/file convention] [+ PG convention]
How do we know where to find edges and vertices?
file:///path/to/the/data/devices/edges/*.csv | .txt
file:///path/to/the/data/devices/vertices/*.csv
How do we know where to find labels/types in *.csv?
What happens if we want to model graph properties?
■ These questions have to be answered by (small) specifications
■ Conventional/assumed answers may not be systematic or complete
opencypher.org | opencypher@googlegroups.com
graph:// URIs
A URI scheme that can
■ incorporate other URI schemes
■ register/refer to sub-specifications or URI scheme extensions that define
PG conventions
■ allow the hierarchical path convention used by many URI schemes to be
used to locate/identify containers or “spaces”
■ allows every path to terminate with the unqualfied name of a graph
graph://bolt/’bolt+routing://neo4j-server:4567/social-networks/europe’
The meaning/depth of the path is implementation determined
It might imply folders, partitions or instances or tenants … or nothing
opencypher.org | opencypher@googlegroups.com
Loading and saving graphs in Cypher queries*
IN GRAPH
EuropeSocialNetwork
AT
graph://bolt/’bolt+routing://neo4j-server:4567/social-networks/europe’
MATCH
(p1)-[:friends]-(p2)-[:friends]-(p3)-[:friends]-(p1)
CREATE
(t:FriendsTriangle),
(t)-[:contains]->(p1),
(t)-[:contains]->(p2),
(t)-[:contains]->(p3)
IN GRAPH
FriendsTriangles
AT
graph://graphml+pg/’hdfs://my-big-data/europe/snapshots/2017-08-23/friendsTriangles’
* Example use case and pattern concepts from LDBC QL TF input by Hannes Voigt
Load
Save
opencypher.org | opencypher@googlegroups.com
Or perhaps … or as well
GRAPH [europe]
AT
graph://bolt/’bolt+routing://neo4j-server:4567/social-networks/europe’
IN GRAPH
europe
MATCH
(p1)-[:friends]-(p2)-[:friends]-(p3)-[:friends]-(p1)
DEFAULT GRAPH AT
graph://bolt/’bolt+routing://neo4j-server:4567/social-networks/europe’
MATCH
(p1)-[:friends]-(p2)-[:friends]-(p3)-[:friends]-(p1)
Implicit?
Anonymous
Explicit
opencypher.org | opencypher@googlegroups.com
Problem #2 Graphs in the scope of queries
Cypher queries are made up of parts
■ Intermediate results are chained from part to part
■ We will want to allow those results to be graphs
■ There could be more than one, so names are needed
■ And it might be good to allow intermediate graphs to be persisted
WITH or IN?
A named graph could have global scope in the query (cf. current Cypher anon graph)
This would mean it could always be referred to in a later part
And also used in RETURN as a final result
opencypher.org | opencypher@googlegroups.com
Problem #3 Graphs in the scope of sub-queries
A sub-query must be able to return a graph
IN
{IN GRAPH someGraph MATCH CREATE ... AS GRAPH} // anonymous
MATCH
...
and it might be useful to name it (and perhaps persist it) for later reference
DECLARE DEFAULT GRAPH AT
graph://bolt/’bolt+routing://neo4j-server:4567/social-networks/europe’
IN
{MATCH ... CREATE ... AS GRAPH g [AT <url>]} // named [optionally saved]
MATCH
...
opencypher.org | opencypher@googlegroups.com
Problem #4 Queries returning graphs
Persisting a graph is not the same as returning a graph to a caller
■ Critical to allowing graph queries to be part of function chains
■ May be more than one graph that results from a query
■ If so then each graph needs a name
CREATE
(t:FriendsTriangle), (t)-[:contains]->(p1),
(t)-[:contains]->(p2),(t)-[:contains]->(p3)
IN GRAPH
FriendsTriangles
RETURN
FriendsTriangles
opencypher.org | opencypher@googlegroups.com
Problem #5 Views
Logically we compose queries as functions over views q(v(G))
IN GRAPH
EuropeSocialNetwork
MATCH
(p1)-[:friends]-(p2)-[:friends]-(p3)-[:friends]-(p1)
CREATE
(t:FriendsTriangle), (t)-[:contains]->(p1),
(t)-[:contains]->(p2), (t)-[:contains]->(p3)
IN GRAPH
FriendsTriangles AS VIEW
IN GRAPH
FriendsTriangles
MATCH
...

More Related Content

What's hot

Interoperability with netCDF-4 - Experience with NPP and HDF-EOS5 products
Interoperability with netCDF-4 - Experience with NPP and HDF-EOS5 productsInteroperability with netCDF-4 - Experience with NPP and HDF-EOS5 products
Interoperability with netCDF-4 - Experience with NPP and HDF-EOS5 products
The HDF-EOS Tools and Information Center
 
06 Justenough Information
06 Justenough Information06 Justenough Information
06 Justenough Information
Adithya Rao
 

What's hot (20)

Substituting HDF5 tools with Python/H5py scripts
Substituting HDF5 tools with Python/H5py scriptsSubstituting HDF5 tools with Python/H5py scripts
Substituting HDF5 tools with Python/H5py scripts
 
HDF5 Tools
HDF5 ToolsHDF5 Tools
HDF5 Tools
 
Interoperability with netCDF-4 - Experience with NPP and HDF-EOS5 products
Interoperability with netCDF-4 - Experience with NPP and HDF-EOS5 productsInteroperability with netCDF-4 - Experience with NPP and HDF-EOS5 products
Interoperability with netCDF-4 - Experience with NPP and HDF-EOS5 products
 
HDF Group Support for NPP/NPOESS/JPSS
HDF Group Support for NPP/NPOESS/JPSSHDF Group Support for NPP/NPOESS/JPSS
HDF Group Support for NPP/NPOESS/JPSS
 
The State of Go - Andrew Gerrand
The State of Go - Andrew Gerrand The State of Go - Andrew Gerrand
The State of Go - Andrew Gerrand
 
Compiler Construction | Lecture 15 | Memory Management
Compiler Construction | Lecture 15 | Memory ManagementCompiler Construction | Lecture 15 | Memory Management
Compiler Construction | Lecture 15 | Memory Management
 
NASA HDF/HDF-EOS Data Access Challenges
NASA HDF/HDF-EOS Data Access ChallengesNASA HDF/HDF-EOS Data Access Challenges
NASA HDF/HDF-EOS Data Access Challenges
 
carrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-APIcarrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-API
 
How it's made: C++ compilers (GCC)
How it's made: C++ compilers (GCC)How it's made: C++ compilers (GCC)
How it's made: C++ compilers (GCC)
 
Go. why it goes v2
Go. why it goes v2Go. why it goes v2
Go. why it goes v2
 
[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy
[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy
[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy
 
Pivot tables mysql_5
Pivot tables mysql_5Pivot tables mysql_5
Pivot tables mysql_5
 
C Under Linux
C Under LinuxC Under Linux
C Under Linux
 
History of c++
History of c++ History of c++
History of c++
 
History of c++
History of c++History of c++
History of c++
 
Introduction to cython: example of GCoptimization
Introduction to cython: example of GCoptimizationIntroduction to cython: example of GCoptimization
Introduction to cython: example of GCoptimization
 
OrientDB and Hazelcast
OrientDB and HazelcastOrientDB and Hazelcast
OrientDB and Hazelcast
 
Padding oracle [opkoko2011]
Padding oracle [opkoko2011]Padding oracle [opkoko2011]
Padding oracle [opkoko2011]
 
Open Source .NET
Open Source .NETOpen Source .NET
Open Source .NET
 
06 Justenough Information
06 Justenough Information06 Justenough Information
06 Justenough Information
 

Similar to openCypher: Naming and Addressing Multiple Graphs

syslog-ng: from log collection to processing and information extraction
syslog-ng: from log collection to processing and information extractionsyslog-ng: from log collection to processing and information extraction
syslog-ng: from log collection to processing and information extraction
BalaBit
 

Similar to openCypher: Naming and Addressing Multiple Graphs (20)

Beyond printk: Efficient Zynq UltraScale+ MPSoC Linux Debugging and Development
Beyond printk: Efficient Zynq UltraScale+ MPSoC Linux Debugging and DevelopmentBeyond printk: Efficient Zynq UltraScale+ MPSoC Linux Debugging and Development
Beyond printk: Efficient Zynq UltraScale+ MPSoC Linux Debugging and Development
 
Experiences building a distributed shared log on RADOS - Noah Watkins
Experiences building a distributed shared log on RADOS - Noah WatkinsExperiences building a distributed shared log on RADOS - Noah Watkins
Experiences building a distributed shared log on RADOS - Noah Watkins
 
Deep learning - the conf br 2018
Deep learning - the conf br 2018Deep learning - the conf br 2018
Deep learning - the conf br 2018
 
Debugging node in prod
Debugging node in prodDebugging node in prod
Debugging node in prod
 
Bluemix hadoop beginners Guide part I
Bluemix hadoop beginners Guide part IBluemix hadoop beginners Guide part I
Bluemix hadoop beginners Guide part I
 
FreeBSD Document Project
FreeBSD Document ProjectFreeBSD Document Project
FreeBSD Document Project
 
Reproducible Computational Research in R
Reproducible Computational Research in RReproducible Computational Research in R
Reproducible Computational Research in R
 
Composer
ComposerComposer
Composer
 
Compiling P4 to XDP, IOVISOR Summit 2017
Compiling P4 to XDP, IOVISOR Summit 2017Compiling P4 to XDP, IOVISOR Summit 2017
Compiling P4 to XDP, IOVISOR Summit 2017
 
Hdf5 intro
Hdf5 introHdf5 intro
Hdf5 intro
 
Go. Why it goes
Go. Why it goesGo. Why it goes
Go. Why it goes
 
AfterGlow
AfterGlowAfterGlow
AfterGlow
 
Dgraph: Graph database for production environment
Dgraph:  Graph database for production environmentDgraph:  Graph database for production environment
Dgraph: Graph database for production environment
 
Introduction to HDF5
Introduction to HDF5Introduction to HDF5
Introduction to HDF5
 
Conference 2014: Rajat Arya - Deployment with GraphLab Create
Conference 2014: Rajat Arya - Deployment with GraphLab Create Conference 2014: Rajat Arya - Deployment with GraphLab Create
Conference 2014: Rajat Arya - Deployment with GraphLab Create
 
syslog-ng: from log collection to processing and information extraction
syslog-ng: from log collection to processing and information extractionsyslog-ng: from log collection to processing and information extraction
syslog-ng: from log collection to processing and information extraction
 
Large-scale Recommendation Systems on Just a PC
Large-scale Recommendation Systems on Just a PCLarge-scale Recommendation Systems on Just a PC
Large-scale Recommendation Systems on Just a PC
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024
 
Reading HDF family of formats via NetCDF-Java / CDM
Reading HDF family of formats via NetCDF-Java / CDMReading HDF family of formats via NetCDF-Java / CDM
Reading HDF family of formats via NetCDF-Java / CDM
 
Apache Flink internals
Apache Flink internalsApache Flink internals
Apache Flink internals
 

More from 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

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

openCypher: Naming and Addressing Multiple Graphs

  • 1. opencypher.org | opencypher@googlegroups.comopencypher.org | opencypher@googlegroups.com Multiple Graph Processing Naming and Addressing Alastair Green Neo Technology Cypher Language Group
  • 2. opencypher.org | opencypher@googlegroups.com Problem #1 Loading and saving > 1 Store → > 1 persistent graph Local File System BOLT
  • 3. opencypher.org | opencypher@googlegroups.com Problem #1 Loading and saving Neo4j instance = 1 graph Local File System BOLT GraphX/Frame conventional V+E files = 1 graph Neo4j CSV fileset = 1 graph .graphml = 1 graph .nq = n graphs
  • 4. opencypher.org | opencypher@googlegroups.com Containers and storage (rep + encoding) standards Storage type Container type URI scheme Storage Format PG? Neo4j Neo4j Server bolt:// Opaque Y CSV fileset LFS, HDFS ... file://, hdfs:// Under-specified Y .graphml LFS, HDFS ... file://, hdfs:// Well-specified N GraphX/Frames V+E files HDFS, LFS, ... file://, hdfs:// Under-specified N N-Quads LFS, HDFS, ... file://, hdfs:// Well-specified N ...
  • 5. opencypher.org | opencypher@googlegroups.com URI [+ directory/file convention] [+ PG convention] How do we know where to find edges and vertices? file:///path/to/the/data/devices/edges/*.csv | .txt file:///path/to/the/data/devices/vertices/*.csv How do we know where to find labels/types in *.csv? What happens if we want to model graph properties? ■ These questions have to be answered by (small) specifications ■ Conventional/assumed answers may not be systematic or complete
  • 6. opencypher.org | opencypher@googlegroups.com graph:// URIs A URI scheme that can ■ incorporate other URI schemes ■ register/refer to sub-specifications or URI scheme extensions that define PG conventions ■ allow the hierarchical path convention used by many URI schemes to be used to locate/identify containers or “spaces” ■ allows every path to terminate with the unqualfied name of a graph graph://bolt/’bolt+routing://neo4j-server:4567/social-networks/europe’ The meaning/depth of the path is implementation determined It might imply folders, partitions or instances or tenants … or nothing
  • 7. opencypher.org | opencypher@googlegroups.com Loading and saving graphs in Cypher queries* IN GRAPH EuropeSocialNetwork AT graph://bolt/’bolt+routing://neo4j-server:4567/social-networks/europe’ MATCH (p1)-[:friends]-(p2)-[:friends]-(p3)-[:friends]-(p1) CREATE (t:FriendsTriangle), (t)-[:contains]->(p1), (t)-[:contains]->(p2), (t)-[:contains]->(p3) IN GRAPH FriendsTriangles AT graph://graphml+pg/’hdfs://my-big-data/europe/snapshots/2017-08-23/friendsTriangles’ * Example use case and pattern concepts from LDBC QL TF input by Hannes Voigt Load Save
  • 8. opencypher.org | opencypher@googlegroups.com Or perhaps … or as well GRAPH [europe] AT graph://bolt/’bolt+routing://neo4j-server:4567/social-networks/europe’ IN GRAPH europe MATCH (p1)-[:friends]-(p2)-[:friends]-(p3)-[:friends]-(p1) DEFAULT GRAPH AT graph://bolt/’bolt+routing://neo4j-server:4567/social-networks/europe’ MATCH (p1)-[:friends]-(p2)-[:friends]-(p3)-[:friends]-(p1) Implicit? Anonymous Explicit
  • 9. opencypher.org | opencypher@googlegroups.com Problem #2 Graphs in the scope of queries Cypher queries are made up of parts ■ Intermediate results are chained from part to part ■ We will want to allow those results to be graphs ■ There could be more than one, so names are needed ■ And it might be good to allow intermediate graphs to be persisted WITH or IN? A named graph could have global scope in the query (cf. current Cypher anon graph) This would mean it could always be referred to in a later part And also used in RETURN as a final result
  • 10. opencypher.org | opencypher@googlegroups.com Problem #3 Graphs in the scope of sub-queries A sub-query must be able to return a graph IN {IN GRAPH someGraph MATCH CREATE ... AS GRAPH} // anonymous MATCH ... and it might be useful to name it (and perhaps persist it) for later reference DECLARE DEFAULT GRAPH AT graph://bolt/’bolt+routing://neo4j-server:4567/social-networks/europe’ IN {MATCH ... CREATE ... AS GRAPH g [AT <url>]} // named [optionally saved] MATCH ...
  • 11. opencypher.org | opencypher@googlegroups.com Problem #4 Queries returning graphs Persisting a graph is not the same as returning a graph to a caller ■ Critical to allowing graph queries to be part of function chains ■ May be more than one graph that results from a query ■ If so then each graph needs a name CREATE (t:FriendsTriangle), (t)-[:contains]->(p1), (t)-[:contains]->(p2),(t)-[:contains]->(p3) IN GRAPH FriendsTriangles RETURN FriendsTriangles
  • 12. opencypher.org | opencypher@googlegroups.com Problem #5 Views Logically we compose queries as functions over views q(v(G)) IN GRAPH EuropeSocialNetwork MATCH (p1)-[:friends]-(p2)-[:friends]-(p3)-[:friends]-(p1) CREATE (t:FriendsTriangle), (t)-[:contains]->(p1), (t)-[:contains]->(p2), (t)-[:contains]->(p3) IN GRAPH FriendsTriangles AS VIEW IN GRAPH FriendsTriangles MATCH ...