Execute Raw Query
Execute a raw Cypher query against the asset model.
Signature
Section titled “Signature”executeRawQuery(query, output="json")
query(str)output(str):json(default),df,raw
Inputs
Section titled “Inputs”query: Cypher query string to run.output: Output format selector.
Examples
Section titled “Examples”JSON output (default)
Section titled “JSON output (default)”For a simple model, where we assume the only properties on a node are code and name
results = model.executeRawQuery("MATCH (n) RETURN n LIMIT 2")Response (json):
[ { "n": { "code": "System_01", "name": "System 01" } }, { "n": { "code": "System_02", "name": "System 02" } }]DataFrame output
Section titled “DataFrame output”results_df = model.executeRawQuery("MATCH (n) RETURN n LIMIT 5", output="df") n.code n.name0 System_01 System 011 System_02 System 02Raw output
Section titled “Raw output”raw = model.executeRawQuery("MATCH (n) RETURN n LIMIT 5", output="raw"){ "success": true, "response": { "data": [{ "n": { "code": "System_01", "name": "System 01" } }] }}