Graph functions
graph.names()
Returns a list containing the names of all graphs on the current composite database. It is only supported on composite databases.
CREATE DATABASE dba;
CREATE DATABASE dbb;
CREATE DATABASE dbc;
CREATE COMPOSITE DATABASE composite;
CREATE ALIAS composite.first FOR DATABASE dba;
CREATE ALIAS composite.second FOR DATABASE dbb;
CREATE ALIAS composite.third FOR DATABASE dbc;
RETURN graph.names() AS name
The names of all graphs on the current composite database are returned.
name |
---|
|
|
|
Rows: 3 |
graph.propertiesByName()
Returns a map containing the properties associated with the given graph. The properties are set on the alias that adds the graph as a constituent of a composite database. It is only supported on composite databases.
CREATE DATABASE dba;
CREATE DATABASE dbb;
CREATE DATABASE dbc;
CREATE COMPOSITE DATABASE composite;
CREATE ALIAS composite.first FOR DATABASE dba
PROPERTIES {number: 1, tags: ['A', 'B']};
CREATE ALIAS composite.second FOR DATABASE dbb
PROPERTIES {number: 0, tags: ['A']};
CREATE ALIAS composite.third FOR DATABASE dbc
PROPERTIES {number: 2, tags: ['B', 'C']};
UNWIND graph.names() AS name
RETURN name, graph.propertiesByName(name) AS props
Properties for all graphs on the current composite database are returned.
name | props |
---|---|
|
|
|
|
|
|
Rows: 3 |
UNWIND graph.names() AS name
WITH name, graph.propertiesByName(name) AS props
WHERE "A" IN props.tags
CALL {
USE graph.byName(name)
MATCH (n)
RETURN n
}
RETURN n
Returns all nodes from a subset of graphs that have a tags
property containing "A"
.
graph.byName()
Resolves a constituent graph by name.
It is only supported in the USE
clause, on composite databases.
UNWIND graph.names() AS graphName
CALL {
USE graph.byName(graphName)
MATCH (n)
RETURN n
}
RETURN n
Returns all nodes from all graphs on the current composite database.
Was this page helpful?