Datasets:
Add files using upload-large-folder tool
Browse filesFiles changed (16)
- 100k/edges.parquetAdded+3
- 100k/nodes.parquetAdded+3
- 10k/edges.parquetAdded+3
- 10k/nodes.parquetAdded+3
- 10m/edges.parquetAdded+3
- 10m/nodes.parquetAdded+3
- 1k/edges.parquetAdded+3
- 1k/nodes.parquetAdded+3
- 1m/edges.parquetAdded+3
- 1m/nodes.parquetAdded+3
- README.md+231-3
- raw/cs100k_openalex.db.zipAdded+3
- raw/cs10k_openalex.db.zipAdded+3
- raw/cs10m_openalex.db.zipAdded+3
- raw/cs1k_openalex.db.zipAdded+3
- raw/cs1m_openalex.db.zipAdded+3
123version https://git-lfs.github.com/spec/v1oid sha256:c0740c670efa3f11a642629e0ac3c85ac3204cde972e49c2752babc731db4d1asize 9119596123version https://git-lfs.github.com/spec/v1oid sha256:dacfcc78d920f57fc696ac640d46376efff1adccbc70e14bd5ed1759ba8f87afsize 7303881123version https://git-lfs.github.com/spec/v1oid sha256:784dc14d8438bce445dd9781685d3f3ad778f71db21622238e12644e583154b2size 1037355123version https://git-lfs.github.com/spec/v1oid sha256:f0f08f89ad8bbef42db0da6be232a952b0a94d688d782c22b7d2ce8ebfae05d8size 1015153123version https://git-lfs.github.com/spec/v1oid sha256:43bd01d1c20cf899e6aff953521b6ae73065e8b91e25b69e0bb40b56396835e2size 221497372123version https://git-lfs.github.com/spec/v1oid sha256:2d315f599af10a4bf165275b5c8fd6859ca21bccedb9177a5f9d22a0c12f7570size 180847994123version https://git-lfs.github.com/spec/v1oid sha256:03617d08c52ed81014ed3f447270fdc6e883d7dacf114ca8331a23a5546a1c26size 152977123version https://git-lfs.github.com/spec/v1oid sha256:0f6a8ea5ebbc68ab15e888ce9231a3f06cee0b253292b2f84a31703d6bedb88esize 130638123version https://git-lfs.github.com/spec/v1oid sha256:5c7d7f0c82b07fee2fffbe15149bd4c10efb1b56bd0c8adf53583a5b52504db4size 66819646123version https://git-lfs.github.com/spec/v1oid sha256:3fc41907d277f025595ffcab9f139645e5f272130153a20e6cc113df31758b3bsize 54733023123123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231---
license: cc-by-sa-4.0
------license: cc-by-sa-4.0language:- enpretty_name: CS Knowledge Graph (OpenAlex)size_categories:- 10M<n<100Mtask_categories:- graph-ml- feature-extractiontags:- knowledge-graph- openalex- computer-science- bibliographic- citation-network- co-authorship- scholarly- link-prediction- node-classificationconfigs:- config_name: 1k data_files: - split: nodes path: 1k/nodes.parquet - split: edges path: 1k/edges.parquet- config_name: 10k data_files: - split: nodes path: 10k/nodes.parquet - split: edges path: 10k/edges.parquet- config_name: 100k data_files: - split: nodes path: 100k/nodes.parquet - split: edges path: 100k/edges.parquet- config_name: 1m data_files: - split: nodes path: 1m/nodes.parquet - split: edges path: 1m/edges.parquet- config_name: 10m data_files: - split: nodes path: 10m/nodes.parquet - split: edges path: 10m/edges.parquet---
# CS Knowledge Graph Dataset (OpenAlex)
A multi-scale heterogeneous knowledge graph of Computer Science scholarly data,built from [OpenAlex](https://openalex.org). Each scale is an independent,self-contained subgraph centered on Computer Science papers, their authors,publication venues, and concept tags, plus the relationships between them.
The dataset is intended for research on knowledge graph embeddings, linkprediction, node classification, scholarly recommendation, and graph neuralnetworks at varying scales of compute.
## Scales
Five scales are provided so the same pipeline can be benchmarked from quickprototyping (1k) to large-scale training (10m). Each scale is a strict supersetof the smaller ones in spirit, but is sampled independently — treat them asfive separate graphs rather than nested cuts.
| Config | Nodes | Edges | Parquet size | Raw SQLite (zip) ||--------|-----------:|------------:|-------------:|-----------------:|| `1k` | 5,237 | 32,655 | 277 KB | 961 KB || `10k` | 44,933 | 252,631 | 2.0 MB | 7.7 MB || `100k` | 348,983 | 2,162,386 | 16 MB | 68 MB || `1m` | 2,384,896 | 13,530,177 | 117 MB | 597 MB || `10m` | 7,210,506 | 44,631,484 | 384 MB | 2.1 GB |
## Schema
Each config has two splits, named `nodes` and `edges` (rather than the usualtrain/test/validation, since this is a graph dataset).
### `nodes` split
| 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` split
| 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)
## Usage
### Load with the `datasets` library
```pythonfrom datasets import load_dataset
# Pick a scale: "1k", "10k", "100k", "1m", or "10m"nodes = load_dataset("jugalgajjar/CS-Knowledge-Graph-Dataset", "10k", split="nodes")edges = load_dataset("jugalgajjar/CS-Knowledge-Graph-Dataset", "10k", split="edges")
print(nodes[0])# {'node_id': 'paper_W...', 'node_name': '...', 'node_type': 'Paper',# 'attributes': '{"year": 2016, "citation_count": 1816, ...}'}
import jsonattrs = json.loads(nodes[0]["attributes"])```
### Load directly with pandas / pyarrow
```pythonimport pandas as pdnodes = 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
```pythonimport jsonimport torchfrom torch_geometric.data import HeteroDatafrom datasets import load_dataset
scale = "10k"nodes = load_dataset("jugalgajjar/CS-Knowledge-Graph-Dataset", scale, split="nodes").to_pandas()edges = load_dataset("jugalgajjar/CS-Knowledge-Graph-Dataset", scale, split="edges").to_pandas()
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)
# infer source/target type from the node_id prefixtype_from_prefix = {"paper": "Paper", "author": "Author", "venue": "Venue", "concept": "Concept"}def ntype_of(nid: str) -> 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 buildeach scale are available under `raw/`:
```raw/cs1k_openalex.db.zipraw/cs10k_openalex.db.zipraw/cs100k_openalex.db.zipraw/cs1m_openalex.db.zipraw/cs10m_openalex.db.zip```
These are useful if you want to run SQL queries over the source recordsdirectly. Download with `huggingface_hub`:
```pythonfrom huggingface_hub import hf_hub_downloadpath = 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```123version https://git-lfs.github.com/spec/v1oid sha256:d8515539cde1286136adfe7aebf3276fb4bb9b759095a1b90352e382a2ff3362size 70912197123version https://git-lfs.github.com/spec/v1oid sha256:d17a2d479cfc7bda5b85b0c6de59c52e31728bbccca94a26170873380d6e9285size 8028870123version https://git-lfs.github.com/spec/v1oid sha256:cfb809befe708f3d2ad484ad0df7726890ec775b5485620ab21c0cc84576fc2dsize 2241407116123version https://git-lfs.github.com/spec/v1oid sha256:5ec923599cd0f550b2f363d687095b5790c4aeaaac9229950bb54a6af4782cfesize 984101123version https://git-lfs.github.com/spec/v1oid sha256:591753a02f368d0502e379369493982383dab256559f4712d35641dc5075a5d0size 626268613100k/edges.parquetAdded+3
100k/nodes.parquetAdded+3
10k/edges.parquetAdded+3
10k/nodes.parquetAdded+3
10m/edges.parquetAdded+3
10m/nodes.parquetAdded+3
1k/edges.parquetAdded+3
1k/nodes.parquetAdded+3
1m/edges.parquetAdded+3
1m/nodes.parquetAdded+3
README.md+231-3
raw/cs100k_openalex.db.zipAdded+3
raw/cs10k_openalex.db.zipAdded+3
raw/cs10m_openalex.db.zipAdded+3
raw/cs1k_openalex.db.zipAdded+3
raw/cs1m_openalex.db.zipAdded+3