ZachGu commited on
Commit
ee7b277
·
verified ·
1 Parent(s): 424edda
README.md CHANGED
@@ -41,6 +41,38 @@ license. See [SOURCE_TERMS.md](SOURCE_TERMS.md) for source attribution, current
41
  contribution counts, review dates, and unresolved redistribution permissions.
42
  The software repository's MIT license does not license these third-party data.
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  ## Contents and loading
45
 
46
  | Configuration | Split | Rows | Files |
@@ -55,7 +87,7 @@ use Zstandard compression and row groups of at most 65,536 rows.
55
  ```python
56
  from datasets import load_dataset
57
 
58
- repo_id = "YOUR_HF_USERNAME/MicrobeKG" # replace with the actual dataset repository
59
  edges = load_dataset(repo_id, "edges", split="full")
60
  nodes = load_dataset(repo_id, "nodes", split="full")
61
 
 
41
  contribution counts, review dates, and unresolved redistribution permissions.
42
  The software repository's MIT license does not license these third-party data.
43
 
44
+ ## MicrobeKG-Bench v3 — code update (2026-11-03)
45
+
46
+ The v3 benchmark provides study-aware, temporal and cold-endpoint evaluation,
47
+ 17 internal settings across five seeds, and an external BugSigDB test set.
48
+ Its separate data package contains 2,671,916 triples after excluding CTD/HMDB-only
49
+ support. These are different from the 3,647,004 audited graph rows already hosted
50
+ under the `edges` configuration below.
51
+
52
+ - [Code and analysis](https://github.com/ZachGu-00/MicrobeKG-dataset_split_task/tree/main/bench_v3), with an installable loader,
53
+ evaluator, CPU baselines and reference tests.
54
+ - [Mirrored benchmark tools](bench_v3/README.md) and [release index](RELEASE_V3.json).
55
+ - **v3 data download:** Google Drive release pending; a download URL has not yet
56
+ been provided. No new graph tables, benchmark splits or record tables are added
57
+ by this update. The existing `nodes` / `edges` configurations still load the
58
+ audited-20260928 export.
59
+
60
+ After obtaining and extracting the data archive, use its `v3/` directory:
61
+
62
+ ```bash
63
+ git clone https://github.com/ZachGu-00/MicrobeKG-dataset_split_task.git
64
+ python -m pip install ./MicrobeKG-dataset_split_task/bench_v3
65
+ ```
66
+
67
+ ```python
68
+ from microbekg_bench import load, Evaluator
69
+ from microbekg_bench.baselines import DegreePrior
70
+
71
+ case = load("t1_study_strict", 42, root="/path/to/v3")
72
+ result = Evaluator(case).evaluate(DegreePrior(case.train, case.n_entities))
73
+ print(result["metrics"])
74
+ ```
75
+
76
  ## Contents and loading
77
 
78
  | Configuration | Split | Rows | Files |
 
87
  ```python
88
  from datasets import load_dataset
89
 
90
+ repo_id = "ZachGu/MicrobeKG"
91
  edges = load_dataset(repo_id, "edges", split="full")
92
  nodes = load_dataset(repo_id, "nodes", split="full")
93
 
