Datasets:
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -12,31 +12,6 @@ tags:
|
|
| 12 |
- triples
|
| 13 |
size_categories:
|
| 14 |
- 1K<n<10K
|
| 15 |
-
configs:
|
| 16 |
-
- config_name: default
|
| 17 |
-
data_files:
|
| 18 |
-
- split: data
|
| 19 |
-
path: data/data-*
|
| 20 |
-
dataset_info:
|
| 21 |
-
features:
|
| 22 |
-
- name: subject
|
| 23 |
-
dtype: string
|
| 24 |
-
- name: predicate
|
| 25 |
-
dtype: string
|
| 26 |
-
- name: object
|
| 27 |
-
dtype: string
|
| 28 |
-
- name: object_type
|
| 29 |
-
dtype: string
|
| 30 |
-
- name: object_datatype
|
| 31 |
-
dtype: string
|
| 32 |
-
- name: object_language
|
| 33 |
-
dtype: string
|
| 34 |
-
splits:
|
| 35 |
-
- name: data
|
| 36 |
-
num_bytes: 2648040
|
| 37 |
-
num_examples: 17823
|
| 38 |
-
download_size: 394086
|
| 39 |
-
dataset_size: 2648040
|
| 40 |
---
|
| 41 |
|
| 42 |
# Schema.org
|
|
@@ -49,8 +24,8 @@ Vocabulary schemas for structured data on the web
|
|
| 49 |
|
| 50 |
### Dataset Summary
|
| 51 |
|
| 52 |
-
This dataset contains RDF triples from Schema.org converted to HuggingFace
|
| 53 |
-
for easy use in machine learning pipelines.
|
| 54 |
|
| 55 |
- **Format:** Originally turtle, converted to HuggingFace Dataset
|
| 56 |
- **Size:** 0.01 GB (extracted)
|
|
@@ -67,9 +42,10 @@ Ontology understanding, vocabulary learning, small-scale testing
|
|
| 67 |
|
| 68 |
## Dataset Format: Lossless RDF Representation
|
| 69 |
|
| 70 |
-
This dataset uses a **standard lossless format** for representing RDF (Resource
|
| 71 |
-
data in HuggingFace Datasets. All semantic information from
|
| 72 |
-
enabling perfect round-trip conversion
|
|
|
|
| 73 |
|
| 74 |
### Schema
|
| 75 |
|
|
@@ -77,11 +53,16 @@ Each RDF triple is represented as a row with **6 fields**:
|
|
| 77 |
|
| 78 |
| Field | Type | Description | Example |
|
| 79 |
|-------|------|-------------|---------|
|
| 80 |
-
| `subject` | string | Subject of the triple (URI or blank node) |
|
| 81 |
-
|
| 82 |
-
| `
|
| 83 |
-
|
| 84 |
-
| `
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
| `object_language` | string | Language tag (for language-tagged literals) | `"en"` |
|
| 86 |
|
| 87 |
### Example: RDF Triple Representation
|
|
@@ -131,7 +112,8 @@ for row in data:
|
|
| 131 |
|
| 132 |
### Converting Back to RDF
|
| 133 |
|
| 134 |
-
The dataset can be converted back to any RDF format (Turtle, N-Triples, RDF/XML,
|
|
|
|
| 135 |
|
| 136 |
```python
|
| 137 |
from datasets import load_dataset
|
|
@@ -186,11 +168,14 @@ This format preserves **100% of RDF information**:
|
|
| 186 |
|
| 187 |
- ✅ **URIs**: Exact string representation preserved
|
| 188 |
- ✅ **Literals**: Full text content preserved
|
| 189 |
-
- ✅ **Datatypes**: XSD and custom datatypes preserved (e.g., `xsd:integer`,
|
|
|
|
| 190 |
- ✅ **Language Tags**: BCP 47 language tags preserved (e.g., `@en`, `@fr`, `@ja`)
|
| 191 |
-
- ✅ **Blank Nodes**: Node structure preserved (identifiers may change but graph
|
|
|
|
| 192 |
|
| 193 |
-
**Round-trip guarantee**: Original RDF → HuggingFace → Reconstructed RDF produces
|
|
|
|
| 194 |
|
| 195 |
### Querying the Dataset
|
| 196 |
|
|
@@ -223,7 +208,8 @@ print(df["predicate"].value_counts())
|
|
| 223 |
|
| 224 |
### Dataset Format
|
| 225 |
|
| 226 |
-
The dataset contains all triples in a single **data** split, suitable for machine
|
|
|
|
| 227 |
|
| 228 |
- Knowledge graph completion
|
| 229 |
- Link prediction
|
|
@@ -235,7 +221,7 @@ The dataset contains all triples in a single **data** split, suitable for machin
|
|
| 235 |
|
| 236 |
For complete technical documentation of the RDF-to-HuggingFace format, see:
|
| 237 |
|
| 238 |
-
|
| 239 |
|
| 240 |
The specification includes:
|
| 241 |
- Detailed schema definition
|
|
@@ -250,7 +236,7 @@ The specification includes:
|
|
| 250 |
- **Original Size**: 0.01 GB
|
| 251 |
- **Conversion Tool**: [CleverErnie RDF Pipeline](https://github.com/CleverThis/cleverernie)
|
| 252 |
- **Format Version**: 1.0
|
| 253 |
-
- **Conversion Date**: 2025-
|
| 254 |
|
| 255 |
|
| 256 |
## Citation
|
|
@@ -267,7 +253,7 @@ This dataset was prepared using the CleverErnie GISM framework:
|
|
| 267 |
|
| 268 |
```bash
|
| 269 |
# Download original dataset
|
| 270 |
-
|
| 271 |
|
| 272 |
# Convert to HuggingFace format
|
| 273 |
python scripts/convert_rdf_to_hf_dataset.py \
|
|
|
|
| 12 |
- triples
|
| 13 |
size_categories:
|
| 14 |
- 1K<n<10K
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
---
|
| 16 |
|
| 17 |
# Schema.org
|
|
|
|
| 24 |
|
| 25 |
### Dataset Summary
|
| 26 |
|
| 27 |
+
This dataset contains RDF triples from Schema.org converted to HuggingFace
|
| 28 |
+
dataset format for easy use in machine learning pipelines.
|
| 29 |
|
| 30 |
- **Format:** Originally turtle, converted to HuggingFace Dataset
|
| 31 |
- **Size:** 0.01 GB (extracted)
|
|
|
|
| 42 |
|
| 43 |
## Dataset Format: Lossless RDF Representation
|
| 44 |
|
| 45 |
+
This dataset uses a **standard lossless format** for representing RDF (Resource
|
| 46 |
+
Description Framework) data in HuggingFace Datasets. All semantic information from
|
| 47 |
+
the original RDF knowledge graph is preserved, enabling perfect round-trip conversion
|
| 48 |
+
between RDF and HuggingFace formats.
|
| 49 |
|
| 50 |
### Schema
|
| 51 |
|
|
|
|
| 53 |
|
| 54 |
| Field | Type | Description | Example |
|
| 55 |
|-------|------|-------------|---------|
|
| 56 |
+
| `subject` | string | Subject of the triple (URI or blank node) |
|
| 57 |
+
`"http://schema.org/Person"` |
|
| 58 |
+
| `predicate` | string | Predicate URI |
|
| 59 |
+
`"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"` |
|
| 60 |
+
| `object` | string | Object of the triple |
|
| 61 |
+
`"John Doe"` or `"http://schema.org/Thing"` |
|
| 62 |
+
| `object_type` | string | Type of object: `"uri"`, `"literal"`, or
|
| 63 |
+
`"blank_node"` | `"literal"` |
|
| 64 |
+
| `object_datatype` | string | XSD datatype URI (for typed literals) |
|
| 65 |
+
`"http://www.w3.org/2001/XMLSchema#integer"` |
|
| 66 |
| `object_language` | string | Language tag (for language-tagged literals) | `"en"` |
|
| 67 |
|
| 68 |
### Example: RDF Triple Representation
|
|
|
|
| 112 |
|
| 113 |
### Converting Back to RDF
|
| 114 |
|
| 115 |
+
The dataset can be converted back to any RDF format (Turtle, N-Triples, RDF/XML,
|
| 116 |
+
etc.) with **zero information loss**:
|
| 117 |
|
| 118 |
```python
|
| 119 |
from datasets import load_dataset
|
|
|
|
| 168 |
|
| 169 |
- ✅ **URIs**: Exact string representation preserved
|
| 170 |
- ✅ **Literals**: Full text content preserved
|
| 171 |
+
- ✅ **Datatypes**: XSD and custom datatypes preserved (e.g., `xsd:integer`,
|
| 172 |
+
`xsd:dateTime`)
|
| 173 |
- ✅ **Language Tags**: BCP 47 language tags preserved (e.g., `@en`, `@fr`, `@ja`)
|
| 174 |
+
- ✅ **Blank Nodes**: Node structure preserved (identifiers may change but graph
|
| 175 |
+
isomorphism maintained)
|
| 176 |
|
| 177 |
+
**Round-trip guarantee**: Original RDF → HuggingFace → Reconstructed RDF produces
|
| 178 |
+
**semantically identical** graphs.
|
| 179 |
|
| 180 |
### Querying the Dataset
|
| 181 |
|
|
|
|
| 208 |
|
| 209 |
### Dataset Format
|
| 210 |
|
| 211 |
+
The dataset contains all triples in a single **data** split, suitable for machine
|
| 212 |
+
learning tasks such as:
|
| 213 |
|
| 214 |
- Knowledge graph completion
|
| 215 |
- Link prediction
|
|
|
|
| 221 |
|
| 222 |
For complete technical documentation of the RDF-to-HuggingFace format, see:
|
| 223 |
|
| 224 |
+
� [RDF to HuggingFace Format Specification](https://github.com/CleverThis/cleverernie/blob/master/docs/rdf_huggingface_format_specification.md)
|
| 225 |
|
| 226 |
The specification includes:
|
| 227 |
- Detailed schema definition
|
|
|
|
| 236 |
- **Original Size**: 0.01 GB
|
| 237 |
- **Conversion Tool**: [CleverErnie RDF Pipeline](https://github.com/CleverThis/cleverernie)
|
| 238 |
- **Format Version**: 1.0
|
| 239 |
+
- **Conversion Date**: 2025-12-18
|
| 240 |
|
| 241 |
|
| 242 |
## Citation
|
|
|
|
| 253 |
|
| 254 |
```bash
|
| 255 |
# Download original dataset
|
| 256 |
+
python scripts/rdf_dataset_downloader.py schema-org -o datasets/
|
| 257 |
|
| 258 |
# Convert to HuggingFace format
|
| 259 |
python scripts/convert_rdf_to_hf_dataset.py \
|