def download_rdf(self, force=False):
if self.downloading:<EOL><INDENT>return True<EOL><DEDENT>if not force and (os.path.exists(RDF_PATH) and<EOL>(time.time() - os.path.getmtime(RDF_PATH)) < RDF_MAX_AGE):<EOL><INDENT>return False<EOL><DEDENT>self.downloading = True<EOL>logging.info('<STR_LIT>' % RDF_URL)<EOL>try:<EOL><INDENT>shutil.rmtree(os.path.join(self.rdf_library_dir, '<STR_LIT>'))<EOL><DEDENT>except OSError as e:<EOL><INDENT>if e.errno != errno.ENOENT:<EOL><INDENT>raise<EOL><DEDENT><DEDENT>try:<EOL><INDENT>with open(RDF_PATH, '<STR_LIT:w>') as f:<EOL><INDENT>with requests.get(RDF_URL, stream=True) as r:<EOL><INDENT>shutil.copyfileobj(r.raw, f)<EOL><DEDENT><DEDENT><DEDENT>except requests.exceptions.RequestException as e:<EOL><INDENT>logging.error(e)<EOL>return True<EOL><DEDENT>try:<EOL><INDENT>with tarfile.open(RDF_PATH, '<STR_LIT:r>') as f:<EOL><INDENT>f.extractall(self.rdf_library_dir)<EOL><DEDENT><DEDENT>except tarfile.TarError as e:<EOL><INDENT>logging.error(e)<EOL>try:<EOL><INDENT>os.unlink(RDF_PATH)<EOL><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT>return True<EOL><DEDENT>self.downloading = False<EOL>return False<EOL>
Ensures a fresh-enough RDF file is downloaded and extracted.

        Returns True on error.