@@ -541,23 +541,31 @@ def opencypher_http(self, query: str, headers: dict = None, explain: str = None,
541541 if headers is None :
542542 headers = {}
543543
544- url = f'{ self ._http_protocol } ://{ self .host } : { self . port } / '
544+ url = f'{ self ._http_protocol } ://{ self .host } '
545545
546546 if self .is_neptune_domain ():
547- if 'content-type' not in headers :
548- headers ['content-type' ] = 'application/x-www-form-urlencoded'
549- url += 'openCypher'
550547 data = {}
548+ if self .is_analytics_domain ():
549+ url += f'/queries'
550+ data ['language' ] = 'opencypher'
551+ else :
552+ if 'content-type' not in headers :
553+ headers ['content-type' ] = 'application/x-www-form-urlencoded'
554+ url += f':{ self .port } /openCypher'
551555 if plan_cache :
552556 if plan_cache not in OPENCYPHER_PLAN_CACHE_MODES :
553557 print ('Invalid --plan-cache mode specified, defaulting to auto.' )
554558 else :
555- if self .is_analytics_domain ():
556- data ['planCache' ] = plan_cache
557- elif plan_cache != 'auto' :
558- query = set_plan_cache_hint (query , plan_cache )
559+ if plan_cache != 'auto' :
560+ if self .is_analytics_domain ():
561+ data ['planCache' ] = plan_cache
562+ else :
563+ query = set_plan_cache_hint (query , plan_cache )
559564 data ['query' ] = query
560565 if explain :
566+ if self .is_analytics_domain ():
567+ data ['explain.mode' ] = explain
568+ data ['explain-mode' ] = explain
561569 data ['explain' ] = explain
562570 headers ['Accept' ] = "text/html"
563571 if query_params :
0 commit comments