I am using the latest Neo4j Python driver 5.9 that supports driver.execute_query
can the query passed to it be APOC strerd procedure like apoc.path.expandConfig?
I have a query using above apoc that in browser returns rows but not using execute_query
I have written a simple function
def RunQuery ( driver, query_str , db , parameters ):
try:
print ( query_str )
records, summary, keys = driver.execute_query ( query_str , parameters_ = parameters, database = db )
return records, summary, keys
except Exception as e:
print(e)
my query string is this:
str = '''
match ( t:PartRevision) where t.name = 'CROSSKART_DC'
WITH t
CALL apoc.path.expandConfig(
t,
{
labelFilter:"PartRevision, Base",
relationshipFilter:"HAS_PARENT<, +`Latest Working`> | -`Engineering Released`>",
uniqueness: "NODE_GLOBAL",
minLevel : 1,
maxLevel : 3,
bfs : false
}) YIELD path
RETURN path , length(path ) as hops
order by hops
'''
and then i am calling this
r,s,k = RunQuery ( driver, str , db= 'crosscart', parameters = {} )
print("The query `{query}` returned {records_count} records in {time} ms.".format(
query=s.query, records_count=len(r),
time=s.result_available_after
))
The query match ( t:PartRevision) where t.name = 'CROSSKART_DC' WITH t CALL apoc.path.expandConfig( t, { labelFilter:"PartRevision, Base", relationshipFilter:"HAS_PARENT<, +
Latest Working> | -
Engineering Released>", uniqueness: "NODE_GLOBAL", minLevel : 1, maxLevel : 3, bfs : false }) YIELD path RETURN path , length(path ) as hops order by hops
returned 0 records in 1 ms.
this returns zero rows.
i have tested this process with other queries and it works fine.
i am wondering for a limitation caused by apoc stored procedure. can apoc be called from driver.execute_query ?