1010
1111from bioimageio import spec
1212from bioimageio .core .resource_io .nodes import ResourceDescription
13- from bioimageio .spec .io_ import resolve_rdf_source
13+ from bioimageio .spec .io_ import RDF_NAMES , resolve_rdf_source
1414from bioimageio .spec .shared import raw_nodes
1515from bioimageio .spec .shared .common import BIOIMAGEIO_CACHE_PATH , get_class_name_from_type
1616from bioimageio .spec .shared .raw_nodes import ResourceDescription as RawResourceDescription
@@ -37,8 +37,10 @@ def extract_resource_package(
3737 from urllib .request import urlretrieve
3838
3939 package_path = cache_folder / root .scheme / root .authority / root .path .strip ("/" ) / root .query
40- if (package_path / "rdf.yaml" ).exists ():
41- download = None
40+ for rdf_name in RDF_NAMES :
41+ if (package_path / rdf_name ).exists ():
42+ download = None
43+ break
4244 else :
4345 try :
4446 download , header = urlretrieve (str (root ))
@@ -55,8 +57,11 @@ def extract_resource_package(
5557 with zipfile .ZipFile (local_source ) as zf :
5658 zf .extractall (package_path )
5759
58- if not (package_path / "rdf.yaml" ).exists ():
59- raise FileNotFoundError (f"missing 'rdf.yaml' in { root } extracted from { download } " )
60+ for rdf_name in RDF_NAMES :
61+ if (package_path / rdf_name ).exists ():
62+ break
63+ else :
64+ raise FileNotFoundError (f"Missing 'rdf.yaml' in { root } extracted from { download } " )
6065
6166 if download is not None :
6267 try :
0 commit comments