A.6.1.2 Dynamic Graph Loading from OOB Graph
This notebook provides the sample PGQL queries for dynamically loading graphs from property graphs (PG VIEWS) in the database.
Note:
This notebook is created for sample purpose only.To access the sample PGQL queries for loading subgraph, follow these steps:
- Click Dynamic Graph Loading from OOB Graph. The notebook
page is displayed.
Figure A-20 Dynamic Graph Loading from OOB Graph
- Click PGQL Queries group to view the list of sample
queries to be executed for loading the subgraph as described in the following
table.
Table A-2 Sample PGQL Query
PGQL Query Description MATCH (p)-[e]-(m) This will load the complete property graph. MATCH (p:"label(p)")- [e:"label(e)"]-(m:"label(m)") This will load two node providers and the corresponding edge provider to connect two nodes. Note: Replace label (p) and label (m) with the node provider names and label (e) with the edge provider name.
MATCH (p:"label(p)")- [e:"label(e)"]-(m:"label(m)") WHERE id(p)="label(p)(Id)" This will load the graph corresponding to the Id. Multiple conditions can be included similarly in the WHERE clause, separated by " AND "OR" condition. Note: Replace label (p) and label (m) with the node provider names and label (e) with the edge provider name. Replace Id with the Id property value
"MATCH (p:"label(p)")-()-()- (m:"label(m)") WHERE id(p) = 'label(p)(Id)" This will only load p and m vertices, but not the edge or vertices linking them. Note: Replace label (p) and label (m) with the node provider names and replace Id with the Id property value.
"MATCH ()" This is not allowed as the query must have at least one vertex. Note: This query is not allowed for execution.
"MATCH ()-[e]-()" This is not allowed for loading an edge because it should load both the source and destination vertex. Note: This query is not allowed for execution.
"MATCH (v)-[e]-()" This is not allowed for loading an edge because it should load both the source and destination vertex. Note: This query is not allowed for execution.