[docs]definit_collections(self):metadata=self.metadataifself._collectionsisNone:self._collections={}forname,collection_configinmetadata.collections.items():collection=FileSystemCollection(parent=self,**collection_config.dict())self._collections[name]=collectionpath=self.directory_pathifpath.exists():forfmtinFormat:suffix=fmt.valuelogger.info(f"Looking for {suffix} files in {path}")forfinpath.glob(f"*.{suffix}"):logger.info(f"Found {f}")n=f.stemobjs=load_objects(f,suffix,expected_type=list)collection=FileSystemCollection(parent=self,name=n)self._collections[n]=collectioncollection._set_objects(objs)
[docs]defxxxinduce_schema_view(self)->SchemaView:logger.info(f"Inducing schema view for {self.handle}")sb=SchemaBuilder()forcollection_nameinself.list_collection_names():sb.add_class(collection_name)returnSchemaView(sb.schema)