Datasets:
Formats:
parquet
Languages:
English
Size:
100K - 1M
Tags:
knowledge-graph
knowledge-updating
graph-analysis
factual-knowledge
question-answering
retrieval
License:
Improve connected graph usability documentation
Browse filesCo-authored-by: Cursor <cursoragent@cursor.com>
- README.md +426 -82
- SHA256SUMS +2 -2
- data/knowledge_edges.parquet +2 -2
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
pretty_name: FACTPROP — Factual
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
size_categories:
|
|
@@ -7,8 +7,11 @@ size_categories:
|
|
| 7 |
tags:
|
| 8 |
- knowledge-graph
|
| 9 |
- knowledge-updating
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
- factprop
|
| 11 |
-
- tabular
|
| 12 |
configs:
|
| 13 |
- config_name: knowledge_graph
|
| 14 |
default: true
|
|
@@ -25,112 +28,340 @@ configs:
|
|
| 25 |
|
| 26 |
**Popular Knowledge Propagates More Errors in LLM Knowledge Updating**
|
| 27 |
|
| 28 |
-
[Project page & demo](https://factprop.github.io/FACTPROP/) · [Research code](https://github.com/factprop/FACTPROP)
|
| 29 |
|
| 30 |
-
##
|
| 31 |
|
| 32 |
-
FACTPROP is a factual graph for studying how knowledge
|
| 33 |
|
| 34 |
-
The
|
| 35 |
|
| 36 |
-
|
|
|
|
| 37 |
|
| 38 |
-
|
| 39 |
-
| --- | --- |
|
| 40 |
-
| `factprop_graph_v1.pkl` | Original graph checkpoint (125,274,720 bytes), unchanged |
|
| 41 |
-
| `GRAPH.md` | Checkpoint structure and graph loading guide |
|
| 42 |
-
| `load_graph.py` | Download, verify, and load the graph |
|
| 43 |
-
| `data/knowledge_edges.parquet` | Derived table of all forward `subject → relation → object` knowledge connections |
|
| 44 |
-
| `data/entities_curated.parquet` | Viewer-ready entity summary: mapped, readable labels sorted by structural popularity |
|
| 45 |
-
| `data/entities_curated.jsonl` | Equivalent JSONL representation of the curated entity summary |
|
| 46 |
-
| `data/entities.jsonl` | One unchanged record per graph node, including numeric and unresolved labels |
|
| 47 |
-
| `browser-index.json` | Unchanged index used by the project website |
|
| 48 |
-
| `metadata/graph.json` | Graph counts, thresholds, export date, and source-graph checksum |
|
| 49 |
-
| `metadata/release.json` | Source version and mapping statistics |
|
| 50 |
-
| `SHA256SUMS` | File integrity checksums |
|
| 51 |
|
| 52 |
-
|
|
|
|
|
|
|
| 53 |
|
| 54 |
-
|
| 55 |
|
| 56 |
-
|
| 57 |
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
|
| 65 |
-
|
|
| 66 |
-
| `
|
| 67 |
-
| `
|
| 68 |
-
|
|
| 69 |
-
| `
|
| 70 |
-
| `
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
-
|
| 74 |
|
| 75 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
| Field | Type | Meaning |
|
| 78 |
| --- | --- | --- |
|
| 79 |
-
| `
|
| 80 |
-
| `
|
| 81 |
-
| `
|
| 82 |
-
| `
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
-
|
| 85 |
|
| 86 |
-
## Structural popularity
|
| 87 |
|
| 88 |
-
|
| 89 |
|
| 90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
-
|
| 93 |
|
| 94 |
-
##
|
| 95 |
|
| 96 |
-
|
| 97 |
|
| 98 |
```bash
|
| 99 |
-
python
|
| 100 |
```
|
| 101 |
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
## Load the index
|
| 105 |
|
| 106 |
```python
|
| 107 |
from datasets import load_dataset
|
| 108 |
|
| 109 |
-
edges = load_dataset(
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
```
|
| 114 |
|
| 115 |
-
|
| 116 |
|
| 117 |
```python
|
| 118 |
row = edges[0]
|
| 119 |
-
print(row["subject"]
|
|
|
|
|
|
|
| 120 |
print("Object connectivity:", row["object_forward_in_degree"])
|
| 121 |
```
|
| 122 |
|
| 123 |
-
|
| 124 |
|
| 125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
|
| 127 |
```bash
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
hf download factprop/FACTPROP \
|
| 129 |
--repo-type dataset \
|
| 130 |
--local-dir FACTPROP-data
|
| 131 |
```
|
| 132 |
|
| 133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
|
| 135 |
```python
|
| 136 |
from huggingface_hub import snapshot_download
|
|
@@ -142,39 +373,152 @@ snapshot_download(
|
|
| 142 |
)
|
| 143 |
```
|
| 144 |
|
| 145 |
-
|
| 146 |
|
| 147 |
-
|
|
|
|
|
|
|
|
|
|
| 148 |
|
| 149 |
-
```
|
| 150 |
-
|
| 151 |
-
from
|
| 152 |
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
index = json.load(stream)
|
| 156 |
```
|
| 157 |
|
| 158 |
-
|
| 159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
- 33,901 graph-node records have no QID mapping.
|
| 161 |
-
- 5,037 QIDs
|
| 162 |
-
-
|
| 163 |
-
-
|
| 164 |
-
-
|
| 165 |
-
-
|
| 166 |
-
-
|
| 167 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
|
| 169 |
-
|
| 170 |
|
| 171 |
-
|
| 172 |
|
| 173 |
-
|
| 174 |
|
| 175 |
## License
|
| 176 |
|
| 177 |
-
A dataset-specific license has not yet been specified by the authors. This
|
| 178 |
|
| 179 |
## Citation
|
| 180 |
|
|
|
|
| 1 |
---
|
| 2 |
+
pretty_name: FACTPROP — Connected Factual Knowledge Graph
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
size_categories:
|
|
|
|
| 7 |
tags:
|
| 8 |
- knowledge-graph
|
| 9 |
- knowledge-updating
|
| 10 |
+
- graph-analysis
|
| 11 |
+
- factual-knowledge
|
| 12 |
+
- question-answering
|
| 13 |
+
- retrieval
|
| 14 |
- factprop
|
|
|
|
| 15 |
configs:
|
| 16 |
- config_name: knowledge_graph
|
| 17 |
default: true
|
|
|
|
| 28 |
|
| 29 |
**Popular Knowledge Propagates More Errors in LLM Knowledge Updating**
|
| 30 |
|
| 31 |
+
[Project page & demo](https://factprop.github.io/FACTPROP/) · [Research code](https://github.com/factprop/FACTPROP) · [Graph schema](GRAPH.md)
|
| 32 |
|
| 33 |
+
## What is FACTPROP?
|
| 34 |
|
| 35 |
+
FACTPROP is a connected factual knowledge graph for studying how knowledge is structured and how factual updates propagate through large language models. It was constructed from Wikipedia-derived factual candidates with Wikidata validation.
|
| 36 |
|
| 37 |
+
The release provides two ways to use the same graph:
|
| 38 |
|
| 39 |
+
1. **`knowledge_edges` (recommended):** a safe, columnar Parquet view of every forward factual connection, loadable without Python pickle.
|
| 40 |
+
2. **`factprop_graph_v1.pkl` (canonical):** the unchanged NetworkX checkpoint containing the complete graph and construction metadata.
|
| 41 |
|
| 42 |
+
The default Dataset Viewer shows each knowledge connection as:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
+
```text
|
| 45 |
+
subject ── relation ──▶ object
|
| 46 |
+
```
|
| 47 |
|
| 48 |
+
For example, an edge can also carry a natural-language question, a surface statement, construction-time confidence, and connectivity statistics.
|
| 49 |
|
| 50 |
+
## At a glance
|
| 51 |
|
| 52 |
+
- **100,015 graph nodes**
|
| 53 |
+
- **357,205 forward factual edges**
|
| 54 |
+
- **75,357 auxiliary inverse traversal edges**
|
| 55 |
+
- **432,562 stored directed edges in the canonical checkpoint**
|
| 56 |
+
- **31 forward relation identifiers** in `knowledge_edges`, plus **8 inverse-only identifiers** in the checkpoint (**39 stored relation types total**)
|
| 57 |
+
- Natural-language `question` and `surface` fields on graph edges where available
|
| 58 |
+
- Wikidata QIDs where mappings are available
|
| 59 |
+
- Forward-edge in-degree and out-degree for connectivity analysis
|
| 60 |
|
| 61 |
+
The default Parquet split contains all 357,205 forward edges. It is not a sample and is not a predefined train/test split.
|
| 62 |
+
|
| 63 |
+
## Which artifact should I use?
|
| 64 |
+
|
| 65 |
+
| Goal | Recommended artifact | What it contains |
|
| 66 |
+
| --- | --- | --- |
|
| 67 |
+
| Browse or analyze factual connections | `knowledge_graph/knowledge_edges` | All forward `subject → relation → object` edges and selected metadata |
|
| 68 |
+
| Use a DataFrame, Arrow, DuckDB, or Hugging Face Datasets | `data/knowledge_edges.parquet` | Compact tabular representation of forward graph topology |
|
| 69 |
+
| Inspect mapped, readable entities by popularity | `entity_index/curated` | Entity labels, QIDs, and forward object in-degree |
|
| 70 |
+
| Reproduce exact graph traversal or inspect evidence | `factprop_graph_v1.pkl` | Canonical NetworkX graph, inverse edges, evidence, and construction state |
|
| 71 |
+
| Verify files or pin a release | `SHA256SUMS` and a Hub revision | Published checksums and immutable commit history |
|
| 72 |
+
|
| 73 |
+
### What does “download the dataset” mean?
|
| 74 |
+
|
| 75 |
+
- `load_dataset(..., split="knowledge_edges")` downloads the complete **forward connection table**.
|
| 76 |
+
- `hf download factprop/FACTPROP --repo-type dataset` downloads the **entire release**, including the canonical graph checkpoint.
|
| 77 |
+
- `load_dataset(..., split="curated")` downloads only the curated entity summary; it is not the complete graph.
|
| 78 |
+
|
| 79 |
+
If your goal is to obtain all knowledge connections in an easy-to-use format, use `knowledge_edges`. If you also need inverse traversal edges, raw BCE labels, stored evidence, or construction metadata, download `factprop_graph_v1.pkl`.
|
| 80 |
|
| 81 |
+
## Data model
|
| 82 |
|
| 83 |
+
### Nodes
|
| 84 |
+
|
| 85 |
+
Node identifiers are graph-label strings. A node can represent:
|
| 86 |
+
|
| 87 |
+
- A mapped entity with a Wikidata QID.
|
| 88 |
+
- An unmapped entity label.
|
| 89 |
+
- A literal value such as a date.
|
| 90 |
+
|
| 91 |
+
The canonical checkpoint stores `qid` and `qid_status` as node attributes.
|
| 92 |
+
|
| 93 |
+
### Forward knowledge edges
|
| 94 |
+
|
| 95 |
+
Each forward edge represents one stored factual connection:
|
| 96 |
+
|
| 97 |
+
```text
|
| 98 |
+
(subject, relation, object)
|
| 99 |
+
```
|
| 100 |
+
|
| 101 |
+
The Parquet representation includes:
|
| 102 |
|
| 103 |
| Field | Type | Meaning |
|
| 104 |
| --- | --- | --- |
|
| 105 |
+
| `edge_id` | integer | Sequential table row ID starting at zero; not a graph-node ID |
|
| 106 |
+
| `subject` | string | Source node label |
|
| 107 |
+
| `subject_qid` | string or null | Subject Wikidata QID where available |
|
| 108 |
+
| `relation` | string | FACTPROP relation identifier |
|
| 109 |
+
| `object` | string | Target node label or readable literal |
|
| 110 |
+
| `object_node_label` | string | Canonical checkpoint node label; use this field to reconstruct exact topology |
|
| 111 |
+
| `object_qid` | string or null | Object Wikidata QID where available |
|
| 112 |
+
| `object_type` | string | `entity`, `literal`, or `date_literal` |
|
| 113 |
+
| `question` | string or null | Natural-language question associated with the fact |
|
| 114 |
+
| `surface` | string or null | Natural-language statement expressing the fact |
|
| 115 |
+
| `group` | string or null | Construction category such as Person, Work, or Event |
|
| 116 |
+
| `confidence` | float or null | Construction-time confidence; not a calibrated probability |
|
| 117 |
+
| `subject_forward_out_degree` | integer | Number of forward facts originating from the subject |
|
| 118 |
+
| `object_forward_in_degree` | integer | Number of forward facts pointing to the object |
|
| 119 |
+
|
| 120 |
+
The table is sorted by descending `object_forward_in_degree`, making highly connected objects easy to inspect. For ordinary entities, `object` and `object_node_label` are identical. BCE literals use a readable `object` value while preserving the original negative checkpoint label in `object_node_label`.
|
| 121 |
+
|
| 122 |
+
### Auxiliary inverse edges
|
| 123 |
|
| 124 |
+
The checkpoint also contains 75,357 edges whose `is_inverse` attribute is `true`. These support reverse traversal but must not be counted as additional original facts. They are excluded from `knowledge_edges`.
|
| 125 |
|
| 126 |
+
### Structural popularity
|
| 127 |
|
| 128 |
+
FACTPROP defines structural popularity for an object node `o` as:
|
| 129 |
|
| 130 |
+
```text
|
| 131 |
+
number of incoming edges to o where is_inverse is not true
|
| 132 |
+
```
|
| 133 |
+
|
| 134 |
+
This is the `object_forward_in_degree` field in the edge table and `forward_object_in_degree` in the entity index.
|
| 135 |
+
|
| 136 |
+
It measures connectivity inside this graph version. It does **not** measure web traffic, public familiarity, cultural importance, or the error probability of a particular model.
|
| 137 |
+
|
| 138 |
+
For example:
|
| 139 |
+
|
| 140 |
+
- `Apple Inc.` / `Q312`: forward object in-degree **467**
|
| 141 |
+
- `Apple` / `Q89`: forward object in-degree **4**
|
| 142 |
|
| 143 |
+
These are separate graph nodes.
|
| 144 |
|
| 145 |
+
## Quick start: load every forward knowledge connection
|
| 146 |
|
| 147 |
+
Install the tabular dependencies:
|
| 148 |
|
| 149 |
```bash
|
| 150 |
+
python -m pip install datasets pyarrow
|
| 151 |
```
|
| 152 |
|
| 153 |
+
Load the complete forward graph table:
|
|
|
|
|
|
|
| 154 |
|
| 155 |
```python
|
| 156 |
from datasets import load_dataset
|
| 157 |
|
| 158 |
+
edges = load_dataset(
|
| 159 |
+
"factprop/FACTPROP",
|
| 160 |
+
"knowledge_graph",
|
| 161 |
+
split="knowledge_edges",
|
| 162 |
+
)
|
| 163 |
+
|
| 164 |
+
print(edges.num_rows) # 357205
|
| 165 |
+
print(edges.column_names)
|
| 166 |
```
|
| 167 |
|
| 168 |
+
Inspect one connection:
|
| 169 |
|
| 170 |
```python
|
| 171 |
row = edges[0]
|
| 172 |
+
print(f'{row["subject"]} --{row["relation"]}--> {row["object"]}')
|
| 173 |
+
print("Question:", row["question"])
|
| 174 |
+
print("Statement:", row["surface"])
|
| 175 |
print("Object connectivity:", row["object_forward_in_degree"])
|
| 176 |
```
|
| 177 |
|
| 178 |
+
Pin the data revision for a reproducible experiment:
|
| 179 |
|
| 180 |
+
```python
|
| 181 |
+
edges = load_dataset(
|
| 182 |
+
"factprop/FACTPROP",
|
| 183 |
+
"knowledge_graph",
|
| 184 |
+
split="knowledge_edges",
|
| 185 |
+
revision="<commit-id>",
|
| 186 |
+
)
|
| 187 |
+
```
|
| 188 |
+
|
| 189 |
+
## Common recipes
|
| 190 |
+
|
| 191 |
+
### Find all displayed facts involving an entity
|
| 192 |
+
|
| 193 |
+
```python
|
| 194 |
+
entity = "Apple Inc."
|
| 195 |
+
|
| 196 |
+
connected = edges.filter(
|
| 197 |
+
lambda row: row["subject"] == entity or row["object"] == entity
|
| 198 |
+
)
|
| 199 |
+
|
| 200 |
+
print(connected.select_columns(["subject", "relation", "object"])[:20])
|
| 201 |
+
```
|
| 202 |
+
|
| 203 |
+
For incoming facts only:
|
| 204 |
+
|
| 205 |
+
```python
|
| 206 |
+
incoming = edges.filter(lambda row: row["object"] == entity)
|
| 207 |
+
print("Incoming forward facts:", incoming.num_rows)
|
| 208 |
+
```
|
| 209 |
+
|
| 210 |
+
### Filter by relation or knowledge category
|
| 211 |
+
|
| 212 |
+
```python
|
| 213 |
+
birth_facts = edges.filter(lambda row: row["relation"] == "BirthDate")
|
| 214 |
+
work_facts = edges.filter(lambda row: row["group"] == "Work")
|
| 215 |
+
```
|
| 216 |
+
|
| 217 |
+
### Use questions and statements for retrieval or QA research
|
| 218 |
+
|
| 219 |
+
```python
|
| 220 |
+
qa_edges = edges.filter(
|
| 221 |
+
lambda row: row["question"] is not None and row["surface"] is not None
|
| 222 |
+
)
|
| 223 |
+
|
| 224 |
+
qa_view = qa_edges.select_columns(
|
| 225 |
+
["subject", "relation", "object", "question", "surface"]
|
| 226 |
+
)
|
| 227 |
+
```
|
| 228 |
+
|
| 229 |
+
Do not assume these rows are independent examples. Split by connected entities or graph components when entity leakage would invalidate an evaluation.
|
| 230 |
+
|
| 231 |
+
### Reconstruct the forward graph with NetworkX
|
| 232 |
|
| 233 |
```bash
|
| 234 |
+
python -m pip install datasets networkx
|
| 235 |
+
```
|
| 236 |
+
|
| 237 |
+
```python
|
| 238 |
+
import networkx as nx
|
| 239 |
+
from datasets import load_dataset
|
| 240 |
+
|
| 241 |
+
edges = load_dataset(
|
| 242 |
+
"factprop/FACTPROP",
|
| 243 |
+
"knowledge_graph",
|
| 244 |
+
split="knowledge_edges",
|
| 245 |
+
)
|
| 246 |
+
|
| 247 |
+
graph = nx.DiGraph()
|
| 248 |
+
for row in edges:
|
| 249 |
+
graph.add_edge(
|
| 250 |
+
row["subject"],
|
| 251 |
+
row["object_node_label"],
|
| 252 |
+
relation=row["relation"],
|
| 253 |
+
question=row["question"],
|
| 254 |
+
surface=row["surface"],
|
| 255 |
+
confidence=row["confidence"],
|
| 256 |
+
group=row["group"],
|
| 257 |
+
)
|
| 258 |
+
|
| 259 |
+
print(graph.number_of_nodes()) # 100015
|
| 260 |
+
print(graph.number_of_edges()) # 357205
|
| 261 |
+
print(graph.in_degree("Apple Inc.")) # 467
|
| 262 |
+
```
|
| 263 |
+
|
| 264 |
+
Using `object_node_label` reconstructs all 100,015 nodes and all 357,205 canonical forward edges. It does not restore the excluded inverse traversal edges, stored evidence, or checkpoint construction state. Use `factprop_graph_v1.pkl` when those are required.
|
| 265 |
+
|
| 266 |
+
### Explore a local multi-hop neighborhood
|
| 267 |
+
|
| 268 |
+
```python
|
| 269 |
+
entity = "Apple Inc."
|
| 270 |
+
undirected_view = graph.to_undirected(as_view=True)
|
| 271 |
+
|
| 272 |
+
distance = nx.single_source_shortest_path_length(
|
| 273 |
+
undirected_view,
|
| 274 |
+
entity,
|
| 275 |
+
cutoff=2,
|
| 276 |
+
)
|
| 277 |
+
|
| 278 |
+
one_hop = [node for node, hops in distance.items() if hops == 1]
|
| 279 |
+
two_hop = [node for node, hops in distance.items() if hops == 2]
|
| 280 |
+
```
|
| 281 |
+
|
| 282 |
+
Directed and undirected distances answer different research questions. Record the chosen convention; do not assume this generic example reproduces a specific FACTPROP paper protocol.
|
| 283 |
+
|
| 284 |
+
### Analyze relation and connectivity distributions
|
| 285 |
+
|
| 286 |
+
```python
|
| 287 |
+
from collections import Counter
|
| 288 |
+
|
| 289 |
+
relation_counts = Counter(edges["relation"])
|
| 290 |
+
group_counts = Counter(value for value in edges["group"] if value is not None)
|
| 291 |
+
```
|
| 292 |
+
|
| 293 |
+
For the complete node-level degree distribution, load the unchanged entity index directly:
|
| 294 |
+
|
| 295 |
+
```python
|
| 296 |
+
from datasets import load_dataset
|
| 297 |
+
from huggingface_hub import hf_hub_download
|
| 298 |
+
|
| 299 |
+
path = hf_hub_download(
|
| 300 |
+
"factprop/FACTPROP",
|
| 301 |
+
"data/entities.jsonl",
|
| 302 |
+
repo_type="dataset",
|
| 303 |
+
)
|
| 304 |
+
|
| 305 |
+
all_nodes = load_dataset("json", data_files=path, split="train")
|
| 306 |
+
```
|
| 307 |
+
|
| 308 |
+
## Curated entity index
|
| 309 |
+
|
| 310 |
+
The optional `curated` split is intended for readable entity-level browsing:
|
| 311 |
+
|
| 312 |
+
```python
|
| 313 |
+
from datasets import load_dataset
|
| 314 |
+
|
| 315 |
+
entities = load_dataset(
|
| 316 |
+
"factprop/FACTPROP",
|
| 317 |
+
"entity_index",
|
| 318 |
+
split="curated",
|
| 319 |
+
)
|
| 320 |
+
|
| 321 |
+
matches = entities.filter(lambda row: row["qid"] == "Q312")
|
| 322 |
+
print(matches[:])
|
| 323 |
+
```
|
| 324 |
+
|
| 325 |
+
Its fields are:
|
| 326 |
+
|
| 327 |
+
| Field | Meaning |
|
| 328 |
+
| --- | --- |
|
| 329 |
+
| `label` | Original graph-node label |
|
| 330 |
+
| `qid` | Wikidata QID |
|
| 331 |
+
| `forward_object_in_degree` | Forward facts pointing to this node |
|
| 332 |
+
| `qid_node_count` | Number of graph-node records sharing this QID |
|
| 333 |
+
|
| 334 |
+
The curated view requires a standard QID and a readable label. It excludes unresolved and numeric-only labels. It is therefore useful for browsing but must not be treated as the complete node set or as a quality-certified subset.
|
| 335 |
+
|
| 336 |
+
## Download the canonical connected graph
|
| 337 |
+
|
| 338 |
+
### Download everything with the Hugging Face CLI
|
| 339 |
+
|
| 340 |
+
```bash
|
| 341 |
+
python -m pip install huggingface_hub
|
| 342 |
+
|
| 343 |
hf download factprop/FACTPROP \
|
| 344 |
--repo-type dataset \
|
| 345 |
--local-dir FACTPROP-data
|
| 346 |
```
|
| 347 |
|
| 348 |
+
This downloads the complete release, including:
|
| 349 |
+
|
| 350 |
+
```text
|
| 351 |
+
FACTPROP-data/
|
| 352 |
+
├── factprop_graph_v1.pkl
|
| 353 |
+
├── data/
|
| 354 |
+
│ ├── knowledge_edges.parquet
|
| 355 |
+
│ ├── entities_curated.parquet
|
| 356 |
+
│ ├── entities_curated.jsonl
|
| 357 |
+
│ └── entities.jsonl
|
| 358 |
+
├── metadata/
|
| 359 |
+
├── GRAPH.md
|
| 360 |
+
├── load_graph.py
|
| 361 |
+
└── SHA256SUMS
|
| 362 |
+
```
|
| 363 |
+
|
| 364 |
+
### Download everything with Python
|
| 365 |
|
| 366 |
```python
|
| 367 |
from huggingface_hub import snapshot_download
|
|
|
|
| 373 |
)
|
| 374 |
```
|
| 375 |
|
| 376 |
+
### Download and verify only the graph checkpoint
|
| 377 |
|
| 378 |
+
```bash
|
| 379 |
+
python -m pip install networkx huggingface_hub
|
| 380 |
+
python load_graph.py
|
| 381 |
+
```
|
| 382 |
|
| 383 |
+
The included loader downloads `factprop_graph_v1.pkl`, verifies SHA-256, and returns `payload["graph"]`.
|
| 384 |
+
|
| 385 |
+
Python pickle loading can execute code. Load only the checkpoint from this trusted repository and verify:
|
| 386 |
|
| 387 |
+
```text
|
| 388 |
+
437a434260edbb019c85575d65b4775cb2461f145e17966ee3acc8e4625ce7c8
|
|
|
|
| 389 |
```
|
| 390 |
|
| 391 |
+
See [GRAPH.md](GRAPH.md) for the complete checkpoint schema.
|
| 392 |
|
| 393 |
+
## Canonical checkpoint contents
|
| 394 |
+
|
| 395 |
+
`factprop_graph_v1.pkl` contains a dictionary:
|
| 396 |
+
|
| 397 |
+
```text
|
| 398 |
+
payload
|
| 399 |
+
├── graph # NetworkX DiGraph
|
| 400 |
+
├── state
|
| 401 |
+
├── seed_entities
|
| 402 |
+
├── validator_state
|
| 403 |
+
└── scheduler_stats
|
| 404 |
+
```
|
| 405 |
+
|
| 406 |
+
The graph has 100,015 nodes and 432,562 stored directed edges. Edge attributes include:
|
| 407 |
+
|
| 408 |
+
```text
|
| 409 |
+
relation, question, surface, evidence, confidence, group, is_inverse
|
| 410 |
+
```
|
| 411 |
+
|
| 412 |
+
Use `is_inverse is not True` when selecting original forward facts or reproducing FACTPROP popularity. Counting total NetworkX in-degree without this filter mixes forward facts with auxiliary traversal edges.
|
| 413 |
+
|
| 414 |
+
## BCE dates and numeric labels
|
| 415 |
+
|
| 416 |
+
The canonical graph stores BCE year literals as negative internal labels:
|
| 417 |
+
|
| 418 |
+
```text
|
| 419 |
+
Ancient Egypt --FoundingDate--> -3100
|
| 420 |
+
```
|
| 421 |
+
|
| 422 |
+
The edge surface expresses the readable meaning: approximately 3100 BCE. These values are date literals, not negative row IDs, negative connectivity, or corrupted entity indices.
|
| 423 |
+
|
| 424 |
+
For usability, `knowledge_edges` renders such objects as `3100 BCE` and marks them as `object_type="date_literal"`. The same row preserves `-3100` in `object_node_label`, allowing exact topology reconstruction. The canonical checkpoint and complete raw entity index also retain the original labels.
|
| 425 |
+
|
| 426 |
+
## Recommended uses
|
| 427 |
+
|
| 428 |
+
FACTPROP is suitable for:
|
| 429 |
+
|
| 430 |
+
- Knowledge updating and collateral-error propagation studies.
|
| 431 |
+
- Knowledge-graph topology and degree-distribution analysis.
|
| 432 |
+
- Entity connectivity and structural popularity research.
|
| 433 |
+
- Graph-aware retrieval and RAG experiments.
|
| 434 |
+
- Relation-conditioned factual QA dataset construction.
|
| 435 |
+
- Knowledge-editing neighborhood and multi-hop evaluation design.
|
| 436 |
+
- Robustness, forgetting, and rehearsal-strategy research.
|
| 437 |
+
|
| 438 |
+
The graph can serve as an empirical, real-world-derived factual network. It should not be described as a complete or statistically unbiased distribution of world knowledge.
|
| 439 |
+
|
| 440 |
+
## Evaluation and split guidance
|
| 441 |
+
|
| 442 |
+
This release intentionally does not impose train, validation, or test splits. Appropriate splitting depends on the task.
|
| 443 |
+
|
| 444 |
+
For predictive experiments:
|
| 445 |
+
|
| 446 |
+
- Avoid random edge splits when the same entities on both sides would create leakage.
|
| 447 |
+
- Consider entity-disjoint, relation-aware, temporal, or connected-component splits.
|
| 448 |
+
- Keep knowledge-update targets separate from ripple evaluation facts.
|
| 449 |
+
- Record whether auxiliary inverse edges are included.
|
| 450 |
+
- Record how literals, missing QIDs, and duplicate QIDs are handled.
|
| 451 |
+
- Pin the dataset revision and publish generated split IDs.
|
| 452 |
+
|
| 453 |
+
## Coverage, quality, and limitations
|
| 454 |
+
|
| 455 |
+
- The graph is derived from Wikipedia-oriented factual candidates and Wikidata validation; it is not an exhaustive model of world knowledge.
|
| 456 |
+
- Construction choices—including seed entities, relation inventory, expansion policy, and validation coverage—shape the observed distribution.
|
| 457 |
+
- A stored edge should not be treated as permanently or universally correct. Facts can be time-sensitive, approximate, disputed, or affected by source limitations.
|
| 458 |
+
- `confidence` is a construction-time field, not a calibrated probability or human annotation score.
|
| 459 |
- 33,901 graph-node records have no QID mapping.
|
| 460 |
+
- 5,037 QIDs occur in more than one graph-node record.
|
| 461 |
+
- Missing QIDs do not imply missing nodes, low connectivity, or degree zero.
|
| 462 |
+
- Duplicate-QID nodes must be reviewed separately. Do not automatically sum their degrees or choose the maximum.
|
| 463 |
+
- Some expected mappings, including the Java and Python programming languages, are absent from the current mapping.
|
| 464 |
+
- The curated entity split is a display filter, not a gold quality label.
|
| 465 |
+
- Experiment inputs, model checkpoints, and complete paper outputs are not included.
|
| 466 |
+
|
| 467 |
+
These limitations are part of the released graph version. Mapping corrections should be maintained as separately reviewed records rather than silently replacing original nodes.
|
| 468 |
+
|
| 469 |
+
## Reproducibility checklist
|
| 470 |
+
|
| 471 |
+
For a reproducible use of FACTPROP, record:
|
| 472 |
+
|
| 473 |
+
- Hub revision or commit ID.
|
| 474 |
+
- Checksum of each downloaded artifact.
|
| 475 |
+
- Whether `knowledge_edges` or the canonical checkpoint was used.
|
| 476 |
+
- Whether inverse edges were included.
|
| 477 |
+
- Directed or undirected traversal convention.
|
| 478 |
+
- QID deduplication policy.
|
| 479 |
+
- Literal/date normalization policy.
|
| 480 |
+
- Entity, relation, and graph-component split policy.
|
| 481 |
+
- Any filtering or mapping corrections.
|
| 482 |
+
|
| 483 |
+
Run checksum verification from the downloaded repository:
|
| 484 |
+
|
| 485 |
+
```bash
|
| 486 |
+
shasum -a 256 -c SHA256SUMS
|
| 487 |
+
```
|
| 488 |
+
|
| 489 |
+
On Linux, use:
|
| 490 |
+
|
| 491 |
+
```bash
|
| 492 |
+
sha256sum -c SHA256SUMS
|
| 493 |
+
```
|
| 494 |
+
|
| 495 |
+
## File inventory
|
| 496 |
+
|
| 497 |
+
| File | Purpose |
|
| 498 |
+
| --- | --- |
|
| 499 |
+
| `factprop_graph_v1.pkl` | Canonical connected NetworkX graph |
|
| 500 |
+
| `data/knowledge_edges.parquet` | All forward knowledge connections for safe, efficient analysis |
|
| 501 |
+
| `data/entities_curated.parquet` | Viewer-ready mapped entity summary |
|
| 502 |
+
| `data/entities_curated.jsonl` | Equivalent JSONL curated summary |
|
| 503 |
+
| `data/entities.jsonl` | Complete original-order entity index |
|
| 504 |
+
| `browser-index.json` | Index used by the FACTPROP website |
|
| 505 |
+
| `GRAPH.md` | Canonical checkpoint schema |
|
| 506 |
+
| `load_graph.py` | Checksum-verifying checkpoint loader |
|
| 507 |
+
| `metadata/graph.json` | Graph counts, thresholds, export date, and source checksum |
|
| 508 |
+
| `metadata/release.json` | Release and mapping statistics |
|
| 509 |
+
| `SHA256SUMS` | Artifact integrity checksums |
|
| 510 |
+
|
| 511 |
+
## Provenance and versioning
|
| 512 |
|
| 513 |
+
The graph was constructed from Wikipedia-derived factual candidates with Wikidata validation, as described by the FACTPROP project. The entity popularity index was exported from the unchanged paper graph. The source graph checksum is retained in `metadata/graph.json`.
|
| 514 |
|
| 515 |
+
`knowledge_edges` contains every forward edge from the checkpoint. It changes only the user-facing display of negative BCE literals and preserves each canonical object label separately. Topology and connectivity metrics are derived directly from the canonical graph. No graph nodes, mappings, edge topology, or checkpoint metadata were changed for this release.
|
| 516 |
|
| 517 |
+
Use a Hub revision to freeze data. Proposed mapping corrections or enhanced versions should use a new versioned artifact rather than overwrite `factprop_graph_v1.pkl`.
|
| 518 |
|
| 519 |
## License
|
| 520 |
|
| 521 |
+
A dataset-specific license has not yet been specified by the authors. This release does not assign a new license to its upstream sources. Review upstream source terms and obtain appropriate permission before redistribution or commercial use.
|
| 522 |
|
| 523 |
## Citation
|
| 524 |
|
SHA256SUMS
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
8eebe4a8b875d1061c7b55947883b455fa1565fb6a6e39b8056c7160381d7cfc GRAPH.md
|
| 2 |
-
|
| 3 |
fa7d9aec01b9c98c09cebc941265e4351693b362ffb3048d2c86585e84d7800d browser-index.json
|
| 4 |
3a9211368ac52af6cd0647cb026c05cb62743804011b68624682e11df964c038 data/entities_curated.parquet
|
| 5 |
010beb905ef89b491159a8d8b2b013ea55219d26c8545bed07f64010bfa9ffce data/entities_curated.jsonl
|
| 6 |
2c21f2aefb9cbcc749cd813412dd90fea440050eeb8efb3356de786ebeb501e6 data/entities.jsonl
|
| 7 |
-
|
| 8 |
437a434260edbb019c85575d65b4775cb2461f145e17966ee3acc8e4625ce7c8 factprop_graph_v1.pkl
|
| 9 |
c73d0a4b3f6df2166ba960a64cd5d3522728f46c2597f4f6604cc65533b46888 load_graph.py
|
| 10 |
29e825c9838eb795a18672eb6a569cc2b666cf6971b5bd911655113a138e94ad metadata/graph.json
|
|
|
|
| 1 |
8eebe4a8b875d1061c7b55947883b455fa1565fb6a6e39b8056c7160381d7cfc GRAPH.md
|
| 2 |
+
7b6739bdf987b260ee4355bd74c216d6c94d510fdd462a54a6735c8f7b9c96f0 README.md
|
| 3 |
fa7d9aec01b9c98c09cebc941265e4351693b362ffb3048d2c86585e84d7800d browser-index.json
|
| 4 |
3a9211368ac52af6cd0647cb026c05cb62743804011b68624682e11df964c038 data/entities_curated.parquet
|
| 5 |
010beb905ef89b491159a8d8b2b013ea55219d26c8545bed07f64010bfa9ffce data/entities_curated.jsonl
|
| 6 |
2c21f2aefb9cbcc749cd813412dd90fea440050eeb8efb3356de786ebeb501e6 data/entities.jsonl
|
| 7 |
+
58c0aadc93626731bac8ee26002e7b82fbc4919f0dc9ea6bf2b2c0b112c8d0a4 data/knowledge_edges.parquet
|
| 8 |
437a434260edbb019c85575d65b4775cb2461f145e17966ee3acc8e4625ce7c8 factprop_graph_v1.pkl
|
| 9 |
c73d0a4b3f6df2166ba960a64cd5d3522728f46c2597f4f6604cc65533b46888 load_graph.py
|
| 10 |
29e825c9838eb795a18672eb6a569cc2b666cf6971b5bd911655113a138e94ad metadata/graph.json
|
data/knowledge_edges.parquet
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:58c0aadc93626731bac8ee26002e7b82fbc4919f0dc9ea6bf2b2c0b112c8d0a4
|
| 3 |
+
size 18599971
|