Replace project README with dedicated dataset card
Browse files
README.md
CHANGED
|
@@ -27,140 +27,72 @@ configs:
|
|
| 27 |
|
| 28 |
# BNE Linked Data
|
| 29 |
|
| 30 |
-
|
| 31 |
|
| 32 |
-
|
| 33 |
|
| 34 |
-
The
|
| 35 |
|
| 36 |
## Source and licence
|
| 37 |
|
| 38 |
-
-
|
| 39 |
-
-
|
| 40 |
-
-
|
| 41 |
-
-
|
| 42 |
-
- Released source snapshot: 6 September 2023, preserved by Internet Archive on 20 September 2023
|
| 43 |
|
| 44 |
-
The BNE
|
| 45 |
|
| 46 |
-
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
The release is designed around three Hugging Face configurations:
|
| 51 |
-
|
| 52 |
-
| Configuration | Source content | Compressed source | RDF triples | Parquet |
|
| 53 |
|---|---|---:|---:|---:|
|
| 54 |
-
| `bibliographic` | Bibliographic resources
|
| 55 |
-
| `authorities` | People, organisations, conferences, works, expressions,
|
| 56 |
-
| `subjects` | Subject headings
|
|
|
|
|
|
|
| 57 |
|
| 58 |
-
|
| 59 |
|
| 60 |
-
|
|
| 61 |
|---|---|
|
| 62 |
-
| `record_id` | Stable identifier formed from collection and
|
| 63 |
| `subject` | Subject IRI or blank-node identifier |
|
| 64 |
| `predicate` | Predicate IRI |
|
| 65 |
| `object` | Object IRI, blank-node identifier, or decoded literal value |
|
| 66 |
| `object_kind` | `iri`, `literal`, or `blank_node` |
|
| 67 |
| `language` | Language tag attached to a literal, when present |
|
| 68 |
| `datatype` | Datatype IRI attached to a literal, when present |
|
| 69 |
-
| `collection` | Source collection
|
| 70 |
-
| `source_line` | One-based line number in the decompressed
|
| 71 |
-
| `snapshot_date` |
|
| 72 |
-
|
| 73 |
-
The statement representation preserves the complete graph while remaining easy to query with DuckDB, Polars, Spark, or Hugging Face Datasets. Subjects and objects can be joined directly to reconstruct authorship, subject, work, expression, manifestation, and external authority relationships.
|
| 74 |
-
|
| 75 |
-
## Capacity and duration
|
| 76 |
-
|
| 77 |
-
The verified download is 1,606,131,429 bytes (1.50 GiB) and took 10 minutes 46 seconds on the measured connection. Normalization took 1 hour 39 minutes, the full DuckDB profile took 49 seconds, and the resulting 1,043 Parquet shards occupy 2,318,257,981 bytes (2.16 GiB). Allow at least 10 GiB free when both processed data and a staging copy are retained. The pipeline streams BZip2 input and does not create a decompressed N-Triples copy.
|
| 78 |
|
| 79 |
## Exploratory profile
|
| 80 |
|
| 81 |
-
The
|
| 82 |
-
|
| 83 |
-
Subject labels contain 1,604,451 language-tagged literals: 1,527,636 Spanish, 32,508 English, 20,530 French, 15,982 Catalan, 5,186 Basque, and 2,609 Galician. Frequent relations include `rdf:type`, BNE identifiers and labels, bibliographic manifestation/work links, SKOS semantic relations, and 1,353,732 `owl:sameAs` authority links. Complete counts and the thirty most frequent predicates per collection are in `artifacts/profile.json`.
|
| 84 |
-
|
| 85 |
-
Run the estimate before every download:
|
| 86 |
-
|
| 87 |
-
```powershell
|
| 88 |
-
bne-pipeline estimate --config configs/default.json
|
| 89 |
-
```
|
| 90 |
-
|
| 91 |
-
## Installation
|
| 92 |
-
|
| 93 |
-
Python 3.11 or newer is recommended.
|
| 94 |
-
|
| 95 |
-
```powershell
|
| 96 |
-
python -m venv .venv
|
| 97 |
-
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"
|
| 98 |
-
```
|
| 99 |
-
|
| 100 |
-
## Pipeline
|
| 101 |
-
|
| 102 |
-
Run each stage independently:
|
| 103 |
-
|
| 104 |
-
```powershell
|
| 105 |
-
bne-pipeline download --config configs/default.json
|
| 106 |
-
bne-pipeline normalize --config configs/default.json
|
| 107 |
-
bne-pipeline analyze --config configs/default.json
|
| 108 |
-
bne-pipeline stage --config configs/default.json
|
| 109 |
-
```
|
| 110 |
-
|
| 111 |
-
Or execute the complete workflow:
|
| 112 |
-
|
| 113 |
-
```powershell
|
| 114 |
-
bne-pipeline run --config configs/default.json
|
| 115 |
-
```
|
| 116 |
-
|
| 117 |
-
Interrupted downloads are retained as `.part` files and resumed with an HTTP range request when the server supports it. A file is promoted to the raw source path only after its byte size matches the length announced by the server. The sizes recorded in configuration are rounded planning estimates published by BNE.
|
| 118 |
-
|
| 119 |
-
If Cloudflare permits the files in a normal browser but blocks the pipeline, download them from the official documentation and place them at these exact paths:
|
| 120 |
-
|
| 121 |
-
```text
|
| 122 |
-
data/raw/autoridades.nt.bz2
|
| 123 |
-
data/raw/materias.nt.bz2
|
| 124 |
-
data/raw/bibliograficos.nt.bz2
|
| 125 |
-
```
|
| 126 |
-
|
| 127 |
-
Then start at `normalize`. Existing sources are checked for a non-empty BZip2 header, so an HTML block page cannot be mistaken for an RDF dump. Full BZip2 integrity and UTF-8/N-Triples validity are checked while the files are streamed during normalization.
|
| 128 |
-
|
| 129 |
-
The September 2023 subjects dump contains a small number of external BnF IRIs split immediately before the closing `>` and continued on the next physical line. The normalizer rejoins only this identifiable two-line pattern, preserves the first physical line in `source_line`, and reports the number of repaired statements. It does not apply general-purpose cleanup or alter IRI text.
|
| 130 |
-
|
| 131 |
-
## Small real-data validation
|
| 132 |
|
| 133 |
-
|
| 134 |
|
| 135 |
-
```
|
| 136 |
-
bne-pipeline estimate --config configs/sample.json
|
| 137 |
-
bne-pipeline run --config configs/sample.json
|
| 138 |
-
```
|
| 139 |
|
| 140 |
-
|
| 141 |
|
| 142 |
-
|
| 143 |
|
| 144 |
-
``
|
| 145 |
-
bne-pipeline run --config configs/fixture.json
|
| 146 |
-
```
|
| 147 |
|
| 148 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
|
| 150 |
-
|
| 151 |
|
| 152 |
-
|
| 153 |
-
- `artifacts/normalization.json`: parsed, repaired, rejected, and output counts from normalization.
|
| 154 |
-
- `artifacts/schema.json`: physical schema and field semantics.
|
| 155 |
-
- `artifacts/quality.json`: non-empty tables, graph accounting, normalization row agreement, and invalid-line checks.
|
| 156 |
-
- `artifacts/provenance.json`: source, licence, snapshot, files, and transformations.
|
| 157 |
-
- `artifacts/checksums.json`: SHA-256 and size of every published Parquet shard.
|
| 158 |
|
| 159 |
-
|
| 160 |
|
| 161 |
-
##
|
| 162 |
|
| 163 |
-
|
| 164 |
-
.\.venv\Scripts\python.exe -m pytest
|
| 165 |
-
.\.venv\Scripts\ruff.exe check .
|
| 166 |
-
```
|
|
|
|
| 27 |
|
| 28 |
# BNE Linked Data
|
| 29 |
|
| 30 |
+
## Dataset description
|
| 31 |
|
| 32 |
+
BNE Linked Data is a normalized Parquet release of the Linked Open Data dumps published by the Biblioteca Nacional de España. It represents bibliographic resources, authority records, subject headings, and the relationships among them as RDF statements.
|
| 33 |
|
| 34 |
+
The released snapshot contains 260,288,924 triples from official BNE files last modified on 6 September 2023. The files were preserved by Internet Archive on 20 September 2023. Each RDF statement is represented by one row; no relationships are inferred and no enrichment is added.
|
| 35 |
|
| 36 |
## Source and licence
|
| 37 |
|
| 38 |
+
- Publisher: [Biblioteca Nacional de España](https://datos.bne.es/)
|
| 39 |
+
- Documentation: [BNE Linked Data](https://www.bne.es/es/catalogos/datos-enlazados-bne/datos-enlazados)
|
| 40 |
+
- Snapshot date: 6 September 2023
|
| 41 |
+
- Licence: [CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/)
|
|
|
|
| 42 |
|
| 43 |
+
The live BNE download service returned HTTP 403 to automated requests when this release was built. The data files therefore come from preserved copies of the original BNE BZip2 responses in Internet Archive. Source URLs, dates, and transformations are recorded in `artifacts/provenance.json`.
|
| 44 |
|
| 45 |
+
## Configurations
|
| 46 |
|
| 47 |
+
| Configuration | Content | Rows | Parquet files | Parquet size |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|---|---|---:|---:|---:|
|
| 49 |
+
| `bibliographic` | Bibliographic resources, manifestations, works, and their relationships | 208,059,171 | 833 | 1,772,292,848 bytes |
|
| 50 |
+
| `authorities` | People, organisations, conferences, works, expressions, and other authority entities | 46,107,241 | 185 | 493,978,094 bytes |
|
| 51 |
+
| `subjects` | Subject headings and SKOS relationships | 6,122,512 | 25 | 51,987,039 bytes |
|
| 52 |
+
|
| 53 |
+
Each configuration has a single `train` split containing the complete graph collection. The source does not define a supervised prediction target or official train, validation, and test partitions.
|
| 54 |
|
| 55 |
+
## Fields
|
| 56 |
|
| 57 |
+
| Field | Description |
|
| 58 |
|---|---|
|
| 59 |
+
| `record_id` | Stable identifier formed from the collection and source-line number |
|
| 60 |
| `subject` | Subject IRI or blank-node identifier |
|
| 61 |
| `predicate` | Predicate IRI |
|
| 62 |
| `object` | Object IRI, blank-node identifier, or decoded literal value |
|
| 63 |
| `object_kind` | `iri`, `literal`, or `blank_node` |
|
| 64 |
| `language` | Language tag attached to a literal, when present |
|
| 65 |
| `datatype` | Datatype IRI attached to a literal, when present |
|
| 66 |
+
| `collection` | Source graph collection |
|
| 67 |
+
| `source_line` | One-based physical line number in the decompressed source |
|
| 68 |
+
| `snapshot_date` | Source snapshot date |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
## Exploratory profile
|
| 71 |
|
| 72 |
+
The authority collection contains 5,624,909 distinct subjects and 96 predicates. The bibliographic collection contains 17,850,587 distinct subjects and 105 predicates. The subject collection contains 706,951 distinct subjects and 21 predicates.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
+
Across all configurations there are 85,517,669 IRI objects and 174,771,255 literal objects. No blank-node objects occur. Subject data contains 1,604,451 language-tagged literals: 1,527,636 Spanish, 32,508 English, 20,530 French, 15,982 Catalan, 5,186 Basque, and 2,609 Galician.
|
| 75 |
|
| 76 |
+
Frequent relations include `rdf:type`, BNE identifiers and labels, bibliographic work and manifestation links, SKOS semantic relations, and 1,353,732 `owl:sameAs` authority links. Full counts and the thirty most frequent predicates per configuration are available in `artifacts/profile.json`.
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
+
## Processing and quality
|
| 79 |
|
| 80 |
+
The BZip2 sources were streamed, parsed as N-Triples, and written as Zstandard-compressed Parquet. The subjects source contains 865 external BnF IRIs split immediately before the closing `>` and continued on the next physical line. Those identifiable pairs were rejoined without altering their text; the first physical line remains in `source_line`.
|
| 81 |
|
| 82 |
+
All 260,288,924 normalized rows passed the graph-accounting and source-line checks. No source statements remain invalid. SHA-256 hashes for every Parquet shard are provided in `artifacts/checksums.json`. Additional machine-readable information is available in:
|
|
|
|
|
|
|
| 83 |
|
| 84 |
+
- `artifacts/normalization.json`
|
| 85 |
+
- `artifacts/profile.json`
|
| 86 |
+
- `artifacts/provenance.json`
|
| 87 |
+
- `artifacts/quality.json`
|
| 88 |
+
- `artifacts/schema.json`
|
| 89 |
|
| 90 |
+
## Intended uses and limitations
|
| 91 |
|
| 92 |
+
The data is suitable for graph analysis, bibliographic research, retrieval, entity linking, authority reconciliation, and recommendation research. Consumers should create task-specific and leakage-aware evaluation splits when needed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
+
The snapshot reflects the BNE catalogue as published in September 2023 and may contain cataloguing conventions, historical descriptions, or source errors. A relationship in the graph should not be interpreted as a current factual claim without checking the underlying catalogue record. The dataset contains metadata and identifiers, not digitized works or their full text.
|
| 95 |
|
| 96 |
+
## Attribution
|
| 97 |
|
| 98 |
+
When using the data, attribute the Biblioteca Nacional de España as the original publisher and retain the CC0 and provenance information supplied with the release.
|
|
|
|
|
|
|
|
|