--- license: cc-by-sa-4.0 language: - en pretty_name: CS Knowledge Graph (OpenAlex) size_categories: - 10M str: return type_from_prefix[nid.split("_", 1)[0]] for relation, group in edges.groupby("relation"): src_type = ntype_of(group["source"].iloc[0]) dst_type = ntype_of(group["target"].iloc[0]) src = group["source"].map(id_maps[src_type]).to_numpy() dst = group["target"].map(id_maps[dst_type]).to_numpy() data[src_type, relation, dst_type].edge_index = torch.tensor([src, dst], dtype=torch.long) ``` ## Raw SQLite databases In addition to the Parquet files, the original SQLite databases used to build each scale are available under `raw/`: ``` raw/cs1k_openalex.db.zip raw/cs10k_openalex.db.zip raw/cs100k_openalex.db.zip raw/cs1m_openalex.db.zip raw/cs10m_openalex.db.zip ``` These are useful if you want to run SQL queries over the source records directly. Download with `huggingface_hub`: ```python from huggingface_hub import hf_hub_download path = hf_hub_download( repo_id="jugalgajjar/CS-Knowledge-Graph-Dataset", repo_type="dataset", filename="raw/cs10k_openalex.db.zip", ) ``` ## Source and licensing - **Source data:** [OpenAlex](https://openalex.org), released into the public domain under [CC0](https://creativecommons.org/publicdomain/zero/1.0/). - **This derived dataset:** licensed under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/). You may use, modify, and redistribute it, including commercially, provided you give attribution and license your derivative works under the same terms. - Please also cite OpenAlex when using this dataset; see their [citation guidance](https://docs.openalex.org). ## Repository layout ``` . ├── README.md ├── 1k/ │ ├── nodes.parquet │ └── edges.parquet ├── 10k/ (same layout) ├── 100k/ (same layout) ├── 1m/ (same layout) ├── 10m/ (same layout) └── raw/ ├── cs1k_openalex.db.zip ├── cs10k_openalex.db.zip ├── cs100k_openalex.db.zip ├── cs1m_openalex.db.zip └── cs10m_openalex.db.zip ```