Repository: pykeen/pykeen
Issue: CKG(Clinical Knowledge Graph) dataset url expired
Root cause: External Dependency Breakage

### Describe the bug

**When initializing CKG dataset which already comes included in pykeen, it gives HTTP 404 error. The CKG url is probably expired. The URL is given in the ckg.py modeuls as:**
 ```URL = "https://md-datasets-public-files-prod.s3.eu-west-1.amazonaws.com/d1e8d3df-2342-468a-91a9-97a981a479ad"```

Can this be changed to reflect the correct URL ?

```python-traceback
---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
Cell In[55], line 1
----> 1 ckg = get_dataset(dataset="ckg")

File ~/miniconda3/envs/pykeen/lib/python3.11/site-packages/pykeen/datasets/utils.py:136, in get_dataset(dataset, dataset_kwargs, training, testing, validation)
    134 if isinstance(dataset, str):
    135     if has_dataset(dataset):
--> 136         return _cached_get_dataset(dataset, dataset_kwargs)
    137     else:
    138         # Assume it's a file path
    139         return Dataset.from_path(dataset)

File ~/miniconda3/envs/pykeen/lib/python3.11/site-packages/pykeen/datasets/utils.py:232, in _cached_get_dataset(dataset, dataset_kwargs, force)
    230 # store cache
    231 logger.info(f"Caching preprocessed dataset to {path.as_uri()}")
--> 232 dataset_instance.to_directory_binary(path=path)
    234 return dataset_instance

File ~/miniconda3/envs/pykeen/lib/python3.11/site-packages/pykeen/datasets/base.py:218, in Dataset.to_directory_binary(self, path)
    216 """Store a dataset to a path in binary format."""
    217 path = pathlib.Path(path)
--> 218 for key, factory in self.factory_dict.items():
    219     tf_path = path.joinpath(key)
    220     factory.to_path_binary(tf_path)

File ~/miniconda3/envs/pykeen/lib/python3.11/site-packages/pykeen/datasets/base.py:100, in Dataset.factory_dict(self)
     96 @property
     97 def factory_dict(self) -> Mapping[str, CoreTriplesFactory]:
     98     """Return a dictionary of the three factories."""
     99     rv = dict(
--> 100         training=self.training,
    101         testing=self.testing,
    102     )
    103     if self.validation:
    104         rv["validation"] = self.validation

File ~/miniconda3/envs/pykeen/lib/python3.11/site-packages/pykeen/datasets/base.py:334, in LazyDataset.training(self)
    332 """The training triples factory."""
    333 if not self._loaded:
--> 334     self._load()
    335 assert self._training is not None
    336 return self._training

File ~/miniconda3/envs/pykeen/lib/python3.11/site-packages/pykeen/datasets/base.py:856, in TabbedDataset._load(self)
    855 def _load(self) -> None:
--> 856     df = self._get_df()
    857     path = self._get_path()
    858     tf = TriplesFactory.from_labeled_triples(
    859         triples=df.values,
    860         create_inverse_triples=self._create_inverse_triples,
    861         metadata=dict(path=path) if path else None,
    862     )

File ~/miniconda3/envs/pykeen/lib/python3.11/site-packages/pykeen/datasets/ckg.py:70, in CKG._get_df(self)
     68 if self.preloaded_path.exists():
     69     return pd.read_csv(self.preloaded_path, sep="\t", dtype=str)
---> 70 df = pd.concat(self._iterate_dataframes())
     71 df.to_csv(self.preloaded_path, sep="\t", index=False)
     72 return df

File ~/miniconda3/envs/pykeen/lib/python3.11/site-packages/pandas/core/reshape/concat.py:372, in concat(objs, axis, join, ignore_index, keys, levels, names, verify_integrity, sort, copy)
    369 elif copy and using_copy_on_write():
    370     copy = False
--> 372 op = _Concatenator(
    373     objs,
    374     axis=axis,
    375     ignore_index=ignore_index,
    376     join=join,
    377     keys=keys,
    378     levels=levels,
    379     names=names,
    380     verify_integrity=verify_integrity,
    381     copy=copy,
    382     sort=sort,
    383 )
    385 return op.get_result()

File ~/miniconda3/envs/pykeen/lib/python3.11/site-packages/pandas/core/reshape/concat.py:426, in _Concatenator.__init__(self, objs, axis, join, keys, levels, names, ignore_index, verify_integrity, copy, sort)
    424     objs = [objs[k] for k in keys]
    425 else:
--> 426     objs = list(objs)
    428 if len(objs) == 0:
    429     raise ValueError("No objects to concatenate")

File ~/miniconda3/envs/pykeen/lib/python3.11/site-packages/pykeen/datasets/ckg.py:77, in CKG._iterate_dataframes(self)
     75 archive_path = self.cache_root / "data.tar.gz"
     76 if not archive_path.exists():
---> 77     urlretrieve(URL, archive_path)  # noqa:S310
     78 with tarfile.TarFile.open(archive_path) as tar_file:
     79     if tar_file is None:

File ~/miniconda3/envs/pykeen/lib/python3.11/urllib/request.py:241, in urlretrieve(url, filename, reporthook, data)
    224 """
    225 Retrieve a URL into a temporary location on disk.
    226 
   (...)
    237 data file as well as the resulting HTTPMessage object.
    238 """
    239 url_type, path = _splittype(url)
--> 241 with contextlib.closing(urlopen(url, data)) as fp:
    242     headers = fp.info()
    244     # Just return the local path and the "headers" for file://
    245     # URLs. No sense in performing a copy unless requested.

File ~/miniconda3/envs/pykeen/lib/python3.11/urllib/request.py:216, in urlopen(url, data, timeout, cafile, capath, cadefault, context)
    214 else:
    215     opener = _opener
--> 216 return opener.open(url, data, timeout)

File ~/miniconda3/envs/pykeen/lib/python3.11/urllib/request.py:525, in OpenerDirector.open(self, fullurl, data, timeout)
    523 for processor in self.process_response.get(protocol, []):
    524     meth = getattr(processor, meth_name)
--> 525     response = meth(req, response)
    527 return response

File ~/miniconda3/envs/pykeen/lib/python3.11/urllib/request.py:634, in HTTPErrorProcessor.http_response(self, request, response)
    631 # According to RFC 2616, "2xx" code indicates that the client's
    632 # request was successfully received, understood, and accepted.
    633 if not (200 <= code < 300):
--> 634     response = self.parent.error(
    635         'http', request, response, code, msg, hdrs)
    637 return response

File ~/miniconda3/envs/pykeen/lib/python3.11/urllib/request.py:563, in OpenerDirector.error(self, proto, *args)
    561 if http_err:
    562     args = (dict, 'default', 'http_error_default') + orig_args
--> 563     return self._call_chain(*args)

File ~/miniconda3/envs/pykeen/lib/python3.11/urllib/request.py:496, in OpenerDirector._call_chain(self, chain, kind, meth_name, *args)
    494 for handler in handlers:
    495     func = getattr(handler, meth_name)
--> 496     result = func(*args)
    497     if result is not None:
    498         return result

File ~/miniconda3/envs/pykeen/lib/python3.11/urllib/request.py:643, in HTTPDefaultErrorHandler.http_error_default(self, req, fp, code, msg, hdrs)
    642 def http_error_default(self, req, fp, code, msg, hdrs):
--> 643     raise HTTPError(req.full_url, code, msg, hdrs, fp)

HTTPError: HTTP Error 404: Not Found
```

