--- license: cc-by-sa-4.0 language: - en pretty_name: CS Knowledge Graph (OpenAlex) size_categories: - 10M_nodes` and `_edges`. They share a single split named `train` (a `datasets` convention — there is no held-out test split, since the intended use is to define your own splits over the graph). ### `nodes` config | Column | Type | Description | |--------------|--------|-----------------------------------------------------------------------| | `node_id` | string | Unique node identifier, prefixed by type (e.g. `paper_W2604738573`). | | `node_name` | string | Human-readable name (paper title, author display name, venue, etc.). | | `node_type` | string | One of `Paper`, `Author`, `Venue`, `Concept`. | | `attributes` | string | Type-specific attributes encoded as a JSON string (see below). | The `attributes` JSON object has different keys depending on `node_type`: - **Paper**: `year` (int), `citation_count` (int), `venue` (string), `type` (string, e.g. `article`) - **Author**: `h_index` (int or null), `citation_count` (int or null), `works_count` (int or null), `institution` (string) - **Venue**: `type` (string, e.g. `journal`, `conference`), `publisher` (string) - **Concept**: `domain` (string, e.g. `CS`) ### `edges` config | Column | Type | Description | |------------|--------|--------------------------------------------------------------------------------------------| | `source` | string | `node_id` of the source node. | | `relation` | string | One of `AUTHORED`, `CITES`, `PUBLISHED_IN`, `BELONGS_TO`, `COLLABORATES_WITH`. | | `target` | string | `node_id` of the target node. | | `year` | float | Year associated with the edge when applicable (e.g. publication year); `null` otherwise. | Relation semantics: - `AUTHORED` — `Author → Paper` - `CITES` — `Paper → Paper` - `PUBLISHED_IN` — `Paper → Venue` - `BELONGS_TO` — `Paper → Concept` - `COLLABORATES_WITH` — `Author → Author` (co-authorship; symmetric, may appear in both directions) **Dangling `CITES` targets.** Each scale is built from a Computer Science slice of OpenAlex, so the `nodes` table only contains CS papers (plus their authors, venues, and concepts). However, those CS papers may cite papers from outside CS — those external papers appear as `target` in `CITES` edges but are **not** present in the `nodes` table. Filter or add placeholder nodes as appropriate for your task. Sources are always present in `nodes`; only `CITES` targets can be dangling. ## Usage ### Load with the `datasets` library ```python from datasets import load_dataset # Configs follow the pattern "_nodes" / "_edges". # Scales: 1k, 10k, 100k, 1m, 10m nodes = load_dataset("jugalgajjar/CS-Knowledge-Graph-Dataset", "10k_nodes", split="train") edges = load_dataset("jugalgajjar/CS-Knowledge-Graph-Dataset", "10k_edges", split="train") print(nodes[0]) # {'node_id': 'paper_W...', 'node_name': '...', 'node_type': 'Paper', # 'attributes': '{"year": 2016, "citation_count": 1816, ...}'} import json attrs = json.loads(nodes[0]["attributes"]) ``` ### Load directly with pandas / pyarrow ```python import pandas as pd nodes = pd.read_parquet("hf://datasets/jugalgajjar/CS-Knowledge-Graph-Dataset/100k/nodes.parquet") edges = pd.read_parquet("hf://datasets/jugalgajjar/CS-Knowledge-Graph-Dataset/100k/edges.parquet") ``` ### Build a PyTorch Geometric graph ```python import numpy as np import torch from torch_geometric.data import HeteroData from datasets import load_dataset scale = "10k" nodes = load_dataset("jugalgajjar/CS-Knowledge-Graph-Dataset", f"{scale}_nodes", split="train").to_pandas() edges = load_dataset("jugalgajjar/CS-Knowledge-Graph-Dataset", f"{scale}_edges", split="train").to_pandas() # Build per-type id -> contiguous index maps data = HeteroData() id_maps = {} for ntype, group in nodes.groupby("node_type"): ids = group["node_id"].tolist() id_maps[ntype] = {nid: i for i, nid in enumerate(ids)} data[ntype].num_nodes = len(ids) # Each node_id is prefixed with its type type_from_prefix = {"paper": "Paper", "author": "Author", "venue": "Venue", "concept": "Concept"} def ntype_of(nid: str) -> str: return type_from_prefix[nid.split("_", 1)[0]] # Drop CITES edges whose target isn't in the node set (cross-domain citations). node_id_set = set(nodes["node_id"]) edges = edges[edges["target"].isin(node_id_set)].reset_index(drop=True) 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(dtype=np.int64) dst = group["target"].map(id_maps[dst_type]).to_numpy(dtype=np.int64) data[src_type, relation, dst_type].edge_index = torch.from_numpy(np.stack([src, dst])) print(data) ``` ## 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", ) ``` ## Citation This dataset was introduced in the following paper. **If you use this dataset in your work, please cite it.** Please also cite OpenAlex (the source data; see their [citation guidance](https://docs.openalex.org)). **BibTeX:** ```bibtex @inproceedings{gajjar2025hypercomplex, title={HyperComplEx: Adaptive Multi-Space Knowledge Graph Embeddings}, author={Gajjar, Jugal and Ranaware, Kaustik and Subramaniakuppusamy, Kamalasankari and Gandhi, Vaibhav C}, booktitle={2025 IEEE International Conference on Big Data (BigData)}, pages={5623--5631}, year={2025}, organization={IEEE} } ``` **APA:** > Gajjar, J., Ranaware, K., Subramaniakuppusamy, K., & Gandhi, V. C. (2025, December). HyperComplEx: Adaptive Multi-Space Knowledge Graph Embeddings. In *2025 IEEE International Conference on Big Data (BigData)* (pp. 5623–5631). IEEE. ## 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. ## 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 ```