def _load_rdfs_from_file(self, filename, collection): with open(filename, 'r', encoding='utf8') as my_file: for line in my_file: splits = line.split(":") if len(splits) > 2: subj = splits[0].upper() pred = splits[1].upper() obj = (":".join(splits[2:])).strip() rdf_name = FileStore.get_just_filename_from_filepath( filename) collection.add_entity(subj, pred, obj, rdf_name, filename)
def _load_file_contents(self, collection, filename): YLogger.debug(self, "Loading set [%s]", filename) try: the_set = {} self._load_sets_from_file(filename, the_set) set_name = FileStore.get_just_filename_from_filepath(filename) collection.add_set(set_name, the_set, filename) return True except Exception as excep: YLogger.exception_nostack(self, "Failed to load set [%s]", excep, filename) return False
def _load_file_contents(self, collection, filename): YLogger.debug(self, "Loading map [%s]", filename) the_map = {} try: self._load_map_file(filename, the_map) except Exception as excep: YLogger.exception_nostack(self, "Failed to load map [%s]", excep, filename) map_name = FileStore.get_just_filename_from_filepath(filename) collection.add_map(map_name, the_map, filename) return self.storage_engine.configuration.maps_storage