### How to reproduce

```python
from pykeen.datasets import get_dataset
ckg = get_dataset(dataset="ckg")
```


### Environment

| Key             | Value                    |
|-----------------|--------------------------|
| OS              | posix                    |
| Platform        | Linux                    |
| Release         | 5.4.0-146-generic        |
| Time            | Mon Aug 14 15:08:05 2023 |
| Python          | 3.11.4                   |
| PyKEEN          | 1.10.1                   |
| PyKEEN Hash     | UNHASHED                 |
| PyKEEN Branch   |                          |
| PyTorch         | 2.0.1+cu117              |
| CUDA Available? | true                     |
| CUDA Version    | 11.7                     |
| cuDNN Version   | 8500                     |

### Additional information

_No response_

### Issue Template Checks

- [X] This is not a feature request (use a different issue template if it is)
- [X] This is not a question (use the [discussions](https://github.com/pykeen/pykeen/discussions/new) forum instead)
- [x] I've read the text explaining why including environment information is important and understand if I omit this information that my issue will be dismissed

Do you know the new correct URL?

> Do you know the new correct URL?

Unfortunately I do not know where to find CKG in the format that is required in pykeen like a TSV or CSV file containing triples, but here is the link of the data dump of CKG: 
DataDump : https://data.mendeley.com/datasets/mrcf7f4tc2/1

I cannot say for sure, but I think it is neo4j dump of CKG. 

Hm, the repository seems to be pretty stale, too. This issue looks relevant, but there has not yet been an update: https://github.com/MannLabs/CKG/issues/89

When I try to redownload the file through the Mendeley links, I get referred to
```
https://prod-dcd-datasets-public-files-eu-west-1.s3.eu-west-1.amazonaws.com/d1e8d3df-2342-468a-91a9-97a981a479ad
```
instead of
```
https://md-datasets-public-files-prod.s3.eu-west-1.amazonaws.com/d1e8d3df-2342-468a-91a9-97a981a479ad
```

However, the new link also does not look like a stable link.

@SwarnavaCB , if you want, you can try this new link, and open a PR to update the it when it is successful for you.

> When I try to redownload the file through the Mendeley links, I get referred to
> 
> ```
> https://prod-dcd-datasets-public-files-eu-west-1.s3.eu-west-1.amazonaws.com/d1e8d3df-2342-468a-91a9-97a981a479ad
> ```
> 
> instead of
> 
> ```
> https://md-datasets-public-files-prod.s3.eu-west-1.amazonaws.com/d1e8d3df-2342-468a-91a9-97a981a479ad
> ```
> 
> However, the new link also does not look like a stable link.
> 
> @SwarnavaCB , if you want, you can try this new link, and open a PR to update the it when it is successful for you.

Hi @mberr, the new link you provided seems to be working. I will create a pull request to update it.