From f025be2e605f7cd8323b110cdd43d5a5d86428b1 Mon Sep 17 00:00:00 2001 From: Daniel Hernandez Date: Sun, 22 Feb 2026 10:18:45 +0100 Subject: [PATCH] Mapping persons religions. --- .gitignore | 3 +- data/001-religions.ttl | 82 +++++++-------- data/ontology.ttl | 21 ++++ data/persons_religions.ttl | 208 +++++++++++++++++++++++++++++++++++++ data/religions.ttl | 18 ++++ src/000-found-countries.rb | 4 +- src/001_religions.rb | 33 +++--- src/002_generate_person.rb | 34 +++--- src/map_countries.rb | 4 +- src/map_locations.rb | 4 +- src/vocabularies.rb | 20 ++-- 11 files changed, 345 insertions(+), 86 deletions(-) create mode 100644 data/ontology.ttl create mode 100644 data/persons_religions.ttl create mode 100644 data/religions.ttl diff --git a/.gitignore b/.gitignore index 2d11a6f..5e535da 100644 --- a/.gitignore +++ b/.gitignore @@ -57,4 +57,5 @@ build-iPhoneSimulator/ # .rubocop-https?--* # Editors -*~ \ No newline at end of file +*~ +\#* \ No newline at end of file diff --git a/data/001-religions.ttl b/data/001-religions.ttl index f4d24e7..cfb9a59 100644 --- a/data/001-religions.ttl +++ b/data/001-religions.ttl @@ -1,160 +1,158 @@ +@prefix mig: . +@prefix person: . @prefix rdfs: . -@prefix mig: . +@prefix religion: . @prefix schema: . -@prefix person: . -@prefix religion: . @prefix xsd: . religion:196 a mig:ReligionAffiliation ; mig:person person:BecMar-00 ; - mig:religion "Jewish" ; + mig:religion religion:Judaism ; rdfs:comment "Was born to a Jewish family" . religion:199 a mig:ReligionAffiliation ; mig:person person:GerBer-00 ; - mig:religion "Jewish" ; + mig:religion religion:Judaism ; rdfs:comment "Jewish, her mother was an Orthodox Jew" . religion:205 a mig:ReligionAffiliation ; mig:person person:GluAlm-00 ; - mig:religion "Jewish" ; + mig:religion religion:Judaism ; 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" ; + mig:religion religion:Judaism ; 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" ; + mig:religion religion:Judaism ; 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" . + mig:religion religion:Christianity . religion:220 a mig:ReligionAffiliation ; mig:person person:KalBer-00 ; - mig:religion "Jewish" ; + mig:religion religion:Judaism ; 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" ; + mig:religion religion:Judaism ; 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" . + mig:religion religion:Christianity . religion:226 a mig:ReligionAffiliation ; mig:person person:KroSel-00 ; - mig:religion "Jewish" ; + mig:religion religion:Judaism ; rdfs:comment "Family with jewish roots" . religion:229 a mig:ReligionAffiliation ; mig:person person:LewAug-00 ; - mig:religion "Jewish" ; + mig:religion religion:Judaism ; rdfs:comment "Israelitisch" . religion:232 a mig:ReligionAffiliation ; mig:person person:LewAug-00 ; - mig:religion "Christian" ; + mig:religion religion:Christianity ; 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:religion religion:Christianity ; 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:religion religion:Judaism ; 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" . + mig:religion religion:Christianity . religion:247 a mig:ReligionAffiliation ; mig:person person:NazAll-00 ; - mig:religion "Jewish" ; + mig:religion religion:Judaism ; 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" . + mig:religion religion:Christianity . religion:250 a mig:ReligionAffiliation ; mig:person person:PolBer-00 ; - mig:religion "Jewish" ; + mig:religion religion:Judaism ; rdfs:comment "He came from fervent jewish family" . religion:253 a mig:ReligionAffiliation ; mig:person person:RehAda-00 ; - mig:religion "Christian" ; + mig:religion religion:Christianity ; 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" ; + mig:religion religion:Judaism ; 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" . + mig:religion religion:Christianity . religion:262 a mig:ReligionAffiliation ; mig:person person:StrAle-00 ; - mig:religion "Jewish" ; + mig:religion religion:Judaism ; rdfs:comment "Jewish" . religion:265 a mig:ReligionAffiliation ; mig:person person:StrAle-00 ; - mig:religion "Christian" ; + mig:religion religion:Christianity ; rdfs:comment "was destined to become a preacher" . religion:268 a mig:ReligionAffiliation ; mig:person person:TucSop-00 ; - mig:religion "Jewish" ; + mig:religion religion:Judaism ; rdfs:comment "Her parents were Russian Jews" . religion:272 a mig:ReligionAffiliation ; mig:person person:HamOsc-00 ; - mig:religion "Jewish" ; + mig:religion religion:Judaism ; rdfs:comment "Jewish" . religion:338 a mig:ReligionAffiliation ; mig:person person:KorFri-00 ; - mig:religion "Jewish" ; + mig:religion religion:Judaism ; rdfs:comment "jewish" . religion:347 a mig:ReligionAffiliation ; mig:person person:LubErn-00 ; - mig:religion "Jewish" ; + mig:religion religion:Judaism ; rdfs:comment "Ashkenazi Jewish" . religion:355 a mig:ReligionAffiliation ; mig:person person:KreHei-00 ; - mig:religion "Jewish" ; + mig:religion religion:Judaism ; mig:dateStartFuzzy "1871" ; mig:dateStart "1871-01-01"^^ ; mig:dateStartMax "1873" ; @@ -164,47 +162,47 @@ religion:355 a mig:ReligionAffiliation ; religion:356 a mig:ReligionAffiliation ; mig:person person:KreHei-00 ; - mig:religion "Christian" . + mig:religion religion:Christianity . religion:358 a mig:ReligionAffiliation ; mig:person person:BoiCur-00 ; - mig:religion "Jewish" ; + mig:religion religion:Judaism ; rdfs:comment "jewish" . religion:387 a mig:ReligionAffiliation ; mig:person person:GruFri-00 ; - mig:religion "Jewish" ; + mig:religion religion:Judaism ; rdfs:comment "Jewish" . religion:416 a mig:ReligionAffiliation ; mig:person person:LevHer-00 ; - mig:religion "Jewish" ; + mig:religion religion:Judaism ; 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:religion religion:Judaism ; 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:religion religion:Christianity ; 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" . + mig:religion religion:Christianity . religion:445 a mig:ReligionAffiliation ; mig:person person:StrFri-00 ; - mig:religion "Christian" ; + mig:religion religion:Christianity ; mig:denomination "Protestant" . religion:446 a mig:ReligionAffiliation ; mig:person person:HerAde-00 ; - mig:religion "Christian" . + mig:religion religion:Christianity . diff --git a/data/ontology.ttl b/data/ontology.ttl new file mode 100644 index 0000000..40745d7 --- /dev/null +++ b/data/ontology.ttl @@ -0,0 +1,21 @@ +@prefix owl: . +@prefix rdfs: . +@prefix tm: . + + a owl:Ontology ; + rdfs:label "Theater Migrants Ontology"@en ; + dct:creator tm:DanielHernandez . + +tm:DanielHernandez a schema:Person ; + schema:identifier [ a schema:PropertyValue ; + schema:propertyID "ORCID" ; + schema:value "0000-0002-7896-0875" ] ; + schema:familyName "Hernandez"@en ; + schema:givenName "Daniel"@en ; + schema:sameAs wd:Q57243435 . + +# Classes + +tm:Religion a owl:Class ; + rdfs:label "Religion"@en ; + rdfs:comment "A religion or religious tradition."@en . diff --git a/data/persons_religions.ttl b/data/persons_religions.ttl new file mode 100644 index 0000000..1432f0d --- /dev/null +++ b/data/persons_religions.ttl @@ -0,0 +1,208 @@ +@prefix mig: <> . +@prefix person: . +@prefix rdfs: . +@prefix religion: . +@prefix schema: . +@prefix xsd: . + +religion:196 a tm:ReligionAffiliation ; + tm:person person:BecMar-00 ; + tm:religion religion:Judaism ; + rdfs:comment "Was born to a Jewish family" . + +religion:199 a tm:ReligionAffiliation ; + tm:person person:GerBer-00 ; + tm:religion religion:Judaism ; + rdfs:comment "Jewish, her mother was an Orthodox Jew" . + +religion:205 a tm:ReligionAffiliation ; + tm:person person:GluAlm-00 ; + tm:religion religion:Judaism ; + 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 tm:ReligionAffiliation ; + tm:person person:GolAbr-00 ; + tm:religion religion:Judaism ; + rdfs:comment "Yew" . + +religion:211 a tm:ReligionAffiliation ; + tm:person person:GolAbr-00 ; + tm:dateStartFuzzy "1883" ; + rdfs:comment "Bar Kochba (1883) steht im Zeichen des beginnenden Zionismus" . + +religion:217 a tm:ReligionAffiliation ; + tm:person person:HelAnn-00 ; + tm:religion religion:Judaism ; + rdfs:comment "May have converted from Judaism to Roman Catholicism as she married Carrera." . + +religion:218 a tm:ReligionAffiliation ; + tm:person person:HelAnn-00 ; + tm:religion religion:Christianity . + +religion:220 a tm:ReligionAffiliation ; + tm:person person:KalBer-00 ; + tm:religion religion:Judaism ; + 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 tm:ReligionAffiliation ; + tm:person person:KreEli-00 ; + tm:religion religion:Judaism ; + 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 tm:ReligionAffiliation ; + tm:person person:KreEli-00 ; + tm:religion religion:Christianity . + +religion:226 a tm:ReligionAffiliation ; + tm:person person:KroSel-00 ; + tm:religion religion:Judaism ; + rdfs:comment "Family with jewish roots" . + +religion:229 a tm:ReligionAffiliation ; + tm:person person:LewAug-00 ; + tm:religion religion:Judaism ; + rdfs:comment "Israelitisch" . + +religion:232 a tm:ReligionAffiliation ; + tm:person person:LewAug-00 ; + tm:religion religion:Christianity ; + tm:dateStartFuzzy "1812" ; + tm:dateStart "1812-01-01"^^ ; + rdfs:comment "evangelical" . + +religion:235 a tm:ReligionAffiliation ; + tm:person person:LewAug-00 ; + tm:religion religion:Christianity ; + tm:dateStartFuzzy "1852" ; + tm:dateStart "1852-01-01"^^ ; + rdfs:comment "catholic" . + +religion:238 a tm:ReligionAffiliation ; + tm:person person:LewAug-00 ; + rdfs:comment "Ultramontanismus" . + +religion:244 a tm:ReligionAffiliation ; + tm:person person:MahGus-00 ; + tm:religion religion:Judaism ; + tm: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 tm:ReligionAffiliation ; + tm:person person:MahGus-00 ; + tm:religion religion:Christianity . + +religion:247 a tm:ReligionAffiliation ; + tm:person person:NazAll-00 ; + tm:religion religion:Judaism ; + 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 tm:ReligionAffiliation ; + tm:person person:NazAll-00 ; + tm:religion religion:Christianity . + +religion:250 a tm:ReligionAffiliation ; + tm:person person:PolBer-00 ; + tm:religion religion:Judaism ; + rdfs:comment "He came from fervent jewish family" . + +religion:253 a tm:ReligionAffiliation ; + tm:person person:RehAda-00 ; + tm:religion religion:Christianity ; + tm:dateStart "1857-06-12"^^ ; + rdfs:comment "baptised in St Michael's Roman Catholic Church" . + +religion:259 a tm:ReligionAffiliation ; + tm:person person:SchErn-00 ; + tm:religion religion:Judaism ; + 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 tm:ReligionAffiliation ; + tm:person person:SchErn-00 ; + tm:religion religion:Christianity . + +religion:262 a tm:ReligionAffiliation ; + tm:person person:StrAle-00 ; + tm:religion religion:Judaism ; + rdfs:comment "Jewish" . + +religion:265 a tm:ReligionAffiliation ; + tm:person person:StrAle-00 ; + tm:religion religion:Christianity ; + rdfs:comment "was destined to become a preacher" . + +religion:268 a tm:ReligionAffiliation ; + tm:person person:TucSop-00 ; + tm:religion religion:Judaism ; + rdfs:comment "Her parents were Russian Jews" . + +religion:272 a tm:ReligionAffiliation ; + tm:person person:HamOsc-00 ; + tm:religion religion:Judaism ; + rdfs:comment "Jewish" . + +religion:338 a tm:ReligionAffiliation ; + tm:person person:KorFri-00 ; + tm:religion religion:Judaism ; + rdfs:comment "jewish" . + +religion:347 a tm:ReligionAffiliation ; + tm:person person:LubErn-00 ; + tm:religion religion:Judaism ; + rdfs:comment "Ashkenazi Jewish" . + +religion:355 a tm:ReligionAffiliation ; + tm:person person:KreHei-00 ; + tm:religion religion:Judaism ; + tm:dateStartFuzzy "1871" ; + tm:dateStart "1871-01-01"^^ ; + tm:dateStartMax "1873" ; + tm:dateEndMin "1873-01-01"^^ ; + tm: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 tm:ReligionAffiliation ; + tm:person person:KreHei-00 ; + tm:religion religion:Christianity . + +religion:358 a tm:ReligionAffiliation ; + tm:person person:BoiCur-00 ; + tm:religion religion:Judaism ; + rdfs:comment "jewish" . + +religion:387 a tm:ReligionAffiliation ; + tm:person person:GruFri-00 ; + tm:religion religion:Judaism ; + rdfs:comment "Jewish" . + +religion:416 a tm:ReligionAffiliation ; + tm:person person:LevHer-00 ; + tm:religion religion:Judaism ; + rdfs:comment "Born in a Jewish family he was no active jude, but did not baptize" . + +religion:423 a tm:ReligionAffiliation ; + tm:person person:ZemAle-00 ; + tm:religion religion:Judaism ; + tm:dateStartFuzzy "1899" ; + tm: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 tm:ReligionAffiliation ; + tm:person person:ZemAle-00 ; + tm:religion religion:Christianity ; + tm:dateStartFuzzy "1906" ; + tm:dateStart "1906-01-01"^^ ; + rdfs:comment "converting to Protestantism." . + +religion:431 a tm:ReligionAffiliation ; + tm:person person:KelAlf-00 ; + tm:religion religion:Christianity . + +religion:445 a tm:ReligionAffiliation ; + tm:person person:StrFri-00 ; + tm:religion religion:Christianity ; + tm:denomination "Protestant" . + +religion:446 a tm:ReligionAffiliation ; + tm:person person:HerAde-00 ; + tm:religion religion:Christianity . + diff --git a/data/religions.ttl b/data/religions.ttl new file mode 100644 index 0000000..2ada6bb --- /dev/null +++ b/data/religions.ttl @@ -0,0 +1,18 @@ +@prefix rdfs: . +@prefix religion: . +@prefix tm: . + +religion:Buddhism a tm:Religion ; + rdfs:label "Buddhism"@en . + +religion:Christianity a tm:Religion ; + rdfs:label "Christianity"@en . + +religion:Hinduism a tm:Religion ; + rdfs:label "Hinduism"@en . + +religion:Judaism a tm:Religion ; + rdfs:label "Judaism"@en . + +religion:Islam a tm:Religion ; + rdfs:label "Islam"@en . diff --git a/src/000-found-countries.rb b/src/000-found-countries.rb index 6d99408..696e886 100755 --- a/src/000-found-countries.rb +++ b/src/000-found-countries.rb @@ -34,8 +34,8 @@ def country_definition(country_name_literal, wd_solutions) end "country:#{toName(country_name_literal.to_s)} a schema:Country ;\n" \ " rdfs:label #{country_name_literal.to_ntriples} ;\n" \ - " mig:wikidataEntity #{wd_ids.join(' , ')} ;\n" \ - " mig:geonamesEntiy #{geo_ids.join(' , ')} .\n" + " tm:wikidataEntity #{wd_ids.join(' , ')} ;\n" \ + " tm:geonamesEntiy #{geo_ids.join(' , ')} .\n" end countries.each do |country_name, country_attrs| diff --git a/src/001_religions.rb b/src/001_religions.rb index 232fb04..4d4ff9f 100755 --- a/src/001_religions.rb +++ b/src/001_religions.rb @@ -4,25 +4,34 @@ require_relative 'database' require_relative 'vocabularies' require_relative 'migrants' -output = File.open(File.join('data', '001-religions.ttl'), 'w') +output = File.open(File.join('data', 'persons-religions.ttl'), 'w') -output.puts prefixes(:rdfs, :mig, :schema, :person, :religion, :xsd) +output.puts prefixes(:rdfs, :tm, :schema, :person, :religion, :xsd) output.puts +RELIGION_MAP = { + 'Buddhism' => 'religion:Buddhism', + 'Christian' => 'religion:Christianity', + 'Hinduism' => 'religion:Hinduism', + 'Jewish' => 'religion:Judaism', + 'Muslim' => 'religion:Islam' +} + DB[:religions].each do |row| id = row[:IDReligion] - props = ["a mig:ReligionAffiliation"] + props = ["a tm: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 << "tm:person person:#{row[:IDPerson]}" unless row[:IDPerson].to_s.empty? + religion_uri = RELIGION_MAP[row[:religion]] + props << "tm:religion #{religion_uri}" if religion_uri + props << "tm:denomination #{ttl_literal(row[:denomination])}" unless row[:denomination].to_s.empty? + props << "tm:dateStartFuzzy #{ttl_literal(row[:DateStart_Fuzzy])}" unless row[:DateStart_Fuzzy].to_s.empty? - 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 << "tm:dateStart #{ttl_literal(row[:date_start])}" if row[:date_start] + props << "tm:dateStartMin #{ttl_literal(row[:DateStart_Min])}" if row[:DateStart_Min] + props << "tm:dateStartMax #{ttl_literal(row[:DateStart_Max])}" unless row[:DateStart_Max].to_s.empty? + props << "tm:dateEndMin #{ttl_literal(row[:DateEnd_Min])}" if row[:DateEnd_Min] + props << "tm:dateEndMax #{ttl_literal(row[:DateEnd_Max])}" if row[:DateEnd_Max] props << "rdfs:comment #{ttl_literal(row[:comment])}" unless row[:comment].to_s.empty? diff --git a/src/002_generate_person.rb b/src/002_generate_person.rb index a9303ce..2f4db36 100644 --- a/src/002_generate_person.rb +++ b/src/002_generate_person.rb @@ -15,8 +15,8 @@ DB[:person].each do |row| props << "schema:givenName #{ttl_literal(row[:first_name])}" unless row[:first_name].to_s.empty? props << "schema:familyName #{ttl_literal(row[:family_name])}" unless row[:family_name].to_s.empty? - props << "mig:religion #{ttl_literal(row[:religion])}" unless row[:religion].to_s.empty? - props << "mig:nameType #{ttl_literal(row[:Nametype])}" unless row[:Nametype].to_s.empty? + props << "tm:religion #{ttl_literal(row[:religion])}" unless row[:religion].to_s.empty? + props << "tm:nameType #{ttl_literal(row[:Nametype])}" unless row[:Nametype].to_s.empty? case row[:gender] when 'male' then props << "schema:gender schema:Male" @@ -24,35 +24,35 @@ DB[:person].each do |row| end props << "schema:image <#{row[:imageURL]}>" unless row[:imageURL].to_s.empty? - props << "mig:imageSource #{ttl_literal(row[:image_source])}" unless row[:image_source].to_s.empty? + props << "tm:imageSource #{ttl_literal(row[:image_source])}" unless row[:image_source].to_s.empty? 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? + props << "tm:fuzzyBirthDate #{ttl_literal(row[:fuzzybirthdate])}" unless row[:fuzzybirthdate].to_s.empty? props << "schema:birthDate #{ttl_literal(row[:birthdate])}" if row[:birthdate] - props << "mig:birthDateMax #{ttl_literal(row[:birthdate_max])}" if row[:birthdate_max] + props << "tm: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 << "tm: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? + props << "tm:fuzzyDeathDate #{ttl_literal(row[:fuzzydeathdate])}" unless row[:fuzzydeathdate].to_s.empty? props << "schema:deathDate #{ttl_literal(row[:deathdate])}" if row[:deathdate] - props << "mig:deathDateMax #{ttl_literal(row[:deathdate_max])}" if row[:deathdate_max] + props << "tm: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 << "tm: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? props << "schema:sameAs <#{row[:Wikipedia]}>" unless row[:Wikipedia].to_s.empty? props << "schema:sameAs wd:#{row[:Wikidata]}" unless row[:Wikidata].to_s.empty? - props << "mig:gnd #{ttl_literal(row[:GND])}" unless row[:GND].to_s.empty? - props << "mig:lccn #{ttl_literal(row[:LCCN])}" unless row[:LCCN].to_s.empty? - props << "mig:viaf #{ttl_literal(row[:VIAF])}" unless row[:VIAF].to_s.empty? - props << "mig:cerl #{ttl_literal(row[:CERL])}" unless row[:CERL].to_s.empty? - props << "mig:isni #{ttl_literal(row[:ISNI])}" unless row[:ISNI].to_s.empty? - props << "mig:snac #{ttl_literal(row[:SNAC])}" unless row[:SNAC].to_s.empty? + props << "tm:gnd #{ttl_literal(row[:GND])}" unless row[:GND].to_s.empty? + props << "tm:lccn #{ttl_literal(row[:LCCN])}" unless row[:LCCN].to_s.empty? + props << "tm:viaf #{ttl_literal(row[:VIAF])}" unless row[:VIAF].to_s.empty? + props << "tm:cerl #{ttl_literal(row[:CERL])}" unless row[:CERL].to_s.empty? + props << "tm:isni #{ttl_literal(row[:ISNI])}" unless row[:ISNI].to_s.empty? + props << "tm:snac #{ttl_literal(row[:SNAC])}" unless row[:SNAC].to_s.empty? props << "rdfs:comment #{ttl_literal(row[:comment])}" unless row[:comment].to_s.empty? - props << "mig:source #{ttl_literal(row[:Source])}" unless row[:Source].to_s.empty? - props << "mig:importSource #{ttl_literal(row[:Importsource])}" unless row[:Importsource].to_s.empty? + props << "tm:source #{ttl_literal(row[:Source])}" unless row[:Source].to_s.empty? + props << "tm:importSource #{ttl_literal(row[:Importsource])}" unless row[:Importsource].to_s.empty? output.puts "person:#{id} #{props.first} ;" props[1..-2].each { |p| output.puts " #{p} ;" } diff --git a/src/map_countries.rb b/src/map_countries.rb index 24130ce..65993e5 100755 --- a/src/map_countries.rb +++ b/src/map_countries.rb @@ -40,9 +40,9 @@ def country_definition(country_name_literal, wd_solutions) country_uri = solution[:country].to_s get_wd_name(country_uri) end - "country:#{toName(country_name_literal.to_s)} a mig:Country ;\n" \ + "country:#{toName(country_name_literal.to_s)} a tm:Country ;\n" \ " rdfs:label #{country_name_literal.to_ntriples} ;\n" \ - " mig:wikidataID #{wd_ids.join(' , ')} .\n" + " tm:wikidataID #{wd_ids.join(' , ')} .\n" end COUNTRIES.each do |country_name, country_attrs| diff --git a/src/map_locations.rb b/src/map_locations.rb index 33ded75..6e60149 100755 --- a/src/map_locations.rb +++ b/src/map_locations.rb @@ -43,7 +43,7 @@ REGIONS = { REGIONS.each do |reg_name, reg_attr| reg_attr[:id] = "region:#{toName(reg_name)}" - puts "#{reg_attr[:id]} a mig:Region ; skos:prefLabel \"#{reg_name}\"@en ." + puts "#{reg_attr[:id]} a tm:Region ; skos:prefLabel \"#{reg_name}\"@en ." end LOCATIONS = [] @@ -71,5 +71,5 @@ end LOCATIONS.each do |location| p location - puts "#{location[:id]} a mig:Location ." + puts "#{location[:id]} a tm:Location ." end diff --git a/src/vocabularies.rb b/src/vocabularies.rb index bcacd76..a2c8074 100644 --- a/src/vocabularies.rb +++ b/src/vocabularies.rb @@ -1,32 +1,36 @@ # Vocabularies +# External vocabularies WD = RDF::Vocabulary.new('http://www.wikidata.org/entity/') WDT = RDF::Vocabulary.new('http://www.wikidata.org/prop/direct/') RDFS = RDF::Vocabulary.new('http://www.w3.org/2000/01/rdf-schema#') SCHEMA = RDF::Vocabulary.new('https://schema.org/') -COUNTRY = RDF::Vocabulary.new('https://daniel.degu.cl/data/countries.ttl#Country-') -MIG = RDF::Vocabulary.new('https://daniel.degu.cl/data/mig.ttl#') - -PERSON = RDF::Vocabulary.new('https://daniel.degu.cl/data/persons.ttl#') -LOCATION = RDF::Vocabulary.new('https://daniel.degu.cl/data/locations.ttl#') -RELIGION = RDF::Vocabulary.new('https://daniel.degu.cl/data/religions.ttl#') XSD = RDF::Vocabulary.new('http://www.w3.org/2001/XMLSchema#') +# Internal vocabularies +COUNTRY = RDF::Vocabulary.new('https://daniel.degu.cl/data/theater-migrants/countries.ttl#Country-') +TM = RDF::Vocabulary.new('https://daniel.degu.cl/data/theater-migrants/mig.ttl#') +PERSON = RDF::Vocabulary.new('https://daniel.degu.cl/data/theater-migrants/persons.ttl#') +LOCATION = RDF::Vocabulary.new('https://daniel.degu.cl/data/theater-migrants/locations.ttl#') +RELIGION = RDF::Vocabulary.new('https://daniel.degu.cl/data/theater-migrants/religions.ttl#') + +# Mapping from symbols to prefixes PREFIXES = { wd: WD, wdt: WDT, rdfs: RDFS, schema: SCHEMA, country: COUNTRY, - mig: MIG, + tm: TM, person: PERSON, location: LOCATION, religion: RELIGION, xsd: XSD } +# Generates a RDF/Turtle encoded list of prefixes useing the namespace symbols def prefixes(*namespaces) - namespaces.map do |ns| + namespaces.sort.map do |ns| "@prefix #{ns}: <#{PREFIXES[ns]}> .\n" end.join end