Datasets:
subject
stringlengths 30
212
| predicate
stringclasses 1
value | object
stringclasses 403
values | object_type
stringclasses 1
value | object_datatype
null | object_language
null |
|---|---|---|---|---|---|
http://dbpedia.org/resource/'89_Live_in_Japan
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/CreativeWork
|
uri
| null | null |
http://dbpedia.org/resource/(In)_Exile
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/MusicAlbum
|
uri
| null | null |
http://dbpedia.org/resource/'68_(comic_book)
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.w3.org/2002/07/owl#Thing
|
uri
| null | null |
http://dbpedia.org/resource/(Miss)understood
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q2188189
|
uri
| null | null |
http://dbpedia.org/resource/'Ullo_John!_Gotta_New_Motor%3F
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q2188189
|
uri
| null | null |
http://dbpedia.org/resource/(You_Can_Still)_Rock_in_America
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/CreativeWork
|
uri
| null | null |
http://dbpedia.org/resource/(They_Long_to_Be)_Close_to_You
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.w3.org/2002/07/owl#Thing
|
uri
| null | null |
http://dbpedia.org/resource/%22Frantic%22_Fay_Thomas
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q19088
|
uri
| null | null |
http://dbpedia.org/resource/'Round_and_'Round_(Merry_Go_'Round_of_Love)
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Work
|
uri
| null | null |
http://dbpedia.org/resource/(481394)_2006_SF6
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/Place
|
uri
| null | null |
http://dbpedia.org/resource/%22What_Is_This_Heart%3F%22
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q482994
|
uri
| null | null |
http://dbpedia.org/resource/'Ayy
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/Place
|
uri
| null | null |
http://dbpedia.org/resource/%22Freeway%22_Rick_Ross
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q729
|
uri
| null | null |
http://dbpedia.org/resource/(S,S)-butanediol_dehydrogenase
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q8047
|
uri
| null | null |
http://dbpedia.org/resource/(Baby_I've_Got_You)_On_My_Mind
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q2188189
|
uri
| null | null |
http://dbpedia.org/resource/(175706)_1996_FG3
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.w3.org/2002/07/owl#Thing
|
uri
| null | null |
http://dbpedia.org/resource/'t_Schulten_Hues
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.w3.org/2002/07/owl#Thing
|
uri
| null | null |
http://dbpedia.org/resource/(Margie's_At)_The_Lincoln_Park_Inn
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.w3.org/2002/07/owl#Thing
|
uri
| null | null |
http://dbpedia.org/resource/(Still_a)_Weirdo
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q2188189
|
uri
| null | null |
http://dbpedia.org/resource/(Γ
h)_NΓ€r_ni_tar_saken_i_egna_hΓ€nder
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/MusicRecording
|
uri
| null | null |
http://dbpedia.org/resource/(One_Glance_Is)_Holy
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/CreativeWork
|
uri
| null | null |
http://dbpedia.org/resource/'t_Gulden_Zeepaert_(ship,_1626)
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/Product
|
uri
| null | null |
http://dbpedia.org/resource/(Sing_Shi-Wo-Wo)_Stop_the_Pollution
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Work
|
uri
| null | null |
http://dbpedia.org/resource/(459883)_2014_JX55
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/Place
|
uri
| null | null |
http://dbpedia.org/resource/'Ksan__BritishColumbiaInterior-geo-stub__1
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/Place
|
uri
| null | null |
http://dbpedia.org/resource/'Abd_al-Haqq_al-Dehlawi__1
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Eukaryote
|
uri
| null | null |
http://dbpedia.org/resource/(I_Want_to)_Come_Home
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.w3.org/2002/07/owl#Thing
|
uri
| null | null |
http://dbpedia.org/resource/(523635)_2010_DN93
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Place
|
uri
| null | null |
http://dbpedia.org/resource/(480808)_1994_XL1
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/CelestialBody
|
uri
| null | null |
http://dbpedia.org/resource/$O$
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/CreativeWork
|
uri
| null | null |
http://dbpedia.org/resource/'s-Hertogenbosch__PoliticalFunction__1
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/PersonFunction
|
uri
| null | null |
http://dbpedia.org/resource/(322756)_2001_CK32
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.w3.org/2002/07/owl#Thing
|
uri
| null | null |
http://dbpedia.org/resource/'Neath_the_Puke_Tree
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Work
|
uri
| null | null |
http://dbpedia.org/resource/*Lisp
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.w3.org/2002/07/owl#Thing
|
uri
| null | null |
http://dbpedia.org/resource/%22No_Snow,_No_Show%22_for_the_Eskimo
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q482994
|
uri
| null | null |
http://dbpedia.org/resource/'Mamoshebi_Kabi
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Person
|
uri
| null | null |
http://dbpedia.org/resource/'91_Oginome_Collection
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q386724
|
uri
| null | null |
http://dbpedia.org/resource/(12538)_1998_OH
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q634
|
uri
| null | null |
http://dbpedia.org/resource/(145451)_2005_RM43
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.w3.org/2002/07/owl#Thing
|
uri
| null | null |
http://dbpedia.org/resource/&_You_Revolution
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q2188189
|
uri
| null | null |
http://dbpedia.org/resource/(I)_Get_Lost
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.w3.org/2002/07/owl#Thing
|
uri
| null | null |
http://dbpedia.org/resource/+'Justments
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/MusicAlbum
|
uri
| null | null |
http://dbpedia.org/resource/'n_Beetje_Verliefd
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.w3.org/2002/07/owl#Thing
|
uri
| null | null |
http://dbpedia.org/resource/(99907)_1989_VA
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Location
|
uri
| null | null |
http://dbpedia.org/resource/%22V%22_Is_for_Viagra._The_Remixes
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/MusicalWork
|
uri
| null | null |
http://dbpedia.org/resource/(120348)_2004_TY364
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.w3.org/2002/07/owl#Thing
|
uri
| null | null |
http://dbpedia.org/resource/%22Scarface%22_John_Williams
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/Person
|
uri
| null | null |
http://dbpedia.org/resource/$h*!_My_Dad_Says
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Work
|
uri
| null | null |
http://dbpedia.org/resource/'Atara
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Location
|
uri
| null | null |
http://dbpedia.org/resource/(sic)nesses
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q386724
|
uri
| null | null |
http://dbpedia.org/resource/%22Z%22_no_Chikai
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/CreativeWork
|
uri
| null | null |
http://dbpedia.org/resource/(The_Man_Who_Shot)_Liberty_Valance
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/MusicRecording
|
uri
| null | null |
http://dbpedia.org/resource/'Twas_the_Night_Before_Christmas_(1974_TV_special)
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/CreativeWork
|
uri
| null | null |
http://dbpedia.org/resource/%22Happy%22_in_Galoshes
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.w3.org/2002/07/owl#Thing
|
uri
| null | null |
http://dbpedia.org/resource/(35107)_1991_VH
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Place
|
uri
| null | null |
http://dbpedia.org/resource/(308635)_2005_YU55
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/CelestialBody
|
uri
| null | null |
http://dbpedia.org/resource/%3F_(Neal_Morse_album)
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/MusicalWork
|
uri
| null | null |
http://dbpedia.org/resource/%22Holcoceroides%22_scythrella
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q19088
|
uri
| null | null |
http://dbpedia.org/resource/%22Yume%22_~Mugen_no_Kanata~
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/CreativeWork
|
uri
| null | null |
http://dbpedia.org/resource/&_(Ayumi_Hamasaki_EP)
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/CreativeWork
|
uri
| null | null |
http://dbpedia.org/resource/(127546)_2002_XU93
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.w3.org/2002/07/owl#Thing
|
uri
| null | null |
http://dbpedia.org/resource/'s-Heerenbroek
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Place
|
uri
| null | null |
http://dbpedia.org/resource/(I_Don't_Want_to_Go_to)_Chelsea
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Work
|
uri
| null | null |
http://dbpedia.org/resource/(I_Like)_The_Way_You_Love_Me
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q2188189
|
uri
| null | null |
http://dbpedia.org/resource/%22Frantic%22_Fay_Thomas
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Species
|
uri
| null | null |
http://dbpedia.org/resource/(1R,3R)-1,2,3-Trimethylcyclopentane
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#ChemicalObject
|
uri
| null | null |
http://dbpedia.org/resource/(9928)_1981_WE9
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.w3.org/2002/07/owl#Thing
|
uri
| null | null |
http://dbpedia.org/resource/(heparan_sulfate)-glucosamine_3-sulfotransferase_1
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q8047
|
uri
| null | null |
http://dbpedia.org/resource/(31345)_1998_PG
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/CelestialBody
|
uri
| null | null |
http://dbpedia.org/resource/(410777)_2009_FD
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q634
|
uri
| null | null |
http://dbpedia.org/resource/'Tops'_with_Me
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/CreativeWork
|
uri
| null | null |
http://dbpedia.org/resource/(24952)_1997_QJ4
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Place
|
uri
| null | null |
http://dbpedia.org/resource/'Ali_ibn_al-Husayn_ibn_Quraysh
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q5
|
uri
| null | null |
http://dbpedia.org/resource/(612584)_2003_QX113
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q634
|
uri
| null | null |
http://dbpedia.org/resource/'s-Hertogenbosch_railway_station
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Infrastructure
|
uri
| null | null |
http://dbpedia.org/resource/(152680)_1998_KJ9
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/CelestialBody
|
uri
| null | null |
http://dbpedia.org/resource/(Ain't_Nobody_Loves_You)_Like_I_Do
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/CreativeWork
|
uri
| null | null |
http://dbpedia.org/resource/(Something_Inside)_So_Strong
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/CreativeWork
|
uri
| null | null |
http://dbpedia.org/resource/'Eseta_Fusitu'a
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q729
|
uri
| null | null |
http://dbpedia.org/resource/'Need_love
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/MusicAlbum
|
uri
| null | null |
http://dbpedia.org/resource/'S_Out
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/TVEpisode
|
uri
| null | null |
http://dbpedia.org/resource/(S)-N-acetyl-1-phenylethylamine_hydrolase
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Biomolecule
|
uri
| null | null |
http://dbpedia.org/resource/(613490)_2006_RJ103
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Location
|
uri
| null | null |
http://dbpedia.org/resource/%22Bassy%22_Bob_Brockmann
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q729
|
uri
| null | null |
http://dbpedia.org/resource/'Til_You_Do_Me_Right
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/MusicRecording
|
uri
| null | null |
http://dbpedia.org/resource/(392741)_2012_SQ31
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.w3.org/2002/07/owl#Thing
|
uri
| null | null |
http://dbpedia.org/resource/(RNA-polymerase)-subunit_kinase
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q206229
|
uri
| null | null |
http://dbpedia.org/resource/(You're)_Having_My_Baby
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q2188189
|
uri
| null | null |
http://dbpedia.org/resource/(Shake_That)_Cosmic_Thing
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q386724
|
uri
| null | null |
http://dbpedia.org/resource/(85633)_1998_KR65
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Location
|
uri
| null | null |
http://dbpedia.org/resource/(Someone's_Always_Telling_You_How_To)_Behave
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q386724
|
uri
| null | null |
http://dbpedia.org/resource/'Omar_Ellison
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Person
|
uri
| null | null |
http://dbpedia.org/resource/(15430)_1998_UR31
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Place
|
uri
| null | null |
http://dbpedia.org/resource/(29075)_1950_DA
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q634
|
uri
| null | null |
http://dbpedia.org/resource/(144898)_2004_VD17
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q634
|
uri
| null | null |
http://dbpedia.org/resource/(Pentamethylclopentadienyl)titanium_trichloride
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#ChemicalObject
|
uri
| null | null |
http://dbpedia.org/resource/(How_Could_You)_Bring_Him_Home
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://www.wikidata.org/entity/Q2188189
|
uri
| null | null |
http://dbpedia.org/resource/(4953)_1990_MU
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://dbpedia.org/ontology/Place
|
uri
| null | null |
http://dbpedia.org/resource/-30-_(film)
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/Movie
|
uri
| null | null |
http://dbpedia.org/resource/'Anin
|
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
|
http://schema.org/Place
|
uri
| null | null |
DBpedia Ontology
Dataset Description
DBpedia ontology classes and properties
Original Source: https://downloads.dbpedia.org/repo/dbpedia/mappings/instance-types/2022.12.01/instance-types_lang=en_transitive.ttl.bz2
Dataset Summary
This dataset contains RDF triples from DBpedia Ontology converted to HuggingFace dataset format for easy use in machine learning pipelines.
- Format: Originally turtle, converted to HuggingFace Dataset
- Size: 0.8 GB (extracted)
- Entities: ~9.5M
- Triples: ~40M
- Original License: CC BY-SA 3.0
Recommended Use
Type classification, ontology learning
Notes: Uses transitive closure of instance types for complete type hierarchy
Dataset Format: Lossless RDF Representation
This dataset uses a standard lossless format for representing RDF (Resource Description Framework) data in HuggingFace Datasets. All semantic information from the original RDF knowledge graph is preserved, enabling perfect round-trip conversion between RDF and HuggingFace formats.
Schema
Each RDF triple is represented as a row with 6 fields:
| Field | Type | Description | Example |
|---|---|---|---|
subject |
string | Subject of the triple (URI or blank node) | "http://schema.org/Person" |
predicate |
string | Predicate URI | "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" |
object |
string | Object of the triple | "John Doe" or "http://schema.org/Thing" |
object_type |
string | Type of object: "uri", "literal", or "blank_node" |
"literal" |
object_datatype |
string | XSD datatype URI (for typed literals) | "http://www.w3.org/2001/XMLSchema#integer" |
object_language |
string | Language tag (for language-tagged literals) | "en" |
Example: RDF Triple Representation
Original RDF (Turtle):
<http://example.org/John> <http://schema.org/name> "John Doe"@en .
HuggingFace Dataset Row:
{
"subject": "http://example.org/John",
"predicate": "http://schema.org/name",
"object": "John Doe",
"object_type": "literal",
"object_datatype": None,
"object_language": "en"
}
Loading the Dataset
from datasets import load_dataset
# Load the dataset
dataset = load_dataset("CleverThis/dbpedia-ontology")
# Access the data
data = dataset["data"]
# Iterate over triples
for row in data:
subject = row["subject"]
predicate = row["predicate"]
obj = row["object"]
obj_type = row["object_type"]
print(f"Triple: ({subject}, {predicate}, {obj})")
print(f" Object type: {obj_type}")
if row["object_language"]:
print(f" Language: {row['object_language']}")
if row["object_datatype"]:
print(f" Datatype: {row['object_datatype']}")
Converting Back to RDF
The dataset can be converted back to any RDF format (Turtle, N-Triples, RDF/XML, etc.) with zero information loss:
from datasets import load_dataset
from rdflib import Graph, URIRef, Literal, BNode
def convert_to_rdf(dataset_name, output_file="output.ttl", split="data"):
"""Convert HuggingFace dataset back to RDF Turtle format."""
# Load dataset
dataset = load_dataset(dataset_name)
# Create RDF graph
graph = Graph()
# Convert each row to RDF triple
for row in dataset[split]:
# Subject
if row["subject"].startswith("_:"):
subject = BNode(row["subject"][2:])
else:
subject = URIRef(row["subject"])
# Predicate (always URI)
predicate = URIRef(row["predicate"])
# Object (depends on object_type)
if row["object_type"] == "uri":
obj = URIRef(row["object"])
elif row["object_type"] == "blank_node":
obj = BNode(row["object"][2:])
elif row["object_type"] == "literal":
if row["object_datatype"]:
obj = Literal(row["object"], datatype=URIRef(row["object_datatype"]))
elif row["object_language"]:
obj = Literal(row["object"], lang=row["object_language"])
else:
obj = Literal(row["object"])
graph.add((subject, predicate, obj))
# Serialize to Turtle (or any RDF format)
graph.serialize(output_file, format="turtle")
print(f"Exported {len(graph)} triples to {output_file}")
return graph
# Usage
graph = convert_to_rdf("CleverThis/dbpedia-ontology", "reconstructed.ttl")
Information Preservation Guarantee
This format preserves 100% of RDF information:
- β URIs: Exact string representation preserved
- β Literals: Full text content preserved
- β
Datatypes: XSD and custom datatypes preserved
(e.g.,
xsd:integer,xsd:dateTime) - β
Language Tags: BCP 47 language tags preserved (e.g.,
@en,@fr,@ja) - β Blank Nodes: Node structure preserved (identifiers may change but graph isomorphism maintained)
Round-trip guarantee: Original RDF β HuggingFace β Reconstructed RDF produces semantically identical graphs.
Querying the Dataset
You can filter and query the dataset like any HuggingFace dataset:
from datasets import load_dataset
dataset = load_dataset("CleverThis/dbpedia-ontology")
# Find all triples with English literals
english_literals = dataset["data"].filter(
lambda x: x["object_type"] == "literal" and x["object_language"] == "en"
)
print(f"Found {len(english_literals)} English literals")
# Find all rdf:type statements
type_statements = dataset["data"].filter(
lambda x: "rdf-syntax-ns#type" in x["predicate"]
)
print(f"Found {len(type_statements)} type statements")
# Convert to Pandas for analysis
import pandas as pd
df = dataset["data"].to_pandas()
# Analyze predicate distribution
print(df["predicate"].value_counts())
Dataset Format
The dataset contains all triples in a single data split, suitable for machine learning tasks such as:
- Knowledge graph completion
- Link prediction
- Entity embedding
- Relation extraction
- Graph neural networks
Format Specification
For complete technical documentation of the RDF-to-HuggingFace format, see:
π RDF to HuggingFace Format Specification
The specification includes:
- Detailed schema definition
- All RDF node type mappings
- Performance benchmarks
- Edge cases and limitations
- Complete code examples
Conversion Metadata
- Source Format: turtle
- Original Size: 0.8 GB
- Conversion Tool: CleverErnie RDF Pipeline
- Format Version: 1.0
- Conversion Date: 2025-12-11
Citation
If you use this dataset, please cite the original source:
Original Dataset: DBpedia Ontology URL: https://downloads.dbpedia.org/repo/dbpedia/mappings/instance-types/2022.12.01/instance-types_lang=en_transitive.ttl.bz2 License: CC BY-SA 3.0
Dataset Preparation
This dataset was prepared using the CleverErnie GISM framework:
# Download original dataset
python scripts/rdf_dataset_downloader.py dbpedia-ontology -o datasets/
# Convert to HuggingFace format
python scripts/convert_rdf_to_hf_dataset.py \
datasets/dbpedia-ontology/[file] \
hf_datasets/dbpedia-ontology \
--format turtle
# Upload to HuggingFace Hub
python scripts/upload_all_datasets.py --dataset dbpedia-ontology
Additional Information
Original Source
Conversion Details
- Converted using: CleverErnie GISM
- Conversion script:
scripts/convert_rdf_to_hf_dataset.py - Dataset format: Single 'data' split with all triples
Maintenance
This dataset is maintained by the CleverThis organization.
- Downloads last month
- 28