From 5b6b16c90e3e63238530698774667a1edce9ddfd Mon Sep 17 00:00:00 2001 From: Daniel Hernandez Date: Sun, 22 Feb 2026 09:20:35 +0100 Subject: [PATCH] Refactoring for readability. --- data/001-religions.ttl | 210 +++++++++++++++++++++++++++++++++++++ src/001_religions.rb | 30 ++---- src/002_generate_person.rb | 16 +-- 3 files changed, 224 insertions(+), 32 deletions(-) create mode 100644 data/001-religions.ttl mode change 100644 => 100755 src/001_religions.rb diff --git a/data/001-religions.ttl b/data/001-religions.ttl new file mode 100644 index 0000000..f4d24e7 --- /dev/null +++ b/data/001-religions.ttl @@ -0,0 +1,210 @@ +@prefix rdfs: . +@prefix mig: . +@prefix schema: . +@prefix person: . +@prefix religion: . +@prefix xsd: . + +religion:196 a mig:ReligionAffiliation ; + mig:person person:BecMar-00 ; + mig:religion "Jewish" ; + rdfs:comment "Was born to a Jewish family" . + +religion:199 a mig:ReligionAffiliation ; + mig:person person:GerBer-00 ; + mig:religion "Jewish" ; + rdfs:comment "Jewish, her mother was an Orthodox Jew" . + +religion:205 a mig:ReligionAffiliation ; + mig:person person:GluAlm-00 ; + mig:religion "Jewish" ; + rdfs:comment "Jewish, showing attraction to Anglican Christianity (attended the Episcopal Church in New Hartford), in addition, all three of her children were baptized" . + +religion:208 a mig:ReligionAffiliation ; + mig:person person:GolAbr-00 ; + mig:religion "Jewish" ; + rdfs:comment "Yew" . + +religion:211 a mig:ReligionAffiliation ; + mig:person person:GolAbr-00 ; + mig:religion "Other" ; + mig:dateStartFuzzy "1883" ; + rdfs:comment "Bar Kochba (1883) steht im Zeichen des beginnenden Zionismus" . + +religion:217 a mig:ReligionAffiliation ; + mig:person person:HelAnn-00 ; + mig:religion "Jewish" ; + rdfs:comment "May have converted from Judaism to Roman Catholicism as she married Carrera." . + +religion:218 a mig:ReligionAffiliation ; + mig:person person:HelAnn-00 ; + mig:religion "Christian" . + +religion:220 a mig:ReligionAffiliation ; + mig:person person:KalBer-00 ; + mig:religion "Jewish" ; + rdfs:comment "Jewish; Fifteen hundred people attended her funeral, considered a disappointing turnout, considering her status in the Jewish community. She had come to be seen as \"a relic of the theatrical past, with a manner too romantic and grand even for the Yiddish stage\"\n" . + +religion:223 a mig:ReligionAffiliation ; + mig:person person:KreEli-00 ; + mig:religion "Jewish" ; + rdfs:comment "baptised evangelical Christian (as a baby), comes from a Jewish family (negative thematised in the wedding to Paul von Thurn und Taxis)" . + +religion:224 a mig:ReligionAffiliation ; + mig:person person:KreEli-00 ; + mig:religion "Christian" . + +religion:226 a mig:ReligionAffiliation ; + mig:person person:KroSel-00 ; + mig:religion "Jewish" ; + rdfs:comment "Family with jewish roots" . + +religion:229 a mig:ReligionAffiliation ; + mig:person person:LewAug-00 ; + mig:religion "Jewish" ; + rdfs:comment "Israelitisch" . + +religion:232 a mig:ReligionAffiliation ; + mig:person person:LewAug-00 ; + mig:religion "Christian" ; + mig:dateStartFuzzy "1812" ; + mig:dateStart "1812-01-01"^^ ; + rdfs:comment "evangelical" . + +religion:235 a mig:ReligionAffiliation ; + mig:person person:LewAug-00 ; + mig:religion "Christian" ; + mig:dateStartFuzzy "1852" ; + mig:dateStart "1852-01-01"^^ ; + rdfs:comment "catholic" . + +religion:238 a mig:ReligionAffiliation ; + mig:person person:LewAug-00 ; + mig:religion "Other" ; + rdfs:comment "Ultramontanismus" . + +religion:244 a mig:ReligionAffiliation ; + mig:person person:MahGus-00 ; + mig:religion "Jewish" ; + mig:dateStart "1897-02-23"^^ ; + rdfs:comment "converted to Catholicism and was baptized\n“My Judaism, as things are now in the world, prevents me from entering any court theater. - Not Vienna, not Berlin, not Dresden, not Munich is open to me. The same wind blows everywhere. \"(Letter to Friedrich Löhr 1804)" . + +religion:245 a mig:ReligionAffiliation ; + mig:person person:MahGus-00 ; + mig:religion "Christian" . + +religion:247 a mig:ReligionAffiliation ; + mig:person person:NazAll-00 ; + mig:religion "Jewish" ; + rdfs:comment "Nazimova was born into a jewish family but raised a Catholic. Later she declared, her only faith was in her art." . + +religion:248 a mig:ReligionAffiliation ; + mig:person person:NazAll-00 ; + mig:religion "Christian" . + +religion:250 a mig:ReligionAffiliation ; + mig:person person:PolBer-00 ; + mig:religion "Jewish" ; + rdfs:comment "He came from fervent jewish family" . + +religion:253 a mig:ReligionAffiliation ; + mig:person person:RehAda-00 ; + mig:religion "Christian" ; + mig:dateStart "1857-06-12"^^ ; + rdfs:comment "baptised in St Michael's Roman Catholic Church" . + +religion:259 a mig:ReligionAffiliation ; + mig:person person:SchErn-00 ; + mig:religion "Jewish" ; + rdfs:comment "Baptized catholic but her maternal grandmother, Leah Kohn, was of Hungarian Jewish descent. Affirmed her Jewish ancestry proudly, fervently opposing the Hitler regime" . + +religion:260 a mig:ReligionAffiliation ; + mig:person person:SchErn-00 ; + mig:religion "Christian" . + +religion:262 a mig:ReligionAffiliation ; + mig:person person:StrAle-00 ; + mig:religion "Jewish" ; + rdfs:comment "Jewish" . + +religion:265 a mig:ReligionAffiliation ; + mig:person person:StrAle-00 ; + mig:religion "Christian" ; + rdfs:comment "was destined to become a preacher" . + +religion:268 a mig:ReligionAffiliation ; + mig:person person:TucSop-00 ; + mig:religion "Jewish" ; + rdfs:comment "Her parents were Russian Jews" . + +religion:272 a mig:ReligionAffiliation ; + mig:person person:HamOsc-00 ; + mig:religion "Jewish" ; + rdfs:comment "Jewish" . + +religion:338 a mig:ReligionAffiliation ; + mig:person person:KorFri-00 ; + mig:religion "Jewish" ; + rdfs:comment "jewish" . + +religion:347 a mig:ReligionAffiliation ; + mig:person person:LubErn-00 ; + mig:religion "Jewish" ; + rdfs:comment "Ashkenazi Jewish" . + +religion:355 a mig:ReligionAffiliation ; + mig:person person:KreHei-00 ; + mig:religion "Jewish" ; + mig:dateStartFuzzy "1871" ; + mig:dateStart "1871-01-01"^^ ; + mig:dateStartMax "1873" ; + mig:dateEndMin "1873-01-01"^^ ; + mig:dateEndMax "1873-12-31"^^ ; + rdfs:comment "He converted to the Catholic faith at the age of 54 as part of the assimilation of wider Jewish circles after the \"Interconfessional Laws\" of 1868 in Austria allowed a change of religion. He had all his children baptised Protestants in the places where they were born and where he had a stage engagement in each case." . + +religion:356 a mig:ReligionAffiliation ; + mig:person person:KreHei-00 ; + mig:religion "Christian" . + +religion:358 a mig:ReligionAffiliation ; + mig:person person:BoiCur-00 ; + mig:religion "Jewish" ; + rdfs:comment "jewish" . + +religion:387 a mig:ReligionAffiliation ; + mig:person person:GruFri-00 ; + mig:religion "Jewish" ; + rdfs:comment "Jewish" . + +religion:416 a mig:ReligionAffiliation ; + mig:person person:LevHer-00 ; + mig:religion "Jewish" ; + rdfs:comment "Born in a Jewish family he was no active jude, but did not baptize" . + +religion:423 a mig:ReligionAffiliation ; + mig:person person:ZemAle-00 ; + mig:religion "Jewish" ; + mig:dateStartFuzzy "1899" ; + mig:dateStart "1899-01-01"^^ ; + rdfs:comment "In 1899 he resigned from the Israelite religious community because the climate for Jews in Vienna was deteriorating." . + +religion:429 a mig:ReligionAffiliation ; + mig:person person:ZemAle-00 ; + mig:religion "Christian" ; + mig:dateStartFuzzy "1906" ; + mig:dateStart "1906-01-01"^^ ; + rdfs:comment "converting to Protestantism." . + +religion:431 a mig:ReligionAffiliation ; + mig:person person:KelAlf-00 ; + mig:religion "Christian" . + +religion:445 a mig:ReligionAffiliation ; + mig:person person:StrFri-00 ; + mig:religion "Christian" ; + mig:denomination "Protestant" . + +religion:446 a mig:ReligionAffiliation ; + mig:person person:HerAde-00 ; + mig:religion "Christian" . + diff --git a/src/001_religions.rb b/src/001_religions.rb old mode 100644 new mode 100755 index c91d0ec..232fb04 --- a/src/001_religions.rb +++ b/src/001_religions.rb @@ -13,28 +13,18 @@ DB[:religions].each do |row| id = row[:IDReligion] props = ["a mig:ReligionAffiliation"] - props << "mig:person person:#{row[:IDPerson]}" unless row[:IDPerson].to_s.empty? - props << "mig:religion #{ttl_literal(row[:religion])}" unless row[:religion].to_s.empty? - props << "mig:denomination #{ttl_literal(row[:denomination])}" unless row[:denomination].to_s.empty? - props << "mig:dateStartFuzzy #{ttl_literal(row[:DateStart_Fuzzy])}" unless row[:DateStart_Fuzzy].to_s.empty? + props << "mig:person person:#{row[:IDPerson]}" unless row[:IDPerson].to_s.empty? + props << "mig:religion #{ttl_literal(row[:religion])}" unless row[:religion].to_s.empty? + props << "mig:denomination #{ttl_literal(row[:denomination])}" unless row[:denomination].to_s.empty? + props << "mig:dateStartFuzzy #{ttl_literal(row[:DateStart_Fuzzy])}" unless row[:DateStart_Fuzzy].to_s.empty? - if row[:date_start] - props << "mig:dateStart #{RDF::Literal.new(row[:date_start].to_s, datatype: RDF::XSD.date).to_ntriples}" - end - if row[:DateStart_Min] - props << "mig:dateStartMin #{RDF::Literal.new(row[:DateStart_Min].to_s, datatype: RDF::XSD.date).to_ntriples}" - end + props << "mig:dateStart #{ttl_literal(row[:date_start])}" if row[:date_start] + props << "mig:dateStartMin #{ttl_literal(row[:DateStart_Min])}" if row[:DateStart_Min] + props << "mig:dateStartMax #{ttl_literal(row[:DateStart_Max])}" unless row[:DateStart_Max].to_s.empty? + props << "mig:dateEndMin #{ttl_literal(row[:DateEnd_Min])}" if row[:DateEnd_Min] + props << "mig:dateEndMax #{ttl_literal(row[:DateEnd_Max])}" if row[:DateEnd_Max] - props << "mig:dateStartMax #{ttl_literal(row[:DateStart_Max])}" unless row[:DateStart_Max].to_s.empty? - - if row[:DateEnd_Min] - props << "mig:dateEndMin #{RDF::Literal.new(row[:DateEnd_Min].to_s, datatype: RDF::XSD.date).to_ntriples}" - end - if row[:DateEnd_Max] - props << "mig:dateEndMax #{RDF::Literal.new(row[:DateEnd_Max].to_s, datatype: RDF::XSD.date).to_ntriples}" - end - - props << "rdfs:comment #{ttl_literal(row[:comment])}" unless row[:comment].to_s.empty? + props << "rdfs:comment #{ttl_literal(row[:comment])}" unless row[:comment].to_s.empty? output.puts "religion:#{id} #{props.first} ;" props[1..-2].each { |p| output.puts " #{p} ;" } diff --git a/src/002_generate_person.rb b/src/002_generate_person.rb index 4afa3e9..a9303ce 100644 --- a/src/002_generate_person.rb +++ b/src/002_generate_person.rb @@ -28,24 +28,16 @@ DB[:person].each do |row| props << "schema:hasOccupation #{ttl_literal(row[:profession])}" unless row[:profession].to_s.empty? props << "mig:fuzzyBirthDate #{ttl_literal(row[:fuzzybirthdate])}" unless row[:fuzzybirthdate].to_s.empty? - if row[:birthdate] - props << "schema:birthDate #{RDF::Literal.new(row[:birthdate].to_s, datatype: RDF::XSD.date).to_ntriples}" - end - if row[:birthdate_max] - props << "mig:birthDateMax #{RDF::Literal.new(row[:birthdate_max].to_s, datatype: RDF::XSD.date).to_ntriples}" - end + props << "schema:birthDate #{ttl_literal(row[:birthdate])}" if row[:birthdate] + props << "mig:birthDateMax #{ttl_literal(row[:birthdate_max])}" if row[:birthdate_max] props << "mig:birthInfo #{ttl_literal(row[:'Birth Info'])}" unless row[:'Birth Info'].to_s.empty? props << "schema:birthPlace location:#{row[:IDBirthPlace]}" unless row[:IDBirthPlace].to_s.empty? props << "mig:fuzzyDeathDate #{ttl_literal(row[:fuzzydeathdate])}" unless row[:fuzzydeathdate].to_s.empty? - if row[:deathdate] - props << "schema:deathDate #{RDF::Literal.new(row[:deathdate].to_s, datatype: RDF::XSD.date).to_ntriples}" - end - if row[:deathdate_max] - props << "mig:deathDateMax #{RDF::Literal.new(row[:deathdate_max].to_s, datatype: RDF::XSD.date).to_ntriples}" - end + props << "schema:deathDate #{ttl_literal(row[:deathdate])}" if row[:deathdate] + props << "mig:deathDateMax #{ttl_literal(row[:deathdate_max])}" if row[:deathdate_max] props << "mig:deathInfo #{ttl_literal(row[:'Death Info'])}" unless row[:'Death Info'].to_s.empty? props << "schema:deathPlace location:#{row[:IDDeathPlace]}" unless row[:IDDeathPlace].to_s.empty?