PGX 19.2.0 extends support of PGQL language features in distributed execution mode.
In distributed execution mode, users can now use an IN filter expression within the WHERE clause of PGQL queries:
SELECT ... MATCH (a:person)-[e:likes]->(b:post) WHERE a.name IN ('Emily', 'Paul', 'Juan')
In distributed execution mode, users can now run PGQL queries on the session, specifying the graph in the FROM clause.
This means that after loading a graph:
graph = session.readGraphWithProperties("graph.elist.json", "my_graph")
one can now execute:
session.queryPgql("SELECT a FROM my_graph MATCH (a)")
in addition to being able to execute PGQL directly on the graph:
graph.queryPgql("SELECT a MATCH (a)")
In distributed execution mode, users can now perform distinct aggregations without group-by in PGQL queries:
SELECT SUM(DISTINCT a.age) MATCH (a:person)
In distributed execution mode, users can now project literals:
graph.queryPgql("SELECT a, 1, 0.1 AS my_double, 'string', true MATCH (a)")
PGX 19.2.0 extends support for heterogeneous graphs with new features.
It is now possible to load homogeneous graphs in the CSV, FLAT_FILE, TWO_TABLES RDBMS and PG formats as heterogeneous graphs based on the vertex labels and edge labels.
The following Analyst algorithms can now run on on heterogeneous graphs:
With 19.2.0, we also introduce some new features in beta mode, for which the syntax and semantics might change in future versions.
MODIFYQueries Through PGQL
Users can now do the following modifications on graphs in PGQL queries: * update value of existing session local properties * insert new vertices and edges into session local graphs * delete vertices and edges from session local graphs
The syntax is modified such that a
MODIFY query can contain at most one of each modifications (INSERT/UPDATE/DELETE).
MODIFY query is executed on the matched results with snapshot isolation semantics,
thus different DML operations under the same
MODIFY clause don't see the result of each other.
MODIFY query returns
MODIFY query for updating the value of property
age of every person named John changes to the following
MODIFY/*beta*/ g ( UPDATE v SET PROPERTIES ( v.age = 42 ) ) FROM g MATCH (v:Person) WHERE v.name = 'John'
Multiple updates can be executed following the same semantics as in 19.1.0 using the following syntax
MODIFY/*beta*/ g ( UPDATE v SET PROPERTIES ( v.age = 42 ), u SET PROPERTIES ( u.weight = 3500 ) ) FROM g MATCH (v:Person) <-[:belongs_to]- (u:Car) WHERE v.name = 'John'
New vertices can be inserted using the
INSERT VERTEX clause.
MODIFY/*beta*/ g ( INSERT VERTEX u LABELS ('Male') PROPERTIES ( u.age = 42 ) ) FROM g MATCH (v:Person) WHERE v.name = 'John'
New edges can be inserted using the
INSERT EDGE construct.
MODIFY/*beta*/ g ( INSERT EDGE e BETWEEN v AND u LABELS ('has') PROPERTIES ( e.since = DATE '2017-09-21' ) ) FROM g MATCH (v:Person), (u: Car) WHERE v.name = 'John' AND u.id = 'ABC-123'
Entities can be deleted by enumerating them under the
DELETE construct. For example
MODIFY/*beta*/ g ( DELETE e, v ) FROM g MATCH (v:Person)-[e]->(u: Car) WHERE v.name = 'John' AND u.id = 'ABC-123'
More details on
MODIFY queries can be found here