@@ -541,23 +541,31 @@ def opencypher_http(self, query: str, headers: dict = None, explain: str = None,
541
541
if headers is None :
542
542
headers = {}
543
543
544
- url = f'{ self ._http_protocol } ://{ self .host } : { self . port } / '
544
+ url = f'{ self ._http_protocol } ://{ self .host } '
545
545
546
546
if self .is_neptune_domain ():
547
- if 'content-type' not in headers :
548
- headers ['content-type' ] = 'application/x-www-form-urlencoded'
549
- url += 'openCypher'
550
547
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'
551
555
if plan_cache :
552
556
if plan_cache not in OPENCYPHER_PLAN_CACHE_MODES :
553
557
print ('Invalid --plan-cache mode specified, defaulting to auto.' )
554
558
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 )
559
564
data ['query' ] = query
560
565
if explain :
566
+ if self .is_analytics_domain ():
567
+ data ['explain.mode' ] = explain
568
+ data ['explain-mode' ] = explain
561
569
data ['explain' ] = explain
562
570
headers ['Accept' ] = "text/html"
563
571
if query_params :
0 commit comments