Skip to content

Execute Raw Query

Execute a raw Cypher query against the asset model.

executeRawQuery(query, output="json")

  • query (str)
  • output (str): json (default), df, raw
  • query: Cypher query string to run.
  • output: Output format selector.

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" } }
]
results_df = model.executeRawQuery("MATCH (n) RETURN n LIMIT 5", output="df")
n.code n.name
0 System_01 System 01
1 System_02 System 02
raw = model.executeRawQuery("MATCH (n) RETURN n LIMIT 5", output="raw")
{
"success": true,
"response": {
"data": [{ "n": { "code": "System_01", "name": "System 01" } }]
}
}