RELEASE_V3.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "published_date": "2026-11-03",
3
+ "graph_version": "audited-20260928",
4
+ "benchmark_version": "mkbench-v3",
5
+ "package_version": "3.0.0",
6
+ "github_url": "https://github.com/ZachGu-00/MicrobeKG-dataset_split_task",
7
+ "dataset_url": "https://huggingface.co/datasets/ZachGu/MicrobeKG",
8
+ "data_distribution": "Google Drive",
9
+ "data_download_url": null,
10
+ "data_status": "pending_author_upload",
11
+ "archives": [
12
+ {
13
+ "name": "MicrobeKG-Bench_release_v3.zip",
14
+ "bytes": 67425961,
15
+ "sha256": "08ed7222a836ac46e841959e61d5e0610fab9c20782b60f901b225ba5d882da6"
16
+ },
17
+ {
18
+ "name": "MicrobeKG-Bench_analysis_code_v3.zip",
19
+ "bytes": 105817,
20
+ "sha256": "f0d1f173869bdb5c8e2bb0453e7f38b012d978f6e8266f0ed1aa64b1c1892fab"
21
+ }
22
+ ]
23
+ }
SHA256SUMS CHANGED
@@ -1,17 +1,35 @@
1
- 622576d7c689f8d749fe05c5537f72a5411ddd1695a8776eed8358cf91f08d11 data/edges/edges-00000-of-00008.parquet
2
- 52b60915d6605184df1805f4a8481b18d523d0d018f11b062b2cd4780f0b8712 data/edges/edges-00001-of-00008.parquet
3
- d94fa22fa8c84523c31baa9c619d0a53ece9a2178a28c2197e3456c28f0513f3 data/edges/edges-00002-of-00008.parquet
4
- 7326f763cad0d32bfc4792d1f6b190131e13091be74e476da23a6db4ab09a4ed data/edges/edges-00003-of-00008.parquet
5
- d32981cd9a66e0cdf17509d3c7c850a271a94f33dc0a0efd19047df633a41b17 data/edges/edges-00004-of-00008.parquet
6
- 5d5d6eee31b694dc728d10636a3409d37305c45b85249ccf8c30e2ac53573df1 data/edges/edges-00005-of-00008.parquet
7
- cd3aa5649680a9dd9efb0aad0280170d0cd6b1d0a6d0cb4e92981cff6675e0bf data/edges/edges-00006-of-00008.parquet
8
- 4074d51bd83d55a1541b3724c42ef4c9a5a5951f1a4f9d3ac9798138b8918a92 data/edges/edges-00007-of-00008.parquet
9
- 8078335fab43f0d772e306a5c107a7930a00b47be3c6b9ed4377cd1ea12142ff data/nodes/nodes-00000-of-00001.parquet
10
- 4a16cc7c2cf2bb7609fe2eead1c7448721a71912c00db429396ccc34d9bae720 LICENSE
11
- be6c4a9724d8c60389cdaeac628be5358d4a96f59e175fd3bde46837a4c2f1d2 manifest.json
12
- 52f9304aaec48846d4bdbb289c18d26a5e4e1c44099a1cc884dfc0b77c043afa README.md
13
- 3d7387d322fb52bdf90c728d7124c35266cad101ab0310c0f90246b37a37b548 schema.json
14
- dc7bb60624711ffc407637c4ff0c63c82af10e6a9bfa230e65295d6e91960e0b source_terms.json
15
- 23ff9d63272697f1a9edc1e16d5665bb04b7630885b467f19d31ca7fcb71b258 SOURCE_TERMS.md
16
- e8fba96c599de091ddbf20586c67e90ecfcf793717927f12cae3f63547688e02 statistics.json
17
- 3d8a068e79ddaaf9fe0b3efdb3b9bd0415136ef2c8e7b379237653d01ec25044 validation.json
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 622576d7c689f8d749fe05c5537f72a5411ddd1695a8776eed8358cf91f08d11 data/edges/edges-00000-of-00008.parquet
2
+ 52b60915d6605184df1805f4a8481b18d523d0d018f11b062b2cd4780f0b8712 data/edges/edges-00001-of-00008.parquet
3
+ d94fa22fa8c84523c31baa9c619d0a53ece9a2178a28c2197e3456c28f0513f3 data/edges/edges-00002-of-00008.parquet
4
+ 7326f763cad0d32bfc4792d1f6b190131e13091be74e476da23a6db4ab09a4ed data/edges/edges-00003-of-00008.parquet
5
+ d32981cd9a66e0cdf17509d3c7c850a271a94f33dc0a0efd19047df633a41b17 data/edges/edges-00004-of-00008.parquet
6
+ 5d5d6eee31b694dc728d10636a3409d37305c45b85249ccf8c30e2ac53573df1 data/edges/edges-00005-of-00008.parquet
7
+ cd3aa5649680a9dd9efb0aad0280170d0cd6b1d0a6d0cb4e92981cff6675e0bf data/edges/edges-00006-of-00008.parquet
8
+ 4074d51bd83d55a1541b3724c42ef4c9a5a5951f1a4f9d3ac9798138b8918a92 data/edges/edges-00007-of-00008.parquet
9
+ 8078335fab43f0d772e306a5c107a7930a00b47be3c6b9ed4377cd1ea12142ff data/nodes/nodes-00000-of-00001.parquet
10
+ 4a16cc7c2cf2bb7609fe2eead1c7448721a71912c00db429396ccc34d9bae720 LICENSE
11
+ be6c4a9724d8c60389cdaeac628be5358d4a96f59e175fd3bde46837a4c2f1d2 manifest.json
12
+ d0314fad33415662371a09b35e8c2ad5b08e5b8143d537b9fb71b05d0b555b77 README.md
13
+ 3d7387d322fb52bdf90c728d7124c35266cad101ab0310c0f90246b37a37b548 schema.json
14
+ dc7bb60624711ffc407637c4ff0c63c82af10e6a9bfa230e65295d6e91960e0b source_terms.json
15
+ 23ff9d63272697f1a9edc1e16d5665bb04b7630885b467f19d31ca7fcb71b258 SOURCE_TERMS.md
16
+ e8fba96c599de091ddbf20586c67e90ecfcf793717927f12cae3f63547688e02 statistics.json
17
+ 3d8a068e79ddaaf9fe0b3efdb3b9bd0415136ef2c8e7b379237653d01ec25044 validation.json
18
+ 10235fbbc95062ab3d63f669cbb6b2da2a5e0461f823f8a54f9b3b356e6aadac bench_v3/build_info.json
19
+ 0b807ec89a3424c4c0d6c332b2dea459c9c9520864437bce440e1dd8ede572ce bench_v3/finalize_release.py
20
+ ad2227519a84df29dc053cfd66d8fe3dd0909687412761f2712e09c6b13b5788 bench_v3/LICENSE
21
+ 5265ad907392a4deb069c6edb038389deff2f3874b0db167dc2f4f4ad029ba8b bench_v3/make_release.py
22
+ 207f5bbcfd227108088194208ab5ca699d7503ab83694216720310c2bb66ffa4 bench_v3/microbekg_bench/__init__.py
23
+ 7586380495914ac5a43b0b7a4c4350fd5d2dc67ff4f4c15500e062fa8a80c7f3 bench_v3/microbekg_bench/baselines.py
24
+ 55ee04c870cebb8a12a46fdf6345a476777969ca204fb71ec37d1e6ec84156d6 bench_v3/microbekg_bench/evaluator.py
25
+ 6952769f1bf0e041c769794464bc46843ad7a54df62b6f4eae164c1148cda64c bench_v3/microbekg_bench/loader.py
26
+ 4b4871c343b5f0241c9be2e457ff66129aed0a99b954b397cfe2415e57167902 bench_v3/pyproject.toml
27
+ 04079037e20c9017977d1837a7fa988841d603b89b18f5c79f9964bc8459b154 bench_v3/README.md
28
+ 34456aca338830fd44305c502c0c921bebbc8c44a89a0dda49b9602c4d5e2b69 bench_v3/release_metadata/checksums.sha256
29
+ fc4e8378fc1be81851de57eca587b648817a9b7a689e69684eba84ad3f41bc46 bench_v3/release_metadata/README.md
30
+ 2b7f8b98e306f6f752fb386036aeec47b081a3721d7ecbcfc4f4f3337688f6b3 bench_v3/release_metadata/RELEASE_MANIFEST.json
31
+ 24f47b8fb3bee52437b4e2a4bdb8fdd4b58ba2fcd793f9e1ecf61ce830b52682 bench_v3/SOURCE_TERMS.json
32
+ 23ff9d63272697f1a9edc1e16d5665bb04b7630885b467f19d31ca7fcb71b258 bench_v3/SOURCE_TERMS.md
33
+ 76ee049d361702a429072e8035169b33885a820d57e21ac19511185ecbc4dd8f bench_v3/tests/reference_metrics.json
34
+ 59040262d81abe58847e149813c2a4482621e9de7bab22a9f4e2a894730a6154 bench_v3/tests/test_release.py
35
+ df90b12f2f9ca9d244f1e42f5f74a8b666b493bcec4d6882deded539eced22a5 RELEASE_V3.json
bench_v3/LICENSE ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 MicrobeKG contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ Scope: original MicrobeKG software and documentation only, excluding third-party
24
+ data, checkpoints, vendor code, and the GPL-covered KG-ICL integration.
25
+ See NOTICE. This does not license upstream data.
bench_v3/README.md ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MicrobeKG-Bench v3 release package
2
+
3
+ Loader and evaluator for **MicrobeKG-Bench: Study-Aware Evaluation of Microbe–Disease Link Prediction**. Code and documentation are published in [GitHub](https://github.com/ZachGu-00/MicrobeKG-dataset_split_task) and linked from [Hugging Face](https://huggingface.co/datasets/ZachGu/MicrobeKG). The v3 data archive will be distributed separately through Google Drive; its download link is pending. The existing Hugging Face nodes/edges tables are the audited graph, not v3 benchmark splits.
4
+
5
+ ## Install and test
6
+
7
+ From this `bench_v3/` directory, use Python >= 3.12:
8
+
9
+ ```bash
10
+ python -m pip install -e ".[test]"
11
+ python -m pytest -q # rank test; data-dependent checks skip without the data
12
+ ```
13
+
14
+ Extract `MicrobeKG-Bench_release_v3.zip` separately and point tests at its `v3/` directory:
15
+
16
+ ```bash
17
+ # Linux / macOS
18
+ MKB_DATA_ROOT=/path/to/v3 python -m pytest -q
19
+ MKB_DATA_ROOT=/path/to/v3 MKB_ALL_SEEDS=1 python -m pytest -q
20
+ ```
21
+
22
+ ```powershell
23
+ # PowerShell
24
+ $env:MKB_DATA_ROOT = 'D:/data/v3'
25
+ python -m pytest -q
26
+ $env:MKB_ALL_SEEDS = '1'
27
+ python -m pytest -q
28
+ ```
29
+
30
+ The tests rebuild the degree prior and L3 on the released splits and compare MRR, Hits@10 and study-macro MRR with `tests/reference_metrics.json`, which was written from the paper's frozen evaluator outputs (tolerance 1e-9).
31
+
32
+ ## Contents of the separate data archive
33
+
34
+ * `benchmark/`: licence-safe graph (`entities.tsv`, `relations.json`, `triples.parquet`, 2,671,916 triples), pair support (`pair_support.parquet`) and split tables for 17 settings × 5 seeds (42, 123, 456, 789, 2024). Split tables hold explicit `(head_id, head_type, relation, tail_id, tail_type)` rows; validation and test tables add `study_id`.
35
+ * `benchmark/p11_pairs/`: per seed, the revealed same-study pairs, the matched subset and the matched other-study reserve used by the same-study gain control.
36
+ * `benchmark/variants_build_audit.json`: per-variant counts of removed pairs and the identical-test-row checks.
37
+ * `benchmark/t1_study_ctx_full_REBUILD_REQUIRED.json`: recipe only; its CTD/HMDB-only context is not redistributed.
38
+ * `external/`: the out-of-time BugSigDB test set (5,424 triples, 238 studies) and its five seeds.
39
+ * `records/records_v2.parquet`: 65,948 record-level rows without personal-information columns; `records/schema.json`.
40
+ * `tested_null.parquet`: 4,461 GMrepo tested-null candidates (not ranking negatives).
41
+ * `SOURCE_TERMS.*`, `DATASHEET.md`, `MAINTENANCE.md`, `croissant.json`, `RELEASE_MANIFEST.json`, `checksums.sha256`.
42
+
43
+ The packaging step removed 975,088 triples whose only support was CTD or HMDB. Multi-source assertions stay when at least one other source supports them.
44
+
45
+ ## Settings
46
+
47
+ | Setting id | Paper name | Notes |
48
+ |---|---|---|
49
+ | `t1_pair` | Pair | random pair split |
50
+ | `t1_study` | Study-exclusive | held-out literature studies; pairs of a held-out study may still have cohort or other-study support |
51
+ | `t1_study_strict` | Strict (main) | Study-exclusive without any training support for test pairs |
52
+ | `t1_study_reveal` | Study + R | Study-exclusive with some pairs of each held-out study revealed |
53
+ | `t1_temporal`, `t1_temporal_nodis` | Temporal | first-report year split; `_nodis` ignores Disbiome years |
54
+ | `t1_cold_microbe`, `t1_cold_disease` | Cold endpoints | unseen microbes / diseases |
55
+ | `t1_study_ctx_open` | Study + open context | public non-target context only |
56
+ | `t1_external` | Out-of-time | BugSigDB curation after the snapshot |
57
+ | `t1_v3_strict_nocohort` | Strict − cohort | no GMrepo/mBodyMap-only pairs, no co-occurrence edges |
58
+ | `t1_v3_strict_nooverlap` | Strict − BioProject overlap | GMrepo contrasts sharing projects with held-out studies removed |
59
+ | `t1_v3_strict_nocooc`, `t1_v3_temporal_nocooc` | − co-occurrence | GMrepo co-occurrence edges removed |
60
+ | `t1_v3_temporal_dated` | Temporal-dated | cohort support only if its data are dated ≤ 2021 |
61
+ | `t1_v3_p11_base/same/other` | Same-study control | one candidate set and test set; see `p11_pairs/` |
62
+
63
+ Every `t1_v3_*` variant keeps the parent's validation rows, test rows and filters; removed training pairs become filter-only (`known_extra`).
64
+
65
+ ## Load and evaluate
66
+
67
+ ```python
68
+ from microbekg_bench import load, Evaluator
69
+ from microbekg_bench.baselines import DegreePrior
70
+ case = load("t1_study_strict", 42, root="/path/to/v3")
71
+ result = Evaluator(case).evaluate(DegreePrior(case.train, case.n_entities))
72
+ print(result["metrics"]["mrr"], result["metrics"]["macro_mrr"])
73
+ ```
74
+
75
+ A scorer implements `candidates(queries, relations, pool, side)` and returns a score matrix. Ranking is filtered, covers both sides (tail: disease given microbe; head: microbe given disease), and gives half credit to each tied candidate. `macro_mrr` is the study-macro MRR: reciprocal ranks are averaged within each `study_id`, then across studies. Pass `groups=` for another grouping.
76
+
77
+ ## Submission format
78
+
79
+ One JSON object per setting and seed:
80
+
81
+ ```json
82
+ {"schema_version": "microbekg-bench-result-1", "model": "YourModel", "setting": "t1_study_strict", "seed": 42,
83
+ "metrics": {"mrr": 0.0, "macro_mrr": 0.0, "hits_at_1": 0.0, "hits_at_3": 0.0, "hits_at_10": 0.0},
84
+ "n_triples": 0, "code_url": "https://example.invalid/replace-me",
85
+ "environment": {"python": "3.12", "package_version": "3.0.0"}}
86
+ ```
87
+
88
+ Report the paired difference to the degree prior on the same test rows. The paper labels a difference better or worse only when its 95% interval excludes 0, and equivalent when the 90% interval lies within ±0.005 MRR.
89
+
90
+ ## Distribution
91
+
92
+ Dataset page: [ZachGu/MicrobeKG](https://huggingface.co/datasets/ZachGu/MicrobeKG). The v3 data archive is pending a Google Drive download link. Original data checksums and manifest are in `release_metadata/`; they describe the separate archive. BugSigDB exports carry CC BY 4.0 in the export header; other sources follow `SOURCE_TERMS.*`.
93
+
94
+ ## Rebuilding
95
+
96
+ `make_release.py` rebuilds the data part from the benchmark build outputs (all paths are arguments; it refuses to overwrite an existing output directory). `finalize_release.py` writes `RELEASE_MANIFEST.json` and `checksums.sha256`; the checksum list covers the manifest.
bench_v3/SOURCE_TERMS.json ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "graph_version": "audited-20260928",
3
+ "count_date": "2026-09-29",
4
+ "counts_overlap": true,
5
+ "public_redistribution_review_complete": false,
6
+ "sources": [
7
+ {
8
+ "source": "AGORA2",
9
+ "current_labelled_assertions": 1496721,
10
+ "license_observation": "MIT on repository; downloaded SBML scope needs confirmation",
11
+ "status": "partial",
12
+ "evidence_url": "https://github.com/VirtualMetabolicHuman/AGORA2",
13
+ "original_review_date": "2026-09-18",
14
+ "last_terms_check_date": "2026-09-18",
15
+ "notes": "Repository redirects model downloads to VMH; preserve model attribution and confirm SBML terms."
16
+ },
17
+ {
18
+ "source": "BugSigDB",
19
+ "current_labelled_assertions": 15197,
20
+ "license_observation": "ODC-BY-1.0",
21
+ "status": "verified",
22
+ "evidence_url": "https://bugsigdb.org/Project:About",
23
+ "original_review_date": "2026-09-18",
24
+ "last_terms_check_date": "2026-09-18",
25
+ "notes": "Data licensing section explicitly covers database reuse; preserve attribution and notices."
26
+ },
27
+ {
28
+ "source": "CTD",
29
+ "current_labelled_assertions": 124973,
30
+ "license_observation": "Non-commercial access; commercial download license",
31
+ "status": "restricted",
32
+ "evidence_url": "https://academic.oup.com/nar/article/53/D1/D1328/7816860",
33
+ "original_review_date": "2026-09-18",
34
+ "last_terms_check_date": "2026-09-29",
35
+ "notes": "The authors describe free non-commercial availability and a commercial download license. This does not establish unrestricted bulk redistribution of the derived graph.",
36
+ "check_method": "Read Data availability in the CTD authors' 2025 update."
37
+ },
38
+ {
39
+ "source": "Disbiome",
40
+ "current_labelled_assertions": 6715,
41
+ "license_observation": "No explicit data license established",
42
+ "status": "pending",
43
+ "evidence_url": "https://disbiome.ugent.be/",
44
+ "original_review_date": "2026-09-18",
45
+ "last_terms_check_date": "2026-09-18",
46
+ "notes": "Download access and article availability do not establish redistribution rights."
47
+ },
48
+ {
49
+ "source": "GMMAD",
50
+ "current_labelled_assertions": 1046640,
51
+ "license_observation": "No explicit data license established",
52
+ "status": "pending",
53
+ "evidence_url": "https://pmc.ncbi.nlm.nih.gov/articles/PMC10464125/",
54
+ "original_review_date": "2026-09-18",
55
+ "last_terms_check_date": "2026-09-18",
56
+ "notes": "Database paper located; exact downloaded-table terms still required."
57
+ },
58
+ {
59
+ "source": "GMrepo_v3",
60
+ "current_labelled_assertions": 19849,
61
+ "license_observation": "No explicit data license established",
62
+ "status": "pending",
63
+ "evidence_url": "https://gmrepo.humangut.info/",
64
+ "original_review_date": "2026-09-18",
65
+ "last_terms_check_date": "2026-09-18",
66
+ "notes": "Confirm terms for the v3 phenotype and abundance exports used here."
67
+ },
68
+ {
69
+ "source": "HMDAD",
70
+ "current_labelled_assertions": 407,
71
+ "license_observation": "No explicit data license established",
72
+ "status": "pending",
73
+ "evidence_url": "http://www.cuilab.cn/hmdad",
74
+ "original_review_date": "2026-09-18",
75
+ "last_terms_check_date": "2026-09-18",
76
+ "notes": "Confirm original association table license."
77
+ },
78
+ {
79
+ "source": "HMDB",
80
+ "current_labelled_assertions": 850148,
81
+ "license_observation": "Official terms require explicit permission and acknowledgment for commercial use and redistribution.",
82
+ "status": "restricted_pending_snapshot",
83
+ "evidence_url": "https://www.hmdb.ca/downloads",
84
+ "original_review_date": "2026-09-18",
85
+ "last_terms_check_date": "2026-09-29",
86
+ "notes": "Commercial restriction verified in current official page text. Exact source snapshot and applicable redistribution permission remain to be confirmed.",
87
+ "check_method": "Official download/about page text returned by web search; direct page access unavailable."
88
+ },
89
+ {
90
+ "source": "Lit44",
91
+ "current_labelled_assertions": 1941,
92
+ "license_observation": "Per-article extracted factual assertions; heterogeneous terms",
93
+ "status": "pending",
94
+ "evidence_url": "",
95
+ "original_review_date": "2026-09-18",
96
+ "last_terms_check_date": "2026-09-18",
97
+ "notes": "Historical source label. Retained assertion evidence contains study identifiers; exact article/supplement terms require per-study review. Full texts are not included."
98
+ },
99
+ {
100
+ "source": "MeSH",
101
+ "current_labelled_assertions": 8076,
102
+ "license_observation": "NLM MeSH Terms and Conditions",
103
+ "status": "verified_terms",
104
+ "evidence_url": "https://www.nlm.nih.gov/databases/download/terms_and_conditions_mesh.html",
105
+ "original_review_date": "2026-09-18",
106
+ "last_terms_check_date": "2026-09-18",
107
+ "notes": "Acknowledge NLM; no endorsement; identify frozen version (local source desc2026.xml.gz)."
108
+ },
109
+ {
110
+ "source": "NCBI_Taxonomy",
111
+ "current_labelled_assertions": 58610,
112
+ "license_observation": "NCBI government-information policy, subject to third-party notices",
113
+ "status": "verified_terms",
114
+ "evidence_url": "https://www.ncbi.nlm.nih.gov/home/about/policies/",
115
+ "original_review_date": "2026-09-18",
116
+ "last_terms_check_date": "2026-09-18",
117
+ "notes": "Acknowledge NCBI and retain snapshot/version information; not a blanket license for other NCBI-hosted resources."
118
+ },
119
+ {
120
+ "source": "NJC19",
121
+ "current_labelled_assertions": 5042,
122
+ "license_observation": "Dryad dataset terms; snapshot license confirmation pending",
123
+ "status": "partial",
124
+ "evidence_url": "https://datadryad.org/dataset/doi:10.5061/dryad.dr7sqv9v8",
125
+ "original_review_date": "2026-09-18",
126
+ "last_terms_check_date": "2026-09-18",
127
+ "notes": "Exact upstream dataset and NJC19 archive located; retain Lim et al. 2020 citation."
128
+ },
129
+ {
130
+ "source": "Peryton",
131
+ "current_labelled_assertions": 3439,
132
+ "license_observation": "No explicit data license established",
133
+ "status": "pending",
134
+ "evidence_url": "https://dianalab.e-ce.uth.gr/peryton/",
135
+ "original_review_date": "2026-09-18",
136
+ "last_terms_check_date": "2026-09-18",
137
+ "notes": "Confirm downloadable associations terms separately from paper license."
138
+ },
139
+ {
140
+ "source": "Piccinno_2025",
141
+ "current_labelled_assertions": 191,
142
+ "license_observation": "Source/supplement-specific terms to confirm",
143
+ "status": "pending",
144
+ "evidence_url": "https://doi.org/10.1038/s41591-025-03693-9",
145
+ "original_review_date": "2026-09-18",
146
+ "last_terms_check_date": "2026-09-18",
147
+ "notes": "Confirm license and third-party notices for the exact MaAsLin2/phylogenetic/meta-analysis tables."
148
+ },
149
+ {
150
+ "source": "Thomas_2019",
151
+ "current_labelled_assertions": 52,
152
+ "license_observation": "Source/supplement-specific terms to confirm",
153
+ "status": "pending",
154
+ "evidence_url": "https://doi.org/10.1038/s41591-019-0405-7",
155
+ "original_review_date": "2026-09-18",
156
+ "last_terms_check_date": "2026-09-18",
157
+ "notes": "Confirm exact supplement identity and reuse terms; not inferred from another article."
158
+ },
159
+ {
160
+ "source": "cross_source_conflict",
161
+ "current_labelled_assertions": 1054,
162
+ "license_observation": "Derived; preserve all contributing-source restrictions",
163
+ "status": "derived",
164
+ "evidence_url": "https://github.com/ZachGu-00/MicrobeKG-dataset_split_task/blob/2324306309e8851596b443e2711fef4b1bf41d66/scripts/step_merge_kg.py",
165
+ "original_review_date": "2026-09-18",
166
+ "last_terms_check_date": "2026-09-18",
167
+ "notes": "Conflict mining is original processing; underlying evidence remains source-governed."
168
+ },
169
+ {
170
+ "source": "gutMDisorder_v2",
171
+ "current_labelled_assertions": 2041,
172
+ "license_observation": "No explicit data license established",
173
+ "status": "pending",
174
+ "evidence_url": "https://bio-computing.hrbmu.edu.cn/gutMDisorder/",
175
+ "original_review_date": "2026-09-18",
176
+ "last_terms_check_date": "2026-09-18",
177
+ "notes": "Freely accessible resource does not establish an unrestricted data license."
178
+ },
179
+ {
180
+ "source": "gutMGene",
181
+ "current_labelled_assertions": 4771,
182
+ "license_observation": "No explicit data license established",
183
+ "status": "pending",
184
+ "evidence_url": "https://bio-computing.hrbmu.edu.cn/gutmgene/",
185
+ "original_review_date": "2026-09-18",
186
+ "last_terms_check_date": "2026-09-18",
187
+ "notes": "Confirm terms for the three downloaded interaction tables."
188
+ },
189
+ {
190
+ "source": "mBodyMap",
191
+ "current_labelled_assertions": 8252,
192
+ "license_observation": "No explicit data license established",
193
+ "status": "pending",
194
+ "evidence_url": "https://mbodymap.microbiome.cloud/",
195
+ "original_review_date": "2026-09-18",
196
+ "last_terms_check_date": "2026-09-18",
197
+ "notes": "Confirm terms for phenotype/body-site/species exports."
198
+ }
199
+ ]
200
+ }
bench_v3/SOURCE_TERMS.md ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Sources, attribution, and licensing observations
2
+
3
+ Counts refer to audited-20260928 and were independently recomputed from the exported records.
4
+ They count assertion rows carrying each source label; multi-source rows contribute to more than one count.
5
+ The 19 labels consist of 18 upstream labels and one derived conflict label.
6
+
7
+ This is a source-terms record, not an unrestricted public redistribution license.
8
+ `verified` / `verified_terms` indicate a located statement, not clearance for every possible use.
9
+ `pending` means the applicable permission has not been established, not that reuse is forbidden.
10
+ `partial` means the located statement does not yet establish the exact downloaded payload's terms.
11
+ `restricted` / `restricted_pending_snapshot` preserve known qualifications.
12
+ Publication licensing and database or supplementary-table licensing may differ.
13
+
14
+ The earlier source review was dated 2026-09-18. Only HMDB and CTD were refreshed on 2026-09-29
15
+ for this packaging task; dates below do not imply a new review of the other providers.
16
+ See [source_terms.json](source_terms.json) for the machine-readable record and [LICENSE](LICENSE) for scope.
17
+
18
+ | Source label | Labelled assertions | Status | Terms observation | Last checked | Evidence |
19
+ |---|---:|---|---|---|---|
20
+ | AGORA2 | 1,496,721 | partial | MIT on repository; downloaded SBML scope needs confirmation | 2026-09-18 | [Provider / publication](https://github.com/VirtualMetabolicHuman/AGORA2) |
21
+ | BugSigDB | 15,197 | verified | ODC-BY-1.0 | 2026-09-18 | [Provider / publication](https://bugsigdb.org/Project:About) |
22
+ | CTD | 124,973 | restricted | Non-commercial access; commercial download license | 2026-09-29 | [Provider / publication](https://academic.oup.com/nar/article/53/D1/D1328/7816860) |
23
+ | Disbiome | 6,715 | pending | No explicit data license established | 2026-09-18 | [Provider / publication](https://disbiome.ugent.be/) |
24
+ | GMMAD | 1,046,640 | pending | No explicit data license established | 2026-09-18 | [Provider / publication](https://pmc.ncbi.nlm.nih.gov/articles/PMC10464125/) |
25
+ | GMrepo_v3 | 19,849 | pending | No explicit data license established | 2026-09-18 | [Provider / publication](https://gmrepo.humangut.info/) |
26
+ | HMDAD | 407 | pending | No explicit data license established | 2026-09-18 | [Provider / publication](http://www.cuilab.cn/hmdad) |
27
+ | HMDB | 850,148 | restricted_pending_snapshot | Official terms require explicit permission and acknowledgment for commercial use and redistribution. | 2026-09-29 | [Provider / publication](https://www.hmdb.ca/downloads) |
28
+ | Lit44 | 1,941 | pending | Per-article extracted factual assertions; heterogeneous terms | 2026-09-18 | Study identifiers in each record's evidence |
29
+ | MeSH | 8,076 | verified_terms | NLM MeSH Terms and Conditions | 2026-09-18 | [Provider / publication](https://www.nlm.nih.gov/databases/download/terms_and_conditions_mesh.html) |
30
+ | NCBI_Taxonomy | 58,610 | verified_terms | NCBI government-information policy, subject to third-party notices | 2026-09-18 | [Provider / publication](https://www.ncbi.nlm.nih.gov/home/about/policies/) |
31
+ | NJC19 | 5,042 | partial | Dryad dataset terms; snapshot license confirmation pending | 2026-09-18 | [Provider / publication](https://datadryad.org/dataset/doi:10.5061/dryad.dr7sqv9v8) |
32
+ | Peryton | 3,439 | pending | No explicit data license established | 2026-09-18 | [Provider / publication](https://dianalab.e-ce.uth.gr/peryton/) |
33
+ | Piccinno_2025 | 191 | pending | Source/supplement-specific terms to confirm | 2026-09-18 | [Provider / publication](https://doi.org/10.1038/s41591-025-03693-9) |
34
+ | Thomas_2019 | 52 | pending | Source/supplement-specific terms to confirm | 2026-09-18 | [Provider / publication](https://doi.org/10.1038/s41591-019-0405-7) |
35
+ | cross_source_conflict | 1,054 | derived | Derived; preserve all contributing-source restrictions | 2026-09-18 | [Provider / publication](https://github.com/ZachGu-00/MicrobeKG-dataset_split_task/blob/2324306309e8851596b443e2711fef4b1bf41d66/scripts/step_merge_kg.py) |
36
+ | gutMDisorder_v2 | 2,041 | pending | No explicit data license established | 2026-09-18 | [Provider / publication](https://bio-computing.hrbmu.edu.cn/gutMDisorder/) |
37
+ | gutMGene | 4,771 | pending | No explicit data license established | 2026-09-18 | [Provider / publication](https://bio-computing.hrbmu.edu.cn/gutmgene/) |
38
+ | mBodyMap | 8,252 | pending | No explicit data license established | 2026-09-18 | [Provider / publication](https://mbodymap.microbiome.cloud/) |
39
+
40
+ ## Source-specific notes
41
+
42
+ - **AGORA2**: Repository redirects model downloads to VMH; preserve model attribution and confirm SBML terms.
43
+ - **BugSigDB**: Data licensing section explicitly covers database reuse; preserve attribution and notices.
44
+ - **CTD**: The authors describe free non-commercial availability and a commercial download license. This does not establish unrestricted bulk redistribution of the derived graph.
45
+ - **Disbiome**: Download access and article availability do not establish redistribution rights.
46
+ - **GMMAD**: Database paper located; exact downloaded-table terms still required.
47
+ - **GMrepo_v3**: Confirm terms for the v3 phenotype and abundance exports used here.
48
+ - **HMDAD**: Confirm original association table license.
49
+ - **HMDB**: Commercial restriction verified in current official page text. Exact source snapshot and applicable redistribution permission remain to be confirmed.
50
+ - **Lit44**: Historical source label. Retained assertion evidence contains study identifiers; exact article/supplement terms require per-study review. Full texts are not included.
51
+ - **MeSH**: Acknowledge NLM; no endorsement; identify frozen version (local source desc2026.xml.gz).
52
+ - **NCBI_Taxonomy**: Acknowledge NCBI and retain snapshot/version information; not a blanket license for other NCBI-hosted resources.
53
+ - **NJC19**: Exact upstream dataset and NJC19 archive located; retain Lim et al. 2020 citation.
54
+ - **Peryton**: Confirm downloadable associations terms separately from paper license.
55
+ - **Piccinno_2025**: Confirm license and third-party notices for the exact MaAsLin2/phylogenetic/meta-analysis tables.
56
+ - **Thomas_2019**: Confirm exact supplement identity and reuse terms; not inferred from another article.
57
+ - **cross_source_conflict**: Conflict mining is original processing; underlying evidence remains source-governed.
58
+ - **gutMDisorder_v2**: Freely accessible resource does not establish an unrestricted data license.
59
+ - **gutMGene**: Confirm terms for the three downloaded interaction tables.
60
+ - **mBodyMap**: Confirm terms for phenotype/body-site/species exports.
61
+
62
+ ## Attribution
63
+
64
+ Acknowledge MicrobeKG and the original providers whose records are used. Follow each provider's
65
+ requested citation and preserve the source/evidence fields. MeSH and NCBI inclusion does not
66
+ imply endorsement by NLM, NCBI, or the United States government. This package does not change
67
+ upstream licensing conditions or certify that all third-party permissions have been obtained.
bench_v3/build_info.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "ctd_hmdb_only_triples_removed": 975088,
3
+ "settings": [
4
+ "t1_pair",
5
+ "t1_study",
6
+ "t1_study_reveal",
7
+ "t1_study_strict",
8
+ "t1_study_ctx_open",
9
+ "t1_temporal",
10
+ "t1_temporal_nodis",
11
+ "t1_cold_microbe",
12
+ "t1_cold_disease",
13
+ "t1_v3_strict_nocohort",
14
+ "t1_v3_strict_nooverlap",
15
+ "t1_v3_strict_nocooc",
16
+ "t1_v3_temporal_nocooc",
17
+ "t1_v3_temporal_dated",
18
+ "t1_v3_p11_base",
19
+ "t1_v3_p11_same",
20
+ "t1_v3_p11_other"
21
+ ],
22
+ "seeds": [
23
+ 42,
24
+ 123,
25
+ 456,
26
+ 789,
27
+ 2024
28
+ ],
29
+ "graph_version": "audited-20260928",
30
+ "benchmark_version": "mkbench-v3"
31
+ }
bench_v3/finalize_release.py ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Write RELEASE_MANIFEST.json and checksums.sha256 for a release directory.
3
+
4
+ The manifest lists every file except itself and checksums.sha256 (SHA-256, bytes, Parquet row counts, source labels,
5
+ licence status). checksums.sha256 is written last and covers every file including RELEASE_MANIFEST.json, so
6
+ `sha256sum -c checksums.sha256` verifies the whole tree. Caches and build leftovers are refused.
7
+
8
+ Usage: python finalize_release.py <release_dir>
9
+ """
10
+ from __future__ import annotations
11
+ import hashlib, json, sys
12
+ from pathlib import Path
13
+ import pandas as pd
14
+
15
+ SKIP = {"RELEASE_MANIFEST.json", "checksums.sha256"}
16
+ BAD = ("__pycache__", ".pytest_cache", ".egg-info", ".ipynb_checkpoints")
17
+ SOURCES = {
18
+ "benchmark/entities.tsv": ["NCBI_Taxonomy", "MeSH", "multiple upstream sources"],
19
+ "benchmark/triples.parquet": ["NCBI_Taxonomy", "MeSH", "BugSigDB", "Disbiome", "GMMAD", "GMrepo_v3", "HMDAD",
20
+ "Peryton", "Lit44", "gutMDisorder_v2", "Piccinno_2025", "Thomas_2019", "mBodyMap",
21
+ "AGORA2", "gutMGene", "NJC19"],
22
+ "records/records_v2.parquet": ["see SOURCE_TERMS.json"],
23
+ "external/external_pairs.parquet": ["BugSigDB"],
24
+ "tested_null.parquet": ["GMrepo_v3"],
25
+ }
26
+
27
+
28
+ def sha256(p):
29
+ h = hashlib.sha256()
30
+ with open(p, "rb") as f:
31
+ for b in iter(lambda: f.read(8 << 20), b""):
32
+ h.update(b)
33
+ return h.hexdigest()
34
+
35
+
36
+ def main(root: Path):
37
+ files = sorted(p for p in root.rglob("*") if p.is_file())
38
+ bad = [str(p.relative_to(root)) for p in files if any(b in str(p) for b in BAD)]
39
+ if bad:
40
+ raise SystemExit(f"remove build leftovers first: {bad[:5]}")
41
+ info = json.loads((root / "build_info.json").read_text())
42
+ man = {"release_version": "3.0.0", "graph_version": info["graph_version"],
43
+ "benchmark_version": info["benchmark_version"], "settings": info["settings"], "seeds": info["seeds"],
44
+ "ctd_hmdb_only_triples_removed": info["ctd_hmdb_only_triples_removed"],
45
+ "distribution_url": "https://huggingface.co/datasets/ANONYMIZED/MicrobeKG-Bench (placeholder)",
46
+ "ctx_full": "rebuild-only", "files": []}
47
+ for p in files:
48
+ rel = p.relative_to(root).as_posix()
49
+ if rel in SKIP:
50
+ continue
51
+ item = {"path": rel, "sha256": sha256(p), "bytes": p.stat().st_size, "source_labels": SOURCES.get(rel, []),
52
+ "license_status": ("restricted-source-safe derived release" if rel.startswith("benchmark") else
53
+ "BugSigDB CC BY 4.0" if rel.startswith("external") else "see SOURCE_TERMS.json")}
54
+ if p.suffix == ".parquet":
55
+ item["rows"] = int(pd.read_parquet(p).shape[0])
56
+ man["files"].append(item)
57
+ (root / "RELEASE_MANIFEST.json").write_text(json.dumps(man, ensure_ascii=False, indent=2) + "\n")
58
+ rows = [f"{sha256(p)} {p.relative_to(root).as_posix()}" for p in sorted(root.rglob("*"))
59
+ if p.is_file() and p.name != "checksums.sha256"]
60
+ (root / "checksums.sha256").write_text("\n".join(rows) + "\n")
61
+ print(json.dumps({"files": len(rows), "bytes": sum(i["bytes"] for i in man["files"])}))
62
+
63
+
64
+ if __name__ == "__main__":
65
+ main(Path(sys.argv[1]))
bench_v3/make_release.py ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Build the data part of the licence-aware MicrobeKG-Bench v3 release.
3
+
4
+ Inputs are read-only; only --out is written. Graph triples and splits are stored as Parquet with stable entity and
5
+ relation identifiers (never server-local row numbers). Triples supported only by CTD/HMDB are excluded; the
6
+ full-context setting is represented by a rebuild recipe. Validation and test tables carry a `study_id` column (the
7
+ evidence cluster used for study-macro MRR and the hierarchical bootstrap: first literature study of the pair, else its
8
+ cohort group; for the external set, the BugSigDB study). `finalize_release.py` writes the manifest and checksums.
9
+
10
+ Example:
11
+ python make_release.py --bench bench2 --bench3 bench3 --external bench_ext --records records_v2.tsv \
12
+ --edges final_kg_edges.tsv --source-terms-json source_terms.json --source-terms-md SOURCE_TERMS.md --out out
13
+ """
14
+ from __future__ import annotations
15
+ import argparse, json, os, shutil
16
+ from pathlib import Path
17
+ import numpy as np
18
+ import pandas as pd
19
+
20
+ RESTRICTED = {"CTD", "HMDB"}
21
+ SEEDS = [42, 123, 456, 789, 2024]
22
+ SETTINGS = ["t1_pair", "t1_study", "t1_study_reveal", "t1_study_strict", "t1_study_ctx_open", "t1_temporal",
23
+ "t1_temporal_nodis", "t1_cold_microbe", "t1_cold_disease"]
24
+ V3 = ["t1_v3_strict_nocohort", "t1_v3_strict_nooverlap", "t1_v3_strict_nocooc", "t1_v3_temporal_nocooc",
25
+ "t1_v3_temporal_dated", "t1_v3_p11_base", "t1_v3_p11_same", "t1_v3_p11_other"]
26
+ PARTS = ["train", "valid", "test", "known_extra", "conflict", "negatives", "probe_positive", "random_control_positive"]
27
+ COLS = ["head_id", "head_type", "relation", "tail_id", "tail_type"]
28
+
29
+
30
+ def write_json(p, o):
31
+ p.parent.mkdir(parents=True, exist_ok=True)
32
+ p.write_text(json.dumps(o, ensure_ascii=False, indent=2) + "\n")
33
+
34
+
35
+ def triples_df(x, ents, rels):
36
+ names, types = ents.node_id.to_numpy(), ents.node_type.to_numpy()
37
+ return pd.DataFrame({"head_id": names[x[:, 0]], "head_type": types[x[:, 0]],
38
+ "relation": np.asarray(rels, dtype=object)[x[:, 1]], "tail_id": names[x[:, 2]],
39
+ "tail_type": types[x[:, 2]]})
40
+
41
+
42
+ def write_split(raw, x, keep_codes, ents, rels, sd, seed, study_of):
43
+ n = len(ents)
44
+ for part in PARTS:
45
+ vals = raw[part] if part in raw.files else np.array([], np.int32)
46
+ rows = vals if vals.ndim == 2 else np.asarray(x[vals])
47
+ rows = (np.asarray([r for r in rows if tuple(map(int, r)) in keep_codes], np.int32).reshape((-1, 3))
48
+ if len(rows) else np.empty((0, 3), np.int32))
49
+ df = triples_df(rows, ents, rels) if len(rows) else pd.DataFrame(columns=COLS)
50
+ if part in ("valid", "test"):
51
+ code = rows[:, 0].astype(np.int64) * n + rows[:, 2]
52
+ df["study_id"] = [study_of.get(int(c), "") for c in code]
53
+ df.to_parquet(sd / f"seed_{seed}_{part}.parquet", index=False)
54
+ elig = raw["candidate_eligible"]
55
+ pd.DataFrame({"entity_index": np.flatnonzero(elig), "node_id": ents.node_id.to_numpy()[elig],
56
+ "node_type": ents.node_type.to_numpy()[elig]}).to_parquet(
57
+ sd / f"seed_{seed}_candidate_entities.parquet", index=False)
58
+ np.savez_compressed(sd / f"seed_{seed}_aux.npz", **{k: raw[k] for k in raw.files if k.endswith("_eligible") or
59
+ k in ("taxonomy_hop", "ontology_hop", "random_control")})
60
+
61
+
62
+ def main():
63
+ ap = argparse.ArgumentParser()
64
+ for a in ["bench", "bench3", "external", "records", "edges", "source-terms-json", "source-terms-md", "out"]:
65
+ ap.add_argument(f"--{a}", type=Path, required=True)
66
+ args = ap.parse_args()
67
+ out = args.out
68
+ if out.exists():
69
+ raise SystemExit(f"{out} exists; choose a new output directory")
70
+ out.mkdir(parents=True)
71
+ b, b3, e = args.bench, args.bench3, args.external
72
+ ents = pd.read_csv(b / "entities.tsv", sep="\t", dtype=str, keep_default_na=False)
73
+ rels = json.loads((b / "relations.json").read_text())
74
+ x = np.load(b / "triples.npy")
75
+ n, R = len(ents), len(rels)
76
+ idx = {(t, i): j for j, t, i in ents[["entity_index", "node_type", "node_id"]].itertuples(index=False, name=None)}
77
+ rix = {r: i for i, r in enumerate(rels)}
78
+ code = lambda h, r, t: (h.astype(np.int64) * R + r) * n + t
79
+ xcode = code(x[:, 0], x[:, 1], x[:, 2])
80
+ assert np.all(np.diff(xcode) > 0), "server triples must be sorted and unique"
81
+ restricted = np.ones(len(x), bool)
82
+ for df in pd.read_csv(args.edges, sep="\t", usecols=COLS + ["source"], dtype=str, keep_default_na=False,
83
+ chunksize=500000):
84
+ h = np.fromiter((idx[(a, c)] for a, c in zip(df.head_type, df.head_id)), np.int64, len(df))
85
+ t = np.fromiter((idx[(a, c)] for a, c in zip(df.tail_type, df.tail_id)), np.int64, len(df))
86
+ r = np.fromiter((rix[v] for v in df.relation), np.int64, len(df))
87
+ pos = np.searchsorted(xcode, code(h, r, t))
88
+ ok = np.fromiter((bool(set(s.split("|")) - RESTRICTED) for s in df.source), bool, len(df))
89
+ restricted[pos[ok]] = False
90
+ keep = ~restricted
91
+ removed = int(restricted.sum())
92
+ bd = out / "benchmark"
93
+ (bd / "splits").mkdir(parents=True)
94
+ ents.to_csv(bd / "entities.tsv", sep="\t", index=False)
95
+ write_json(bd / "relations.json", rels)
96
+ triples_df(x[keep], ents, rels).to_parquet(bd / "triples.parquet", index=False)
97
+ pub = set(map(tuple, x[keep].tolist()))
98
+ ps = pd.read_csv(b / "pair_support.tsv", sep="\t", dtype=str, keep_default_na=False)
99
+ ps.to_parquet(bd / "pair_support.parquet", index=False)
100
+ l1, c1 = ps.lit_studies.str.split(";").str[0], ps.cohort_studies.str.split(";").str[0]
101
+ study_of = dict(zip(ps.code.astype(np.int64).tolist(), np.where(l1 != "", l1, c1).tolist()))
102
+ pd.read_csv(b / "tested_null.tsv", sep="\t", dtype=str, keep_default_na=False).to_parquet(
103
+ out / "tested_null.parquet", index=False)
104
+ for setting in SETTINGS + V3:
105
+ src_root = b3 if setting in V3 else b
106
+ sd = bd / "splits" / setting
107
+ sd.mkdir(parents=True, exist_ok=True)
108
+ for seed in SEEDS:
109
+ src = src_root / "splits" / setting / f"seed_{seed}"
110
+ meta = json.loads(src.with_suffix(".json").read_text())
111
+ raw = np.load(src.with_suffix(".npz"), allow_pickle=False)
112
+ write_split(raw, x, pub, ents, rels, sd, seed, study_of)
113
+ write_json(sd / f"seed_{seed}.json", {**meta, "released_representation": "triple_parquet",
114
+ "source_row_indices_not_released": True})
115
+ print(setting, "done", flush=True)
116
+ # P1-1 pair sets (revealed same-study pairs, their matched subset, and the matched other-study reserve)
117
+ pd_dir = bd / "p11_pairs"
118
+ pd_dir.mkdir()
119
+ names = ents.node_id.to_numpy()
120
+ for seed in SEEDS:
121
+ z = np.load(b3 / f"p11_pairs_seed{seed}.npz")
122
+ frames = [pd.DataFrame({"set": k, "head_id": names[z[k] // n], "tail_id": names[z[k] % n]})
123
+ for k in ["revealed", "matched", "reserve"]]
124
+ pd.concat(frames).to_parquet(pd_dir / f"seed_{seed}.parquet", index=False)
125
+ write_json(bd / "variants_build_audit.json", json.loads((b3 / "build_audit.json").read_text()))
126
+ write_json(bd / "t1_study_ctx_full_REBUILD_REQUIRED.json", {
127
+ "setting": "t1_study_ctx_full", "status": "rebuild-required",
128
+ "reason": "training context includes triples supported only by CTD/HMDB; source terms restrict redistribution",
129
+ "script": "mkbench_build_v2.py in the code supplement",
130
+ "inputs": "the audited graph and source permissions; not included"})
131
+ # external time-out set
132
+ ext_x = np.load(e / "triples.npy", mmap_mode="r")
133
+ ext_codes = set(map(tuple, ext_x.tolist()))
134
+ exd = out / "external"
135
+ exd.mkdir()
136
+ shutil.copy2(e / "entities.tsv", exd / "entities.tsv")
137
+ shutil.copy2(e / "relations.json", exd / "relations.json")
138
+ ext = pd.read_csv(e / "external_pairs.tsv", sep="\t", dtype=str, keep_default_na=False)
139
+ ext["study_id"] = ext.bsdb.str.split("/").str[0] # BugSigDB study (PMID- or DOI-keyed)
140
+ ext.loc[ext.study_id.str.startswith("bsdb:10."), "pmid"] = "" # DOI-keyed studies have no PMID
141
+ ext.to_parquet(exd / "external_pairs.parquet", index=False)
142
+ ext_study = ext.groupby(ext.code.astype(np.int64)).study_id.first().to_dict()
143
+ ents_e = pd.read_csv(e / "entities.tsv", sep="\t", dtype=str, keep_default_na=False)
144
+ rels_e = json.loads((e / "relations.json").read_text())
145
+ sd = exd / "splits" / "t1_external"
146
+ sd.mkdir(parents=True)
147
+ for seed in SEEDS:
148
+ src = e / "splits" / "t1_external" / f"seed_{seed}"
149
+ raw = np.load(src.with_suffix(".npz"), allow_pickle=False)
150
+ write_split(raw, ext_x, ext_codes, ents_e, rels_e, sd, seed, ext_study)
151
+ write_json(sd / f"seed_{seed}.json", {**json.loads(src.with_suffix(".json").read_text()),
152
+ "released_representation": "triple_parquet",
153
+ "source_row_indices_not_released": True})
154
+ # record layer without personal-information columns
155
+ rec = pd.read_csv(args.records, sep="\t", dtype=str, keep_default_na=False)
156
+ pii = [c for c in rec.columns if c.lower() in {"authors", "author", "curator", "submittedby", "revision_editor",
157
+ "email", "name", "location_of_subjects"}]
158
+ rec = rec.drop(columns=pii, errors="ignore")
159
+ (out / "records").mkdir()
160
+ rec.to_parquet(out / "records" / "records_v2.parquet", index=False)
161
+ write_json(out / "records" / "schema.json", {"columns": {c: {"dtype": "string", "personal_information": False,
162
+ "source": "derived upstream record export"}
163
+ for c in rec.columns}, "removed_columns": pii})
164
+ write_json(out / "SOURCE_TERMS.json", json.loads(args.source_terms_json.read_text()))
165
+ shutil.copy2(args.source_terms_md, out / "SOURCE_TERMS.md")
166
+ write_json(out / "build_info.json", {"ctd_hmdb_only_triples_removed": removed, "settings": SETTINGS + V3,
167
+ "seeds": SEEDS, "graph_version": "audited-20260928",
168
+ "benchmark_version": "mkbench-v3"})
169
+ for root, dirs, files in os.walk(out):
170
+ for d in dirs:
171
+ os.chmod(Path(root) / d, 0o755)
172
+ for f in files:
173
+ os.chmod(Path(root) / f, 0o644)
174
+ print(json.dumps({"out": str(out), "removed_ctd_hmdb_only": removed}), flush=True)
175
+
176
+
177
+ if __name__ == "__main__":
178
+ main()
bench_v3/microbekg_bench/__init__.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ """Public MicrobeKG-Bench v3 loader and evaluator."""
2
+ from .loader import Case, load
3
+ from .evaluator import Evaluator, filtered_rank, ranking_metrics
4
+ __version__ = "3.0.0"
5
+ __all__ = ["Case", "load", "Evaluator", "filtered_rank", "ranking_metrics"]
bench_v3/microbekg_bench/baselines.py ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+ import numpy as np
3
+ from scipy import sparse
4
+
5
+ class DegreePrior:
6
+ """Popularity scorer matching core.LightScorer(model='Popularity')."""
7
+ def __init__(self,train,n):
8
+ self.degree=np.bincount(np.r_[train[:,0],train[:,2]],minlength=n)
9
+ def candidates(self,queries,relations,pool,side):
10
+ q=np.asarray(queries); p=np.asarray(pool)
11
+ return self.degree[q,None]*self.degree[p][None,:]
12
+ def triples(self,rows): return self.degree[rows[:,0]]*self.degree[rows[:,2]]
13
+
14
+ Popularity=DegreePrior
15
+
16
+ class _GraphScorer:
17
+ def __init__(self,train,n):
18
+ h,t=train[:,0],train[:,2]; self.adj=(sparse.csr_matrix((np.ones(2*len(h)),(np.r_[h,t],np.r_[t,h])),shape=(n,n))>0).astype(np.float32)
19
+ deg=np.asarray(self.adj.sum(axis=1)).ravel(); self.inv=sparse.diags(1/np.maximum(deg,1)); self.sqrt_inv=sparse.diags(1/np.sqrt(np.maximum(deg,1)))
20
+ def _paths(self,q):
21
+ v=self.adj[q]
22
+ if self.model=='CN': return v@self.adj
23
+ if self.model=='RA': return (v@self.inv)@self.adj
24
+ return (((v@self.sqrt_inv)@self.adj)@self.sqrt_inv)@self.adj
25
+ def candidates(self,queries,relations,pool,side): return self._paths(np.asarray(queries))[:,np.asarray(pool)].toarray()
26
+ def triples(self,rows):
27
+ out=np.empty(len(rows))
28
+ for h in np.unique(rows[:,0]):
29
+ m=rows[:,0]==h; out[m]=self._paths(np.array([h]))[:,rows[m,2]].toarray().ravel()
30
+ return out
31
+ class CN(_GraphScorer): model='CN'
32
+ class RA(_GraphScorer): model='RA'
33
+ class L3(_GraphScorer): model='L3'
bench_v3/microbekg_bench/evaluator.py ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+ from collections import defaultdict
3
+ import numpy as np
4
+
5
+ HITS=(1,3,5,10,20)
6
+
7
+ def filtered_rank(scores,target_position,known_positions):
8
+ scores=np.asarray(scores,float); assert np.isfinite(scores).all()
9
+ keep=np.ones(len(scores),bool); keep[np.asarray(list(known_positions),dtype=int)]=False; keep[target_position]=False
10
+ return 1+np.count_nonzero(scores[keep]>scores[target_position])+0.5*np.count_nonzero(scores[keep]==scores[target_position])
11
+
12
+ def ranking_metrics(ranks, groups=None, seed=42, n_boot=1000):
13
+ ranks=np.asarray(ranks,float)
14
+ if not len(ranks): return None
15
+ out={'mrr':float(np.mean(1/ranks)),**{f'hits_at_{k}':float(np.mean(ranks<=k)) for k in HITS},'n_ranks':len(ranks)}
16
+ if groups is None: groups=np.arange(len(ranks))
17
+ groups=np.asarray(groups); vals=[]
18
+ for g in np.unique(groups): vals.append(float(np.mean(1/ranks[groups==g])))
19
+ out['macro_mrr']=float(np.mean(vals)); rng=np.random.default_rng(seed); boot=[float(np.mean(rng.choice(vals,len(vals),replace=True))) for _ in range(n_boot)]
20
+ out['macro_mrr_ci95']=np.quantile(boot,[.025,.975]).tolist()
21
+ return out
22
+
23
+ class Evaluator:
24
+ """Frozen-core-compatible filtered ranking for explicit triples.
25
+
26
+ `metrics['macro_mrr']` is the study-macro MRR: reciprocal ranks of both
27
+ sides are averaged within each study_id, then across studies. Pass
28
+ `groups=` to use another grouping.
29
+
30
+ A scorer may implement candidates(queries, relations, pool, side), returning
31
+ a score matrix. Alternatively pass score arrays to evaluate_scores.
32
+ """
33
+ def __init__(self,case): self.case=case
34
+ def _known(self, rows):
35
+ kt,kh=defaultdict(set),defaultdict(set)
36
+ for h,r,t in rows:
37
+ kt[(int(h),int(r))].add(int(t)); kh[(int(r),int(t))].add(int(h))
38
+ return kt,kh
39
+ def evaluate(self,scorer,split='test',batch=16,groups=None):
40
+ rows=getattr(self.case,split)
41
+ mask=self.case.arrays.get(f'{split}_eligible')
42
+ study=self.case.study_ids.get(split) if hasattr(self.case,'study_ids') else None
43
+ if mask is not None and len(mask)==len(rows): rows=rows[mask]; study=None if study is None else study[mask]
44
+ train=self.case.train; extra=self.case.arrays.get('known_extra',np.empty((0,3),np.int32))
45
+ known_rows=np.concatenate([train,self.case.valid,extra,rows]) if split=='test' else np.concatenate([train])
46
+ kt,kh=self._known(known_rows); sides=['tail','head']; out={}
47
+ for side in sides:
48
+ wanted='disease' if side=='tail' else 'microbe'; pool=np.flatnonzero((self.case.node_types==wanted)&self.case.candidate_mask); pos={int(v):i for i,v in enumerate(pool)}
49
+ query_groups=defaultdict(list)
50
+ for i,(h,r,t) in enumerate(rows): query_groups[(int(h if side=='tail' else t),int(r))].append(i)
51
+ ranks=np.empty(len(rows),float)
52
+ for start in range(0,len(query_groups),batch):
53
+ chunk=list(query_groups)[start:start+batch]; scores=scorer.candidates(np.array([q for q,_ in chunk]),np.array([r for _,r in chunk]),pool,side)
54
+ for j,(q,r) in enumerate(chunk):
55
+ gold=kt.get((q,r),()) if side=='tail' else kh.get((r,q),()); known=[pos[v] for v in gold if v in pos]
56
+ for i in query_groups[(q,r)]:
57
+ target=rows[i,2] if side=='tail' else rows[i,0]; ranks[i]=filtered_rank(scores[j],pos[int(target)],known)
58
+ out[side]=ranks
59
+ groups=(rows[:,0] if study is None else study) if groups is None else np.asarray(groups)
60
+ merged=np.concatenate([out['tail'],out['head']]); return {'ranks':out,'metrics':ranking_metrics(merged, np.tile(groups,2), seed=self.case.seed), 'ranking_triples':rows}
61
+ def evaluate_scores(self,scores_tail,scores_head=None,split='test',groups=None):
62
+ rows=getattr(self.case,split)
63
+ mask=self.case.arrays.get(f'{split}_eligible')
64
+ study=self.case.study_ids.get(split) if hasattr(self.case,'study_ids') else None
65
+ if mask is not None and len(mask)==len(rows): rows=rows[mask]; study=None if study is None else study[mask]
66
+ a=np.asarray(scores_tail); b=a if scores_head is None else np.asarray(scores_head)
67
+ known=np.concatenate([self.case.train,self.case.valid,self.case.arrays.get('known_extra',np.empty((0,3),np.int32)),rows]) if split=='test' else self.case.train
68
+ kt,kh=self._known(known)
69
+ ranks={}
70
+ for side,scores in [('tail',a),('head',b)]:
71
+ wanted='disease' if side=='tail' else 'microbe'; pool=np.flatnonzero((self.case.node_types==wanted)&self.case.candidate_mask); pos={int(v):i for i,v in enumerate(pool)}; rr=[]
72
+ for i,(h,r,t) in enumerate(rows):
73
+ q=int(h if side=='tail' else t); target=int(t if side=='tail' else h); gold=kt.get((q,int(r)),()) if side=='tail' else kh.get((int(r),q),()); rr.append(filtered_rank(scores[i],pos[target],[pos[v] for v in gold if v in pos]))
74
+ ranks[side]=np.asarray(rr)
75
+ groups=(rows[:,0] if study is None else study) if groups is None else np.asarray(groups)
76
+ return {'ranks':ranks,'metrics':ranking_metrics(np.concatenate([ranks['tail'],ranks['head']]),np.tile(groups,2),seed=self.case.seed)}
bench_v3/microbekg_bench/loader.py ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+ from dataclasses import dataclass
3
+ import json
4
+ from pathlib import Path
5
+ import numpy as np
6
+ import pandas as pd
7
+
8
+ @dataclass
9
+ class Case:
10
+ setting: str
11
+ seed: int
12
+ entities: pd.DataFrame
13
+ relations: list[str]
14
+ train: np.ndarray
15
+ valid: np.ndarray
16
+ test: np.ndarray
17
+ candidate_mask: np.ndarray
18
+ filter_triples: np.ndarray
19
+ arrays: dict[str, np.ndarray]
20
+ metadata: dict
21
+ root: Path
22
+ study_ids: dict[str, np.ndarray]
23
+ @property
24
+ def n_entities(self): return len(self.entities)
25
+ @property
26
+ def node_types(self): return self.entities.node_type.to_numpy()
27
+ @property
28
+ def relation_ids(self): return {r:i for i,r in enumerate(self.relations)}
29
+
30
+ def _read_rows(path, ent, rid):
31
+ df=pd.read_parquet(path)
32
+ if len(df)==0: return np.empty((0,3),np.int32)
33
+ idx={(t,i):j for j,t,i in ent[['entity_index','node_type','node_id']].itertuples(index=False,name=None)}
34
+ return np.asarray([[idx[(ht,h)],rid[r],idx[(tt,t)]] for h,ht,r,t,tt in df[['head_id','head_type','relation','tail_id','tail_type']].itertuples(index=False,name=None)],dtype=np.int32)
35
+
36
+ def load(setting: str, seed: int, root='.', *, external=False) -> Case:
37
+ """Load explicit triple tables, candidate mask, and filter set.
38
+
39
+ `root` is the local release directory. `external=True` loads the
40
+ t1_external split under external/. `filter_triples` is train plus
41
+ known_extra; the evaluator additionally filters validation and test
42
+ triples in test mode. `study_ids['valid' | 'test']` holds the evidence
43
+ study of every row (used for study-macro MRR).
44
+ """
45
+ root=Path(root); base=root/'external' if external or setting=='t1_external' else root/'benchmark'
46
+ ent=pd.read_csv(base/'entities.tsv',sep='\t',dtype=str,keep_default_na=False); rel=json.loads((base/'relations.json').read_text()); rid={r:i for i,r in enumerate(rel)}
47
+ sd=base/'splits'/setting; prefix=sd/f'seed_{seed}'
48
+ meta=json.loads(prefix.with_suffix('.json').read_text()); raw=np.load(prefix.with_name(prefix.name+'_aux.npz'),allow_pickle=False)
49
+ read=lambda part:_read_rows(sd/f'seed_{seed}_{part}.parquet',ent,rid)
50
+ train,valid,test=read('train'),read('valid'),read('test'); known=read('known_extra')
51
+ candidate=np.zeros(len(ent),bool); c=pd.read_parquet(sd/f'seed_{seed}_candidate_entities.parquet'); candidate[c.entity_index.to_numpy(dtype=int)]=True
52
+ seen=np.zeros(len(ent),bool); seen[np.concatenate([train[:,[0,2]].ravel()])]=True
53
+ candidate &= seen
54
+ # Known filters are all training assertions, plus known_extra. The evaluator adds validation/test assertions for test mode.
55
+ filt=np.concatenate([train,known]) if len(known) else train.copy()
56
+ arrays={k:raw[k] for k in raw.files}
57
+ arrays['known_extra']=known
58
+ study={part:pd.read_parquet(sd/f'seed_{seed}_{part}.parquet',columns=['study_id']).study_id.to_numpy(dtype=str) for part in ('valid','test')}
59
+ return Case(setting,seed,ent,rel,train,valid,test,candidate,filt,arrays,meta,root,study)
bench_v3/pyproject.toml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "microbekg-bench"
7
+ version = "3.0.0"
8
+ description = "Licence-aware loaders and filtered rank evaluator for MicrobeKG-Bench"
9
+ requires-python = ">=3.12"
10
+ dependencies = ["numpy>=2.3,<3", "pandas>=2.2", "scipy>=1.14", "pyarrow>=16"]
11
+
12
+ [project.optional-dependencies]
13
+ test = ["pytest>=8"]
14
+
15
+ [tool.setuptools]
16
+ packages = ["microbekg_bench"]
17
+
18
+ [tool.pytest.ini_options]
19
+ testpaths = ["tests"]
bench_v3/release_metadata/README.md ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ # Original data-package provenance
2
+
3
+ These two files are copied byte-for-byte from `MicrobeKG-Bench_release_v3.zip`.
4
+ Their paths and hashes refer to the original archive's `v3/` directory, not this
5
+ code-only repository. The distribution URL in the original manifest was a
6
+ placeholder when the archive was built. See ../README.md for publication status.
bench_v3/release_metadata/RELEASE_MANIFEST.json ADDED
The diff for this file is too large to render. See raw diff
 
bench_v3/release_metadata/checksums.sha256 ADDED
The diff for this file is too large to render. See raw diff
 
bench_v3/tests/reference_metrics.json ADDED
@@ -0,0 +1,1082 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "t1_cold_disease|DegreePrior|123": {
3
+ "hits_at_10": 0.01894678183337977,
4
+ "mrr": 0.011175666741627809,
5
+ "n_triples": 3589,
6
+ "study_macro_mrr": 0.015676440170364896
7
+ },
8
+ "t1_cold_disease|DegreePrior|2024": {
9
+ "hits_at_10": 0.00620928338762215,
10
+ "mrr": 0.004230590840391603,
11
+ "n_triples": 4912,
12
+ "study_macro_mrr": 0.017798226780989936
13
+ },
14
+ "t1_cold_disease|DegreePrior|42": {
15
+ "hits_at_10": 0.014273668995422789,
16
+ "mrr": 0.008775422498820457,
17
+ "n_triples": 8302,
18
+ "study_macro_mrr": 0.020248863588067278
19
+ },
20
+ "t1_cold_disease|DegreePrior|456": {
21
+ "hits_at_10": 0.013522112631244034,
22
+ "mrr": 0.008494100004136014,
23
+ "n_triples": 3143,
24
+ "study_macro_mrr": 0.015563891904620233
25
+ },
26
+ "t1_cold_disease|DegreePrior|789": {
27
+ "hits_at_10": 0.014304993252361673,
28
+ "mrr": 0.009322971910888022,
29
+ "n_triples": 7410,
30
+ "study_macro_mrr": 0.021167746728157574
31
+ },
32
+ "t1_cold_disease|L3|123": {
33
+ "hits_at_10": 0.01100585121203678,
34
+ "mrr": 0.006154726409873505,
35
+ "n_triples": 3589,
36
+ "study_macro_mrr": 0.005240392533788019
37
+ },
38
+ "t1_cold_disease|L3|2024": {
39
+ "hits_at_10": 0.006412866449511401,
40
+ "mrr": 0.0028050682656996294,
41
+ "n_triples": 4912,
42
+ "study_macro_mrr": 0.01490740644934764
43
+ },
44
+ "t1_cold_disease|L3|42": {
45
+ "hits_at_10": 0.008491929655504698,
46
+ "mrr": 0.003317851733563321,
47
+ "n_triples": 8302,
48
+ "study_macro_mrr": 0.006225202478534025
49
+ },
50
+ "t1_cold_disease|L3|456": {
51
+ "hits_at_10": 0.016385618835507477,
52
+ "mrr": 0.008808596309422843,
53
+ "n_triples": 3143,
54
+ "study_macro_mrr": 0.016845854838417964
55
+ },
56
+ "t1_cold_disease|L3|789": {
57
+ "hits_at_10": 0.01039136302294197,
58
+ "mrr": 0.0049409112375734966,
59
+ "n_triples": 7410,
60
+ "study_macro_mrr": 0.010995511508605338
61
+ },
62
+ "t1_cold_microbe|DegreePrior|123": {
63
+ "hits_at_10": 0.1632428466617755,
64
+ "mrr": 0.07549663474716581,
65
+ "n_triples": 4089,
66
+ "study_macro_mrr": 0.0656692135951374
67
+ },
68
+ "t1_cold_microbe|DegreePrior|2024": {
69
+ "hits_at_10": 0.1782828282828283,
70
+ "mrr": 0.07386943845393422,
71
+ "n_triples": 3960,
72
+ "study_macro_mrr": 0.06397157534392084
73
+ },
74
+ "t1_cold_microbe|DegreePrior|42": {
75
+ "hits_at_10": 0.16362271703777834,
76
+ "mrr": 0.07356325626859933,
77
+ "n_triples": 3997,
78
+ "study_macro_mrr": 0.0600310609010658
79
+ },
80
+ "t1_cold_microbe|DegreePrior|456": {
81
+ "hits_at_10": 0.17351026539809714,
82
+ "mrr": 0.06984328970584179,
83
+ "n_triples": 3994,
84
+ "study_macro_mrr": 0.0651528664571907
85
+ },
86
+ "t1_cold_microbe|DegreePrior|789": {
87
+ "hits_at_10": 0.165474297827239,
88
+ "mrr": 0.0736674229580044,
89
+ "n_triples": 3774,
90
+ "study_macro_mrr": 0.06187279844169425
91
+ },
92
+ "t1_cold_microbe|L3|123": {
93
+ "hits_at_10": 0.17693812668134018,
94
+ "mrr": 0.07891466824915933,
95
+ "n_triples": 4089,
96
+ "study_macro_mrr": 0.0660521985368362
97
+ },
98
+ "t1_cold_microbe|L3|2024": {
99
+ "hits_at_10": 0.16805555555555557,
100
+ "mrr": 0.07706962694433264,
101
+ "n_triples": 3960,
102
+ "study_macro_mrr": 0.0627258526379499
103
+ },
104
+ "t1_cold_microbe|L3|42": {
105
+ "hits_at_10": 0.1681260945709282,
106
+ "mrr": 0.07757556885292154,
107
+ "n_triples": 3997,
108
+ "study_macro_mrr": 0.06633714367054643
109
+ },
110
+ "t1_cold_microbe|L3|456": {
111
+ "hits_at_10": 0.164621932899349,
112
+ "mrr": 0.07592680957725649,
113
+ "n_triples": 3994,
114
+ "study_macro_mrr": 0.06836900477380131
115
+ },
116
+ "t1_cold_microbe|L3|789": {
117
+ "hits_at_10": 0.18044515103338632,
118
+ "mrr": 0.08489643019440865,
119
+ "n_triples": 3774,
120
+ "study_macro_mrr": 0.07377124425689723
121
+ },
122
+ "t1_external|DegreePrior|123": {
123
+ "hits_at_10": 0.09523809523809523,
124
+ "mrr": 0.05200564900891358,
125
+ "n_triples": 5418,
126
+ "study_macro_mrr": 0.06618060109823114
127
+ },
128
+ "t1_external|DegreePrior|2024": {
129
+ "hits_at_10": 0.0950756178531907,
130
+ "mrr": 0.0520134426227598,
131
+ "n_triples": 5422,
132
+ "study_macro_mrr": 0.06614624992536157
133
+ },
134
+ "t1_external|DegreePrior|42": {
135
+ "hits_at_10": 0.09516337456156544,
136
+ "mrr": 0.05211648472376375,
137
+ "n_triples": 5417,
138
+ "study_macro_mrr": 0.06617809139715988
139
+ },
140
+ "t1_external|DegreePrior|456": {
141
+ "hits_at_10": 0.09492619926199262,
142
+ "mrr": 0.05187372269198201,
143
+ "n_triples": 5420,
144
+ "study_macro_mrr": 0.06610782039636913
145
+ },
146
+ "t1_external|DegreePrior|789": {
147
+ "hits_at_10": 0.09514581026208933,
148
+ "mrr": 0.05200594294603729,
149
+ "n_triples": 5418,
150
+ "study_macro_mrr": 0.06617475678668681
151
+ },
152
+ "t1_external|L3|123": {
153
+ "hits_at_10": 0.08619416758951642,
154
+ "mrr": 0.04145155153156657,
155
+ "n_triples": 5418,
156
+ "study_macro_mrr": 0.05378636649521667
157
+ },
158
+ "t1_external|L3|2024": {
159
+ "hits_at_10": 0.08594614533382516,
160
+ "mrr": 0.04130490226790065,
161
+ "n_triples": 5422,
162
+ "study_macro_mrr": 0.05407482017237286
163
+ },
164
+ "t1_external|L3|42": {
165
+ "hits_at_10": 0.0875023075503046,
166
+ "mrr": 0.04248040237726208,
167
+ "n_triples": 5417,
168
+ "study_macro_mrr": 0.05539057079760644
169
+ },
170
+ "t1_external|L3|456": {
171
+ "hits_at_10": 0.08699261992619926,
172
+ "mrr": 0.041972772099733886,
173
+ "n_triples": 5420,
174
+ "study_macro_mrr": 0.054433397025787394
175
+ },
176
+ "t1_external|L3|789": {
177
+ "hits_at_10": 0.0873015873015873,
178
+ "mrr": 0.04188152402755,
179
+ "n_triples": 5418,
180
+ "study_macro_mrr": 0.05423356007516135
181
+ },
182
+ "t1_pair|DegreePrior|123": {
183
+ "hits_at_10": 0.19382255389718075,
184
+ "mrr": 0.08682677069791735,
185
+ "n_triples": 4824,
186
+ "study_macro_mrr": 0.0729705867931706
187
+ },
188
+ "t1_pair|DegreePrior|2024": {
189
+ "hits_at_10": 0.18219461697722567,
190
+ "mrr": 0.0822571806392637,
191
+ "n_triples": 4830,
192
+ "study_macro_mrr": 0.07343974728404919
193
+ },
194
+ "t1_pair|DegreePrior|42": {
195
+ "hits_at_10": 0.19083177763949388,
196
+ "mrr": 0.08399067513607038,
197
+ "n_triples": 4821,
198
+ "study_macro_mrr": 0.07384103944100759
199
+ },
200
+ "t1_pair|DegreePrior|456": {
201
+ "hits_at_10": 0.19341478566991097,
202
+ "mrr": 0.08648852034910025,
203
+ "n_triples": 4829,
204
+ "study_macro_mrr": 0.08084087233163856
205
+ },
206
+ "t1_pair|DegreePrior|789": {
207
+ "hits_at_10": 0.1949679022571961,
208
+ "mrr": 0.08502139930218758,
209
+ "n_triples": 4829,
210
+ "study_macro_mrr": 0.07297057971082267
211
+ },
212
+ "t1_pair|L3|123": {
213
+ "hits_at_10": 0.22719734660033167,
214
+ "mrr": 0.10269486431800849,
215
+ "n_triples": 4824,
216
+ "study_macro_mrr": 0.08267847465098623
217
+ },
218
+ "t1_pair|L3|2024": {
219
+ "hits_at_10": 0.22236024844720498,
220
+ "mrr": 0.09693749636164864,
221
+ "n_triples": 4830,
222
+ "study_macro_mrr": 0.08368526442917329
223
+ },
224
+ "t1_pair|L3|42": {
225
+ "hits_at_10": 0.22236050611906244,
226
+ "mrr": 0.09949517026874596,
227
+ "n_triples": 4821,
228
+ "study_macro_mrr": 0.08548034113837351
229
+ },
230
+ "t1_pair|L3|456": {
231
+ "hits_at_10": 0.22913646717746947,
232
+ "mrr": 0.0998321307903051,
233
+ "n_triples": 4829,
234
+ "study_macro_mrr": 0.0858496916527765
235
+ },
236
+ "t1_pair|L3|789": {
237
+ "hits_at_10": 0.23420998136260096,
238
+ "mrr": 0.0995474072372528,
239
+ "n_triples": 4829,
240
+ "study_macro_mrr": 0.08125355195242011
241
+ },
242
+ "t1_study_ctx_open|DegreePrior|123": {
243
+ "hits_at_10": 0.06097560975609756,
244
+ "mrr": 0.03596999096185663,
245
+ "n_triples": 861,
246
+ "study_macro_mrr": 0.07522067908744018
247
+ },
248
+ "t1_study_ctx_open|DegreePrior|2024": {
249
+ "hits_at_10": 0.10885045778229908,
250
+ "mrr": 0.05226533137883285,
251
+ "n_triples": 983,
252
+ "study_macro_mrr": 0.07648877574202632
253
+ },
254
+ "t1_study_ctx_open|DegreePrior|42": {
255
+ "hits_at_10": 0.11696230598669623,
256
+ "mrr": 0.05708478588997818,
257
+ "n_triples": 902,
258
+ "study_macro_mrr": 0.0697251395912254
259
+ },
260
+ "t1_study_ctx_open|DegreePrior|456": {
261
+ "hits_at_10": 0.0849440488301119,
262
+ "mrr": 0.03512259322766143,
263
+ "n_triples": 983,
264
+ "study_macro_mrr": 0.057269157355553255
265
+ },
266
+ "t1_study_ctx_open|DegreePrior|789": {
267
+ "hits_at_10": 0.09679037111334002,
268
+ "mrr": 0.04863413065232558,
269
+ "n_triples": 997,
270
+ "study_macro_mrr": 0.074366051943805
271
+ },
272
+ "t1_study_ctx_open|L3|123": {
273
+ "hits_at_10": 0.07665505226480836,
274
+ "mrr": 0.036422625561042914,
275
+ "n_triples": 861,
276
+ "study_macro_mrr": 0.06740468185436012
277
+ },
278
+ "t1_study_ctx_open|L3|2024": {
279
+ "hits_at_10": 0.12156663275686673,
280
+ "mrr": 0.050440570002329536,
281
+ "n_triples": 983,
282
+ "study_macro_mrr": 0.07660105169459155
283
+ },
284
+ "t1_study_ctx_open|L3|42": {
285
+ "hits_at_10": 0.10920177383592018,
286
+ "mrr": 0.04732396238740778,
287
+ "n_triples": 902,
288
+ "study_macro_mrr": 0.06795475462123768
289
+ },
290
+ "t1_study_ctx_open|L3|456": {
291
+ "hits_at_10": 0.0839267548321465,
292
+ "mrr": 0.03675133178230159,
293
+ "n_triples": 983,
294
+ "study_macro_mrr": 0.05130077494734632
295
+ },
296
+ "t1_study_ctx_open|L3|789": {
297
+ "hits_at_10": 0.10130391173520562,
298
+ "mrr": 0.043990261534237116,
299
+ "n_triples": 997,
300
+ "study_macro_mrr": 0.07046800659230885
301
+ },
302
+ "t1_study_reveal|DegreePrior|123": {
303
+ "hits_at_10": 0.078397212543554,
304
+ "mrr": 0.039086566182276974,
305
+ "n_triples": 861,
306
+ "study_macro_mrr": 0.06657015896840836
307
+ },
308
+ "t1_study_reveal|DegreePrior|2024": {
309
+ "hits_at_10": 0.12258392675483215,
310
+ "mrr": 0.053524411773033936,
311
+ "n_triples": 983,
312
+ "study_macro_mrr": 0.07333095059134308
313
+ },
314
+ "t1_study_reveal|DegreePrior|42": {
315
+ "hits_at_10": 0.1590909090909091,
316
+ "mrr": 0.060952153384311196,
317
+ "n_triples": 902,
318
+ "study_macro_mrr": 0.06223022660055199
319
+ },
320
+ "t1_study_reveal|DegreePrior|456": {
321
+ "hits_at_10": 0.09003051881993897,
322
+ "mrr": 0.036648882879188854,
323
+ "n_triples": 983,
324
+ "study_macro_mrr": 0.056855305703833736
325
+ },
326
+ "t1_study_reveal|DegreePrior|789": {
327
+ "hits_at_10": 0.11885656970912738,
328
+ "mrr": 0.04597670945673408,
329
+ "n_triples": 997,
330
+ "study_macro_mrr": 0.07239163945756968
331
+ },
332
+ "t1_study_reveal|L3|123": {
333
+ "hits_at_10": 0.09872241579558652,
334
+ "mrr": 0.04383069435063319,
335
+ "n_triples": 861,
336
+ "study_macro_mrr": 0.06844454918834438
337
+ },
338
+ "t1_study_reveal|L3|2024": {
339
+ "hits_at_10": 0.12512716174974567,
340
+ "mrr": 0.060278840193673286,
341
+ "n_triples": 983,
342
+ "study_macro_mrr": 0.08563516487868864
343
+ },
344
+ "t1_study_reveal|L3|42": {
345
+ "hits_at_10": 0.1491130820399113,
346
+ "mrr": 0.06479659157631786,
347
+ "n_triples": 902,
348
+ "study_macro_mrr": 0.07033201652056544
349
+ },
350
+ "t1_study_reveal|L3|456": {
351
+ "hits_at_10": 0.10071210579857579,
352
+ "mrr": 0.04524376934301082,
353
+ "n_triples": 983,
354
+ "study_macro_mrr": 0.06165409354109243
355
+ },
356
+ "t1_study_reveal|L3|789": {
357
+ "hits_at_10": 0.12236710130391174,
358
+ "mrr": 0.05228250389444538,
359
+ "n_triples": 997,
360
+ "study_macro_mrr": 0.07191652199185834
361
+ },
362
+ "t1_study_strict|DegreePrior|123": {
363
+ "hits_at_10": 0.06968641114982578,
364
+ "mrr": 0.03168932933456469,
365
+ "n_triples": 861,
366
+ "study_macro_mrr": 0.053863989651302575
367
+ },
368
+ "t1_study_strict|DegreePrior|2024": {
369
+ "hits_at_10": 0.10732451678535096,
370
+ "mrr": 0.04151548016445756,
371
+ "n_triples": 983,
372
+ "study_macro_mrr": 0.05636962550852782
373
+ },
374
+ "t1_study_strict|DegreePrior|42": {
375
+ "hits_at_10": 0.15188470066518847,
376
+ "mrr": 0.04995558213253886,
377
+ "n_triples": 902,
378
+ "study_macro_mrr": 0.04777587959431876
379
+ },
380
+ "t1_study_strict|DegreePrior|456": {
381
+ "hits_at_10": 0.08036622583926754,
382
+ "mrr": 0.031747132253694195,
383
+ "n_triples": 983,
384
+ "study_macro_mrr": 0.05007915726457204
385
+ },
386
+ "t1_study_strict|DegreePrior|789": {
387
+ "hits_at_10": 0.11384152457372117,
388
+ "mrr": 0.04016697180363898,
389
+ "n_triples": 997,
390
+ "study_macro_mrr": 0.0650927449749852
391
+ },
392
+ "t1_study_strict|L3|123": {
393
+ "hits_at_10": 0.06794425087108014,
394
+ "mrr": 0.029551598602836605,
395
+ "n_triples": 861,
396
+ "study_macro_mrr": 0.049277442698671105
397
+ },
398
+ "t1_study_strict|L3|2024": {
399
+ "hits_at_10": 0.0762970498474059,
400
+ "mrr": 0.034239438652098046,
401
+ "n_triples": 983,
402
+ "study_macro_mrr": 0.05140458431946213
403
+ },
404
+ "t1_study_strict|L3|42": {
405
+ "hits_at_10": 0.08924611973392461,
406
+ "mrr": 0.037527544658907064,
407
+ "n_triples": 902,
408
+ "study_macro_mrr": 0.04764274012134352
409
+ },
410
+ "t1_study_strict|L3|456": {
411
+ "hits_at_10": 0.05747711088504578,
412
+ "mrr": 0.02458909340887678,
413
+ "n_triples": 983,
414
+ "study_macro_mrr": 0.03577142321587757
415
+ },
416
+ "t1_study_strict|L3|789": {
417
+ "hits_at_10": 0.07522567703109329,
418
+ "mrr": 0.03113580226209212,
419
+ "n_triples": 997,
420
+ "study_macro_mrr": 0.05344239177215379
421
+ },
422
+ "t1_study|DegreePrior|123": {
423
+ "hits_at_10": 0.07491289198606271,
424
+ "mrr": 0.03667175627906706,
425
+ "n_triples": 861,
426
+ "study_macro_mrr": 0.06525599903978663
427
+ },
428
+ "t1_study|DegreePrior|2024": {
429
+ "hits_at_10": 0.12258392675483215,
430
+ "mrr": 0.051003949445677585,
431
+ "n_triples": 983,
432
+ "study_macro_mrr": 0.07124350266450377
433
+ },
434
+ "t1_study|DegreePrior|42": {
435
+ "hits_at_10": 0.15687361419068735,
436
+ "mrr": 0.059969154488406125,
437
+ "n_triples": 902,
438
+ "study_macro_mrr": 0.061423685831697765
439
+ },
440
+ "t1_study|DegreePrior|456": {
441
+ "hits_at_10": 0.09003051881993897,
442
+ "mrr": 0.035107234783829634,
443
+ "n_triples": 983,
444
+ "study_macro_mrr": 0.05571728269326745
445
+ },
446
+ "t1_study|DegreePrior|789": {
447
+ "hits_at_10": 0.11384152457372117,
448
+ "mrr": 0.043023780288868434,
449
+ "n_triples": 997,
450
+ "study_macro_mrr": 0.07159334805133154
451
+ },
452
+ "t1_study|L3|123": {
453
+ "hits_at_10": 0.07781649245063879,
454
+ "mrr": 0.036232059419054004,
455
+ "n_triples": 861,
456
+ "study_macro_mrr": 0.06161891524024309
457
+ },
458
+ "t1_study|L3|2024": {
459
+ "hits_at_10": 0.10325534079348932,
460
+ "mrr": 0.04910165727431009,
461
+ "n_triples": 983,
462
+ "study_macro_mrr": 0.07572514435756536
463
+ },
464
+ "t1_study|L3|42": {
465
+ "hits_at_10": 0.10975609756097561,
466
+ "mrr": 0.04952592673127282,
467
+ "n_triples": 902,
468
+ "study_macro_mrr": 0.06386208828298189
469
+ },
470
+ "t1_study|L3|456": {
471
+ "hits_at_10": 0.07934893184130214,
472
+ "mrr": 0.03283235870304389,
473
+ "n_triples": 983,
474
+ "study_macro_mrr": 0.052221605284541145
475
+ },
476
+ "t1_study|L3|789": {
477
+ "hits_at_10": 0.09077231695085256,
478
+ "mrr": 0.03982731973852169,
479
+ "n_triples": 997,
480
+ "study_macro_mrr": 0.06840719950760443
481
+ },
482
+ "t1_temporal_nodis|DegreePrior|123": {
483
+ "hits_at_10": 0.07742811863255604,
484
+ "mrr": 0.03585032627644236,
485
+ "n_triples": 4417,
486
+ "study_macro_mrr": 0.050234329163813075
487
+ },
488
+ "t1_temporal_nodis|DegreePrior|2024": {
489
+ "hits_at_10": 0.07742811863255604,
490
+ "mrr": 0.03585032627644236,
491
+ "n_triples": 4417,
492
+ "study_macro_mrr": 0.050234329163813075
493
+ },
494
+ "t1_temporal_nodis|DegreePrior|42": {
495
+ "hits_at_10": 0.07742811863255604,
496
+ "mrr": 0.03585032627644236,
497
+ "n_triples": 4417,
498
+ "study_macro_mrr": 0.050234329163813075
499
+ },
500
+ "t1_temporal_nodis|DegreePrior|456": {
501
+ "hits_at_10": 0.07742811863255604,
502
+ "mrr": 0.03585032627644236,
503
+ "n_triples": 4417,
504
+ "study_macro_mrr": 0.050234329163813075
505
+ },
506
+ "t1_temporal_nodis|DegreePrior|789": {
507
+ "hits_at_10": 0.07742811863255604,
508
+ "mrr": 0.03585032627644236,
509
+ "n_triples": 4417,
510
+ "study_macro_mrr": 0.050234329163813075
511
+ },
512
+ "t1_temporal_nodis|L3|123": {
513
+ "hits_at_10": 0.07142857142857142,
514
+ "mrr": 0.03331217971744074,
515
+ "n_triples": 4417,
516
+ "study_macro_mrr": 0.05448530842217733
517
+ },
518
+ "t1_temporal_nodis|L3|2024": {
519
+ "hits_at_10": 0.07142857142857142,
520
+ "mrr": 0.03331217971744074,
521
+ "n_triples": 4417,
522
+ "study_macro_mrr": 0.05448530842217733
523
+ },
524
+ "t1_temporal_nodis|L3|42": {
525
+ "hits_at_10": 0.07142857142857142,
526
+ "mrr": 0.03331217971744074,
527
+ "n_triples": 4417,
528
+ "study_macro_mrr": 0.05448530842217733
529
+ },
530
+ "t1_temporal_nodis|L3|456": {
531
+ "hits_at_10": 0.07142857142857142,
532
+ "mrr": 0.03331217971744074,
533
+ "n_triples": 4417,
534
+ "study_macro_mrr": 0.05448530842217733
535
+ },
536
+ "t1_temporal_nodis|L3|789": {
537
+ "hits_at_10": 0.07142857142857142,
538
+ "mrr": 0.03331217971744074,
539
+ "n_triples": 4417,
540
+ "study_macro_mrr": 0.05448530842217733
541
+ },
542
+ "t1_temporal|DegreePrior|123": {
543
+ "hits_at_10": 0.07901585048497753,
544
+ "mrr": 0.040273375664782764,
545
+ "n_triples": 4227,
546
+ "study_macro_mrr": 0.05470884820051152
547
+ },
548
+ "t1_temporal|DegreePrior|2024": {
549
+ "hits_at_10": 0.07901585048497753,
550
+ "mrr": 0.040273375664782764,
551
+ "n_triples": 4227,
552
+ "study_macro_mrr": 0.05470884820051152
553
+ },
554
+ "t1_temporal|DegreePrior|42": {
555
+ "hits_at_10": 0.07901585048497753,
556
+ "mrr": 0.040273375664782764,
557
+ "n_triples": 4227,
558
+ "study_macro_mrr": 0.05470884820051152
559
+ },
560
+ "t1_temporal|DegreePrior|456": {
561
+ "hits_at_10": 0.07901585048497753,
562
+ "mrr": 0.040273375664782764,
563
+ "n_triples": 4227,
564
+ "study_macro_mrr": 0.05470884820051152
565
+ },
566
+ "t1_temporal|DegreePrior|789": {
567
+ "hits_at_10": 0.07901585048497753,
568
+ "mrr": 0.040273375664782764,
569
+ "n_triples": 4227,
570
+ "study_macro_mrr": 0.05470884820051152
571
+ },
572
+ "t1_temporal|L3|123": {
573
+ "hits_at_10": 0.07014431038561628,
574
+ "mrr": 0.03321793269491999,
575
+ "n_triples": 4227,
576
+ "study_macro_mrr": 0.04749446571395512
577
+ },
578
+ "t1_temporal|L3|2024": {
579
+ "hits_at_10": 0.07014431038561628,
580
+ "mrr": 0.03321793269491999,
581
+ "n_triples": 4227,
582
+ "study_macro_mrr": 0.04749446571395512
583
+ },
584
+ "t1_temporal|L3|42": {
585
+ "hits_at_10": 0.07014431038561628,
586
+ "mrr": 0.03321793269491999,
587
+ "n_triples": 4227,
588
+ "study_macro_mrr": 0.04749446571395512
589
+ },
590
+ "t1_temporal|L3|456": {
591
+ "hits_at_10": 0.07014431038561628,
592
+ "mrr": 0.03321793269491999,
593
+ "n_triples": 4227,
594
+ "study_macro_mrr": 0.04749446571395512
595
+ },
596
+ "t1_temporal|L3|789": {
597
+ "hits_at_10": 0.07014431038561628,
598
+ "mrr": 0.03321793269491999,
599
+ "n_triples": 4227,
600
+ "study_macro_mrr": 0.04749446571395512
601
+ },
602
+ "t1_v3_p11_base|DegreePrior|123": {
603
+ "hits_at_10": 0.07491289198606271,
604
+ "mrr": 0.03557590272598854,
605
+ "n_triples": 861,
606
+ "study_macro_mrr": 0.06462826319520361
607
+ },
608
+ "t1_v3_p11_base|DegreePrior|2024": {
609
+ "hits_at_10": 0.12321792260692464,
610
+ "mrr": 0.05000896615648251,
611
+ "n_triples": 982,
612
+ "study_macro_mrr": 0.07041654155814633
613
+ },
614
+ "t1_v3_p11_base|DegreePrior|42": {
615
+ "hits_at_10": 0.15521064301552107,
616
+ "mrr": 0.05928126209937928,
617
+ "n_triples": 902,
618
+ "study_macro_mrr": 0.06088297668576127
619
+ },
620
+ "t1_v3_p11_base|DegreePrior|456": {
621
+ "hits_at_10": 0.08850457782299084,
622
+ "mrr": 0.03422739036974793,
623
+ "n_triples": 983,
624
+ "study_macro_mrr": 0.05483224232687852
625
+ },
626
+ "t1_v3_p11_base|DegreePrior|789": {
627
+ "hits_at_10": 0.11334002006018054,
628
+ "mrr": 0.04220308976298163,
629
+ "n_triples": 997,
630
+ "study_macro_mrr": 0.07121911285592003
631
+ },
632
+ "t1_v3_p11_base|L3|123": {
633
+ "hits_at_10": 0.07607433217189315,
634
+ "mrr": 0.03479956651848861,
635
+ "n_triples": 861,
636
+ "study_macro_mrr": 0.060756899514611315
637
+ },
638
+ "t1_v3_p11_base|L3|2024": {
639
+ "hits_at_10": 0.10336048879837068,
640
+ "mrr": 0.04814787872005135,
641
+ "n_triples": 982,
642
+ "study_macro_mrr": 0.07024365110945727
643
+ },
644
+ "t1_v3_p11_base|L3|42": {
645
+ "hits_at_10": 0.10809312638580931,
646
+ "mrr": 0.04792615801327106,
647
+ "n_triples": 902,
648
+ "study_macro_mrr": 0.0604626093110202
649
+ },
650
+ "t1_v3_p11_base|L3|456": {
651
+ "hits_at_10": 0.07731434384537131,
652
+ "mrr": 0.03200393218372854,
653
+ "n_triples": 983,
654
+ "study_macro_mrr": 0.05169196068091839
655
+ },
656
+ "t1_v3_p11_base|L3|789": {
657
+ "hits_at_10": 0.08575727181544635,
658
+ "mrr": 0.03777052165913537,
659
+ "n_triples": 997,
660
+ "study_macro_mrr": 0.06562649519497477
661
+ },
662
+ "t1_v3_p11_other|DegreePrior|123": {
663
+ "hits_at_10": 0.07491289198606271,
664
+ "mrr": 0.03667175726429913,
665
+ "n_triples": 861,
666
+ "study_macro_mrr": 0.06525599949304614
667
+ },
668
+ "t1_v3_p11_other|DegreePrior|2024": {
669
+ "hits_at_10": 0.12270875763747455,
670
+ "mrr": 0.05105254719332618,
671
+ "n_triples": 982,
672
+ "study_macro_mrr": 0.07125919831778801
673
+ },
674
+ "t1_v3_p11_other|DegreePrior|42": {
675
+ "hits_at_10": 0.15687361419068735,
676
+ "mrr": 0.05996915591405964,
677
+ "n_triples": 902,
678
+ "study_macro_mrr": 0.06142368690959226
679
+ },
680
+ "t1_v3_p11_other|DegreePrior|456": {
681
+ "hits_at_10": 0.09003051881993897,
682
+ "mrr": 0.03510723527247373,
683
+ "n_triples": 983,
684
+ "study_macro_mrr": 0.05571728289778145
685
+ },
686
+ "t1_v3_p11_other|DegreePrior|789": {
687
+ "hits_at_10": 0.11384152457372117,
688
+ "mrr": 0.04302378494367785,
689
+ "n_triples": 997,
690
+ "study_macro_mrr": 0.07159334982051613
691
+ },
692
+ "t1_v3_p11_other|L3|123": {
693
+ "hits_at_10": 0.07781649245063879,
694
+ "mrr": 0.03623260544178283,
695
+ "n_triples": 861,
696
+ "study_macro_mrr": 0.06161902309817766
697
+ },
698
+ "t1_v3_p11_other|L3|2024": {
699
+ "hits_at_10": 0.10336048879837068,
700
+ "mrr": 0.049148322550649964,
701
+ "n_triples": 982,
702
+ "study_macro_mrr": 0.07573526343181618
703
+ },
704
+ "t1_v3_p11_other|L3|42": {
705
+ "hits_at_10": 0.10975609756097561,
706
+ "mrr": 0.049526095267207755,
707
+ "n_triples": 902,
708
+ "study_macro_mrr": 0.06386216825073394
709
+ },
710
+ "t1_v3_p11_other|L3|456": {
711
+ "hits_at_10": 0.07934893184130214,
712
+ "mrr": 0.032832383985983066,
713
+ "n_triples": 983,
714
+ "study_macro_mrr": 0.05222162841084049
715
+ },
716
+ "t1_v3_p11_other|L3|789": {
717
+ "hits_at_10": 0.09077231695085256,
718
+ "mrr": 0.03982822911736146,
719
+ "n_triples": 997,
720
+ "study_macro_mrr": 0.06840792050778527
721
+ },
722
+ "t1_v3_p11_same|DegreePrior|123": {
723
+ "hits_at_10": 0.07549361207897794,
724
+ "mrr": 0.036736260187977,
725
+ "n_triples": 861,
726
+ "study_macro_mrr": 0.06534243244178223
727
+ },
728
+ "t1_v3_p11_same|DegreePrior|2024": {
729
+ "hits_at_10": 0.12270875763747455,
730
+ "mrr": 0.05107374842843163,
731
+ "n_triples": 982,
732
+ "study_macro_mrr": 0.0712786492839693
733
+ },
734
+ "t1_v3_p11_same|DegreePrior|42": {
735
+ "hits_at_10": 0.15687361419068735,
736
+ "mrr": 0.06005055906099694,
737
+ "n_triples": 902,
738
+ "study_macro_mrr": 0.0614502511073145
739
+ },
740
+ "t1_v3_p11_same|DegreePrior|456": {
741
+ "hits_at_10": 0.09003051881993897,
742
+ "mrr": 0.035123275826154585,
743
+ "n_triples": 983,
744
+ "study_macro_mrr": 0.05573365214016545
745
+ },
746
+ "t1_v3_p11_same|DegreePrior|789": {
747
+ "hits_at_10": 0.11384152457372117,
748
+ "mrr": 0.04313108261989078,
749
+ "n_triples": 997,
750
+ "study_macro_mrr": 0.07159464340566679
751
+ },
752
+ "t1_v3_p11_same|L3|123": {
753
+ "hits_at_10": 0.08478513356562137,
754
+ "mrr": 0.039113183563867567,
755
+ "n_triples": 861,
756
+ "study_macro_mrr": 0.06588694846802617
757
+ },
758
+ "t1_v3_p11_same|L3|2024": {
759
+ "hits_at_10": 0.10692464358452139,
760
+ "mrr": 0.05221758659435081,
761
+ "n_triples": 982,
762
+ "study_macro_mrr": 0.07773555199378185
763
+ },
764
+ "t1_v3_p11_same|L3|42": {
765
+ "hits_at_10": 0.14135254988913526,
766
+ "mrr": 0.05922077945787239,
767
+ "n_triples": 902,
768
+ "study_macro_mrr": 0.06669719308884166
769
+ },
770
+ "t1_v3_p11_same|L3|456": {
771
+ "hits_at_10": 0.08952187182095625,
772
+ "mrr": 0.036620681489992396,
773
+ "n_triples": 983,
774
+ "study_macro_mrr": 0.05603187692776498
775
+ },
776
+ "t1_v3_p11_same|L3|789": {
777
+ "hits_at_10": 0.10481444332998997,
778
+ "mrr": 0.0431205034058063,
779
+ "n_triples": 997,
780
+ "study_macro_mrr": 0.07132085388008744
781
+ },
782
+ "t1_v3_strict_nocohort|DegreePrior|123": {
783
+ "hits_at_10": 0.07741559953434225,
784
+ "mrr": 0.04075551042259972,
785
+ "n_triples": 859,
786
+ "study_macro_mrr": 0.08508003676160036
787
+ },
788
+ "t1_v3_strict_nocohort|DegreePrior|2024": {
789
+ "hits_at_10": 0.13021363173957273,
790
+ "mrr": 0.062309185389000474,
791
+ "n_triples": 983,
792
+ "study_macro_mrr": 0.09124807469921414
793
+ },
794
+ "t1_v3_strict_nocohort|DegreePrior|42": {
795
+ "hits_at_10": 0.1491130820399113,
796
+ "mrr": 0.07500577898074752,
797
+ "n_triples": 902,
798
+ "study_macro_mrr": 0.07849507268076428
799
+ },
800
+ "t1_v3_strict_nocohort|DegreePrior|456": {
801
+ "hits_at_10": 0.08748728382502544,
802
+ "mrr": 0.04027476980144042,
803
+ "n_triples": 983,
804
+ "study_macro_mrr": 0.06568024854241915
805
+ },
806
+ "t1_v3_strict_nocohort|DegreePrior|789": {
807
+ "hits_at_10": 0.11835506519558676,
808
+ "mrr": 0.053958778433802,
809
+ "n_triples": 997,
810
+ "study_macro_mrr": 0.09192844490958949
811
+ },
812
+ "t1_v3_strict_nocohort|L3|123": {
813
+ "hits_at_10": 0.06577415599534342,
814
+ "mrr": 0.028602334895921077,
815
+ "n_triples": 859,
816
+ "study_macro_mrr": 0.05314542438866536
817
+ },
818
+ "t1_v3_strict_nocohort|L3|2024": {
819
+ "hits_at_10": 0.09053916581892167,
820
+ "mrr": 0.040800938282133076,
821
+ "n_triples": 983,
822
+ "study_macro_mrr": 0.05903540522515854
823
+ },
824
+ "t1_v3_strict_nocohort|L3|42": {
825
+ "hits_at_10": 0.09312638580931264,
826
+ "mrr": 0.036624454483434155,
827
+ "n_triples": 902,
828
+ "study_macro_mrr": 0.04720222432536894
829
+ },
830
+ "t1_v3_strict_nocohort|L3|456": {
831
+ "hits_at_10": 0.0676500508646999,
832
+ "mrr": 0.028308663450936654,
833
+ "n_triples": 983,
834
+ "study_macro_mrr": 0.04310722484129911
835
+ },
836
+ "t1_v3_strict_nocohort|L3|789": {
837
+ "hits_at_10": 0.09327983951855567,
838
+ "mrr": 0.03440192417735385,
839
+ "n_triples": 997,
840
+ "study_macro_mrr": 0.06144170277256761
841
+ },
842
+ "t1_v3_strict_nocooc|DegreePrior|123": {
843
+ "hits_at_10": 0.06968641114982578,
844
+ "mrr": 0.03191386405220076,
845
+ "n_triples": 861,
846
+ "study_macro_mrr": 0.05415552025253488
847
+ },
848
+ "t1_v3_strict_nocooc|DegreePrior|2024": {
849
+ "hits_at_10": 0.10681586978636826,
850
+ "mrr": 0.04174909196998099,
851
+ "n_triples": 983,
852
+ "study_macro_mrr": 0.056678303492453175
853
+ },
854
+ "t1_v3_strict_nocooc|DegreePrior|42": {
855
+ "hits_at_10": 0.15077605321507762,
856
+ "mrr": 0.050147711858697194,
857
+ "n_triples": 902,
858
+ "study_macro_mrr": 0.048033467089436066
859
+ },
860
+ "t1_v3_strict_nocooc|DegreePrior|456": {
861
+ "hits_at_10": 0.08036622583926754,
862
+ "mrr": 0.03200997904148416,
863
+ "n_triples": 983,
864
+ "study_macro_mrr": 0.05036170821275602
865
+ },
866
+ "t1_v3_strict_nocooc|DegreePrior|789": {
867
+ "hits_at_10": 0.11384152457372117,
868
+ "mrr": 0.04037511745232587,
869
+ "n_triples": 997,
870
+ "study_macro_mrr": 0.06543262470098027
871
+ },
872
+ "t1_v3_strict_nocooc|L3|123": {
873
+ "hits_at_10": 0.06852497096399536,
874
+ "mrr": 0.02991131569491163,
875
+ "n_triples": 861,
876
+ "study_macro_mrr": 0.049986355894973945
877
+ },
878
+ "t1_v3_strict_nocooc|L3|2024": {
879
+ "hits_at_10": 0.0762970498474059,
880
+ "mrr": 0.03461926896734182,
881
+ "n_triples": 983,
882
+ "study_macro_mrr": 0.052452716918681794
883
+ },
884
+ "t1_v3_strict_nocooc|L3|42": {
885
+ "hits_at_10": 0.08869179600886919,
886
+ "mrr": 0.0378378530046203,
887
+ "n_triples": 902,
888
+ "study_macro_mrr": 0.04606024642646534
889
+ },
890
+ "t1_v3_strict_nocooc|L3|456": {
891
+ "hits_at_10": 0.0595116988809766,
892
+ "mrr": 0.02498725389170668,
893
+ "n_triples": 983,
894
+ "study_macro_mrr": 0.03616336073802668
895
+ },
896
+ "t1_v3_strict_nocooc|L3|789": {
897
+ "hits_at_10": 0.0757271815446339,
898
+ "mrr": 0.031842748681380435,
899
+ "n_triples": 997,
900
+ "study_macro_mrr": 0.056426509972204025
901
+ },
902
+ "t1_v3_strict_nooverlap|DegreePrior|123": {
903
+ "hits_at_10": 0.06968641114982578,
904
+ "mrr": 0.028519374640612924,
905
+ "n_triples": 861,
906
+ "study_macro_mrr": 0.05436461734537071
907
+ },
908
+ "t1_v3_strict_nooverlap|DegreePrior|2024": {
909
+ "hits_at_10": 0.09562563580874874,
910
+ "mrr": 0.038521429911455546,
911
+ "n_triples": 983,
912
+ "study_macro_mrr": 0.05479566694049099
913
+ },
914
+ "t1_v3_strict_nooverlap|DegreePrior|42": {
915
+ "hits_at_10": 0.14412416851441243,
916
+ "mrr": 0.04901032962165062,
917
+ "n_triples": 902,
918
+ "study_macro_mrr": 0.04676906908793903
919
+ },
920
+ "t1_v3_strict_nooverlap|DegreePrior|456": {
921
+ "hits_at_10": 0.08036622583926754,
922
+ "mrr": 0.029318920877760328,
923
+ "n_triples": 983,
924
+ "study_macro_mrr": 0.04409983445349515
925
+ },
926
+ "t1_v3_strict_nooverlap|DegreePrior|789": {
927
+ "hits_at_10": 0.09979939819458375,
928
+ "mrr": 0.03920748883537596,
929
+ "n_triples": 997,
930
+ "study_macro_mrr": 0.06356286136536173
931
+ },
932
+ "t1_v3_strict_nooverlap|L3|123": {
933
+ "hits_at_10": 0.06794425087108014,
934
+ "mrr": 0.028405806120803925,
935
+ "n_triples": 861,
936
+ "study_macro_mrr": 0.04826213383464062
937
+ },
938
+ "t1_v3_strict_nooverlap|L3|2024": {
939
+ "hits_at_10": 0.07222787385554426,
940
+ "mrr": 0.0329772561923268,
941
+ "n_triples": 983,
942
+ "study_macro_mrr": 0.04833364380768899
943
+ },
944
+ "t1_v3_strict_nooverlap|L3|42": {
945
+ "hits_at_10": 0.08702882483370289,
946
+ "mrr": 0.03704275516707987,
947
+ "n_triples": 902,
948
+ "study_macro_mrr": 0.04659646752596066
949
+ },
950
+ "t1_v3_strict_nooverlap|L3|456": {
951
+ "hits_at_10": 0.05747711088504578,
952
+ "mrr": 0.02354360022404875,
953
+ "n_triples": 983,
954
+ "study_macro_mrr": 0.03325418857442943
955
+ },
956
+ "t1_v3_strict_nooverlap|L3|789": {
957
+ "hits_at_10": 0.0712136409227683,
958
+ "mrr": 0.030832294015063762,
959
+ "n_triples": 997,
960
+ "study_macro_mrr": 0.05302642387423386
961
+ },
962
+ "t1_v3_temporal_dated|DegreePrior|123": {
963
+ "hits_at_10": 0.09060799621480956,
964
+ "mrr": 0.054127112430023085,
965
+ "n_triples": 4227,
966
+ "study_macro_mrr": 0.07779948985828349
967
+ },
968
+ "t1_v3_temporal_dated|DegreePrior|2024": {
969
+ "hits_at_10": 0.09060799621480956,
970
+ "mrr": 0.054127112430023085,
971
+ "n_triples": 4227,
972
+ "study_macro_mrr": 0.07779948985828349
973
+ },
974
+ "t1_v3_temporal_dated|DegreePrior|42": {
975
+ "hits_at_10": 0.09060799621480956,
976
+ "mrr": 0.054127112430023085,
977
+ "n_triples": 4227,
978
+ "study_macro_mrr": 0.07779948985828349
979
+ },
980
+ "t1_v3_temporal_dated|DegreePrior|456": {
981
+ "hits_at_10": 0.09060799621480956,
982
+ "mrr": 0.054127112430023085,
983
+ "n_triples": 4227,
984
+ "study_macro_mrr": 0.07779948985828349
985
+ },
986
+ "t1_v3_temporal_dated|DegreePrior|789": {
987
+ "hits_at_10": 0.09060799621480956,
988
+ "mrr": 0.054127112430023085,
989
+ "n_triples": 4227,
990
+ "study_macro_mrr": 0.07779948985828349
991
+ },
992
+ "t1_v3_temporal_dated|L3|123": {
993
+ "hits_at_10": 0.06292879110480246,
994
+ "mrr": 0.02854622689331771,
995
+ "n_triples": 4227,
996
+ "study_macro_mrr": 0.04459345946985761
997
+ },
998
+ "t1_v3_temporal_dated|L3|2024": {
999
+ "hits_at_10": 0.06292879110480246,
1000
+ "mrr": 0.02854622689331771,
1001
+ "n_triples": 4227,
1002
+ "study_macro_mrr": 0.04459345946985761
1003
+ },
1004
+ "t1_v3_temporal_dated|L3|42": {
1005
+ "hits_at_10": 0.06292879110480246,
1006
+ "mrr": 0.02854622689331771,
1007
+ "n_triples": 4227,
1008
+ "study_macro_mrr": 0.04459345946985761
1009
+ },
1010
+ "t1_v3_temporal_dated|L3|456": {
1011
+ "hits_at_10": 0.06292879110480246,
1012
+ "mrr": 0.02854622689331771,
1013
+ "n_triples": 4227,
1014
+ "study_macro_mrr": 0.04459345946985761
1015
+ },
1016
+ "t1_v3_temporal_dated|L3|789": {
1017
+ "hits_at_10": 0.06292879110480246,
1018
+ "mrr": 0.02854622689331771,
1019
+ "n_triples": 4227,
1020
+ "study_macro_mrr": 0.04459345946985761
1021
+ },
1022
+ "t1_v3_temporal_nocooc|DegreePrior|123": {
1023
+ "hits_at_10": 0.07901585048497753,
1024
+ "mrr": 0.04034251528715482,
1025
+ "n_triples": 4227,
1026
+ "study_macro_mrr": 0.05479639989025309
1027
+ },
1028
+ "t1_v3_temporal_nocooc|DegreePrior|2024": {
1029
+ "hits_at_10": 0.07901585048497753,
1030
+ "mrr": 0.04034251528715482,
1031
+ "n_triples": 4227,
1032
+ "study_macro_mrr": 0.05479639989025309
1033
+ },
1034
+ "t1_v3_temporal_nocooc|DegreePrior|42": {
1035
+ "hits_at_10": 0.07901585048497753,
1036
+ "mrr": 0.04034251528715482,
1037
+ "n_triples": 4227,
1038
+ "study_macro_mrr": 0.05479639989025309
1039
+ },
1040
+ "t1_v3_temporal_nocooc|DegreePrior|456": {
1041
+ "hits_at_10": 0.07901585048497753,
1042
+ "mrr": 0.04034251528715482,
1043
+ "n_triples": 4227,
1044
+ "study_macro_mrr": 0.05479639989025309
1045
+ },
1046
+ "t1_v3_temporal_nocooc|DegreePrior|789": {
1047
+ "hits_at_10": 0.07901585048497753,
1048
+ "mrr": 0.04034251528715482,
1049
+ "n_triples": 4227,
1050
+ "study_macro_mrr": 0.05479639989025309
1051
+ },
1052
+ "t1_v3_temporal_nocooc|L3|123": {
1053
+ "hits_at_10": 0.07085403359356518,
1054
+ "mrr": 0.032724225355203515,
1055
+ "n_triples": 4227,
1056
+ "study_macro_mrr": 0.0469706984144026
1057
+ },
1058
+ "t1_v3_temporal_nocooc|L3|2024": {
1059
+ "hits_at_10": 0.07085403359356518,
1060
+ "mrr": 0.032724225355203515,
1061
+ "n_triples": 4227,
1062
+ "study_macro_mrr": 0.0469706984144026
1063
+ },
1064
+ "t1_v3_temporal_nocooc|L3|42": {
1065
+ "hits_at_10": 0.07085403359356518,
1066
+ "mrr": 0.032724225355203515,
1067
+ "n_triples": 4227,
1068
+ "study_macro_mrr": 0.0469706984144026
1069
+ },
1070
+ "t1_v3_temporal_nocooc|L3|456": {
1071
+ "hits_at_10": 0.07085403359356518,
1072
+ "mrr": 0.032724225355203515,
1073
+ "n_triples": 4227,
1074
+ "study_macro_mrr": 0.0469706984144026
1075
+ },
1076
+ "t1_v3_temporal_nocooc|L3|789": {
1077
+ "hits_at_10": 0.07085403359356518,
1078
+ "mrr": 0.032724225355203515,
1079
+ "n_triples": 4227,
1080
+ "study_macro_mrr": 0.0469706984144026
1081
+ }
1082
+ }
bench_v3/tests/test_release.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Offline release tests: rebuild the degree prior and L3 on the released splits and compare MRR, Hits@10 and
2
+ study-macro MRR with the reference values of the paper's frozen evaluator (tests/reference_metrics.json).
3
+
4
+ By default every setting is checked on seed 42; set MKB_ALL_SEEDS=1 to check all five seeds.
5
+ Run from the release root: python -m pytest -q
6
+ """
7
+ from __future__ import annotations
8
+
9
+ import json
10
+ import os
11
+ from pathlib import Path
12
+
13
+ import numpy as np
14
+ import pytest
15
+
16
+ from microbekg_bench import Evaluator, filtered_rank, load
17
+ from microbekg_bench.baselines import L3, DegreePrior
18
+
19
+ PACKAGE_ROOT = Path(__file__).resolve().parents[1]
20
+ ROOT = Path(os.environ.get("MKB_DATA_ROOT", str(PACKAGE_ROOT)))
21
+ HAS_DATA = (ROOT / "benchmark/entities.tsv").is_file()
22
+ REF = json.loads((PACKAGE_ROOT / "tests" / "reference_metrics.json").read_text())
23
+ SEEDS = None if os.environ.get("MKB_ALL_SEEDS") else {42}
24
+ CASES = sorted(k for k in REF if SEEDS is None or int(k.split("|")[2]) in SEEDS)
25
+ SCORERS = {"DegreePrior": DegreePrior, "L3": L3}
26
+
27
+
28
+ def test_filtered_rank_ties_half_credit():
29
+ # target 0.5; one higher score, two ties, one known (filtered) higher score
30
+ assert filtered_rank([0.5, 0.9, 0.5, 0.5, 1.0], 0, [4]) == 1 + 1 + 0.5 * 2
31
+
32
+
33
+ @pytest.mark.skipif(not HAS_DATA, reason="Set MKB_DATA_ROOT to the extracted v3 data directory")
34
+ @pytest.mark.parametrize("key", CASES)
35
+ def test_reference_metrics(key):
36
+ setting, model, seed = key.split("|")
37
+ case = load(setting, int(seed), ROOT)
38
+ res = Evaluator(case).evaluate(SCORERS[model](case.train, case.n_entities))
39
+ m, ref = res["metrics"], REF[key]
40
+ assert m["n_ranks"] == 2 * ref["n_triples"]
41
+ assert m["mrr"] == pytest.approx(ref["mrr"], abs=1e-9)
42
+ assert m["hits_at_10"] == pytest.approx(ref["hits_at_10"], abs=1e-9)
43
+ assert m["macro_mrr"] == pytest.approx(ref["study_macro_mrr"], abs=1e-9)
44
+
45
+
46
+ @pytest.mark.skipif(not HAS_DATA, reason="Set MKB_DATA_ROOT to the extracted v3 data directory")
47
+ def test_variant_rows_match_parent():
48
+ """v3 training-graph variants keep the parent's test rows."""
49
+ for var, par in [("t1_v3_strict_nocooc", "t1_study_strict"), ("t1_v3_temporal_nocooc", "t1_temporal")]:
50
+ a, b = load(var, 42, ROOT), load(par, 42, ROOT)
51
+ assert np.array_equal(a.test, b.test)
52
+ assert len(a.train) <= len(b.train)