File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -205,7 +205,10 @@ def migrated(self):
205205 result = self .instance_from_full_uri (
206206 "https://kg.ebrains.eu/api/instances/92631f2e-fc6e-4122-8015-a0731c67f66c" , release_status = "released"
207207 )
208- if "om-i.org" in result ["@type" ]:
208+ _type = result ["@type" ]
209+ if isinstance (_type , list ):
210+ _type = _type [0 ]
211+ if "om-i.org" in _type :
209212 self ._migrated = True
210213 else :
211214 self ._migrated = False
@@ -411,12 +414,13 @@ def _get_instance(release_status):
411414 elif uri .startswith ("https://openminds.om-i.org/instances" ) or uri .startswith (
412415 "https://openminds.ebrains.eu/instances"
413416 ):
414- if self . migrated and uri . startswith ( "https://openminds.ebrains.eu" ):
415- payload = [ uri . replace ( "ebrains.eu" , "om-i.org" )]
416- elif uri .startswith ("https://openminds.om-i.org " ):
417- payload = [uri .replace ("om-i.org " , "ebrains.eu " )]
417+ payload = [ uri ]
418+ if self . migrated :
419+ if uri .startswith ("https://openminds.ebrains.eu " ):
420+ payload = [uri .replace ("ebrains.eu " , "om-i.org " )]
418421 else :
419- payload = [uri ]
422+ if uri .startswith ("https://openminds.om-i.org" ):
423+ payload = [uri .replace ("om-i.org" , "ebrains.eu" )]
420424 response = self ._kg_client .instances .get_by_identifiers (
421425 stage = STAGE_MAP [release_status ],
422426 payload = payload ,
You can’t perform that action at this time.
0 commit comments