diff --git a/constructs_step06/001-persons.rq b/constructs_step06/001-persons.rq new file mode 100644 index 0000000..67bdae1 --- /dev/null +++ b/constructs_step06/001-persons.rq @@ -0,0 +1,77 @@ +# Construct person triples with tm: vocabulary. +# Drops internal IDs and redundant old authority-link predicates +# (already covered by owl:sameAs / wdtn:* from Step 5). + +PREFIX rdfs: +PREFIX owl: +PREFIX schema: +PREFIX wdtn: +PREFIX tm: +PREFIX personp: + +CONSTRUCT { + ?s a schema:Person . + ?s rdfs:label ?label . + ?s rdfs:comment ?comment . + ?s schema:givenName ?givenName . + ?s schema:familyName ?familyName . + ?s schema:birthDate ?birthDate . + ?s schema:deathDate ?deathDate . + ?s schema:gender ?gender . + ?s schema:birthPlace ?birthPlace . + ?s schema:deathPlace ?deathPlace . + ?s schema:image ?image . + ?s schema:citation ?citation . + ?s schema:hasOccupation ?occupation . + ?s schema:sameAs ?sameAs . + ?s owl:sameAs ?owlSameAs . + ?s wdtn:P214 ?viaf . + ?s wdtn:P227 ?gnd . + ?s wdtn:P213 ?isni . + ?s wdtn:P244 ?lccn . + ?s wdtn:P3430 ?snac . + ?s wdtn:P1871 ?cerl . + ?s tm:importSource ?importSource . + ?s tm:nameType ?nameType . + ?s tm:birthDateMax ?birthDateMax . + ?s tm:deathDateMax ?deathDateMax . + ?s tm:fuzzyBirthDate ?fuzzyBirthDate . + ?s tm:fuzzyDeathDate ?fuzzyDeathDate . + ?s tm:birthInfo ?birthInfo . + ?s tm:deathInfo ?deathInfo . + ?s tm:religionLabel ?religion . + ?s tm:imageSource ?imageSource . +} +WHERE { + ?s a schema:Person . + OPTIONAL { ?s rdfs:label ?label } + OPTIONAL { ?s rdfs:comment ?comment } + OPTIONAL { ?s schema:givenName ?givenName } + OPTIONAL { ?s schema:familyName ?familyName } + OPTIONAL { ?s schema:birthDate ?birthDate } + OPTIONAL { ?s schema:deathDate ?deathDate } + OPTIONAL { ?s schema:gender ?gender } + OPTIONAL { ?s schema:birthPlace ?birthPlace } + OPTIONAL { ?s schema:deathPlace ?deathPlace } + OPTIONAL { ?s schema:image ?image } + OPTIONAL { ?s schema:citation ?citation } + OPTIONAL { ?s schema:hasOccupation ?occupation } + OPTIONAL { ?s schema:sameAs ?sameAs } + OPTIONAL { ?s owl:sameAs ?owlSameAs } + OPTIONAL { ?s wdtn:P214 ?viaf } + OPTIONAL { ?s wdtn:P227 ?gnd } + OPTIONAL { ?s wdtn:P213 ?isni } + OPTIONAL { ?s wdtn:P244 ?lccn } + OPTIONAL { ?s wdtn:P3430 ?snac } + OPTIONAL { ?s wdtn:P1871 ?cerl } + OPTIONAL { ?s personp:Importsource ?importSource } + OPTIONAL { ?s personp:Nametype ?nameType } + OPTIONAL { ?s personp:birthdate_max ?birthDateMax } + OPTIONAL { ?s personp:deathdate_max ?deathDateMax } + OPTIONAL { ?s personp:fuzzybirthdate ?fuzzyBirthDate } + OPTIONAL { ?s personp:fuzzydeathdate ?fuzzyDeathDate } + OPTIONAL { ?s personp:Birth_Info ?birthInfo } + OPTIONAL { ?s personp:Death_Info ?deathInfo } + OPTIONAL { ?s personp:religion ?religion } + OPTIONAL { ?s personp:image_source ?imageSource } +} diff --git a/constructs_step06/002-places.rq b/constructs_step06/002-places.rq new file mode 100644 index 0000000..66bdfbf --- /dev/null +++ b/constructs_step06/002-places.rq @@ -0,0 +1,33 @@ +# Construct place triples with tm: vocabulary. + +PREFIX rdfs: +PREFIX owl: +PREFIX schema: +PREFIX wgs84: +PREFIX tm: +PREFIX locationp: + +CONSTRUCT { + ?s a schema:Place . + ?s owl:sameAs ?owlSameAs . + ?s schema:sameAs ?sameAs . + ?s wgs84:lat ?lat . + ?s wgs84:long ?long . + ?s tm:geoNamesID ?geoNamesID . + ?s tm:continent ?continent . + ?s tm:country ?country . + ?s tm:state ?state . + ?s tm:city ?city . +} +WHERE { + ?s a schema:Place . + OPTIONAL { ?s owl:sameAs ?owlSameAs } + OPTIONAL { ?s schema:sameAs ?sameAs } + OPTIONAL { ?s wgs84:lat ?lat } + OPTIONAL { ?s wgs84:long ?long } + OPTIONAL { ?s locationp:GeoNamesID ?geoNamesID } + OPTIONAL { ?s locationp:Continent ?continent } + OPTIONAL { ?s locationp:Country ?country } + OPTIONAL { ?s locationp:State ?state } + OPTIONAL { ?s locationp:City ?city } +} diff --git a/constructs_step06/003-organisations.rq b/constructs_step06/003-organisations.rq new file mode 100644 index 0000000..d14d5b1 --- /dev/null +++ b/constructs_step06/003-organisations.rq @@ -0,0 +1,21 @@ +# Construct organisation triples with tm: vocabulary. + +PREFIX schema: +PREFIX rdfs: +PREFIX tm: +PREFIX orgp: + +CONSTRUCT { + ?s a schema:Organization . + ?s schema:name ?name . + ?s schema:location ?location . + ?s rdfs:comment ?comment . + ?s tm:institutionType ?instType . +} +WHERE { + ?s a schema:Organization . + OPTIONAL { ?s schema:name ?name } + OPTIONAL { ?s schema:location ?location } + OPTIONAL { ?s rdfs:comment ?comment } + OPTIONAL { ?s orgp:InstType ?instType } +} diff --git a/constructs_step06/004-migrations.rq b/constructs_step06/004-migrations.rq new file mode 100644 index 0000000..e73d1cc --- /dev/null +++ b/constructs_step06/004-migrations.rq @@ -0,0 +1,36 @@ +# Construct migration triples with tm: vocabulary. + +PREFIX tm: +PREFIX migrants: +PREFIX migp: + +CONSTRUCT { + ?s a tm:Migration . + ?s tm:migrant ?person . + ?s tm:startPlace ?startPlace . + ?s tm:destinationPlace ?destPlace . + ?s tm:reason ?reason . + ?s tm:secondaryReason ?reason2 . + ?s tm:dateStartMin ?dsMin . + ?s tm:dateStartMax ?dsMax . + ?s tm:dateEndMin ?deMin . + ?s tm:dateEndMax ?deMax . + ?s tm:dateStartFuzzy ?dsFuzzy . + ?s tm:dateEndFuzzy ?deFuzzy . + ?s tm:via ?via . +} +WHERE { + ?s a migrants:migration_table . + OPTIONAL { ?s migp:ref-IDPerson ?person } + OPTIONAL { ?s migp:ref-IDStartPlace ?startPlace } + OPTIONAL { ?s migp:ref-IDDestPlace ?destPlace } + OPTIONAL { ?s migp:reason ?reason } + OPTIONAL { ?s migp:reason2 ?reason2 } + OPTIONAL { ?s migp:DateStart_Min ?dsMin } + OPTIONAL { ?s migp:DateStart_Max ?dsMax } + OPTIONAL { ?s migp:DateEnd_Min ?deMin } + OPTIONAL { ?s migp:DateEnd_Max ?deMax } + OPTIONAL { ?s migp:DateStart_Fuzzy ?dsFuzzy } + OPTIONAL { ?s migp:DateEnd_Fuzzy ?deFuzzy } + OPTIONAL { ?s migp:via ?via } +} diff --git a/constructs_step06/005-memberships.rq b/constructs_step06/005-memberships.rq new file mode 100644 index 0000000..a602d05 --- /dev/null +++ b/constructs_step06/005-memberships.rq @@ -0,0 +1,48 @@ +# Construct work engagements as org:Membership with tm: vocabulary. +# Replaces migrants:work with org:Membership, using org:member and +# org:organization from the W3C Organization Ontology. + +PREFIX rdfs: +PREFIX org: +PREFIX tm: +PREFIX migrants: +PREFIX workp: + +CONSTRUCT { + ?s a org:Membership . + ?s org:member ?person . + ?s org:organization ?organisation . + ?s tm:workLocation ?location . + ?s tm:secondaryOrganisation ?org2 . + ?s tm:profession ?profession . + ?s tm:secondaryProfession ?profession2 . + ?s tm:tertiaryProfession ?profession3 . + ?s tm:employmentType ?emplType . + ?s tm:employment ?employment . + ?s rdfs:comment ?comment . + ?s tm:dateStartMin ?dsMin . + ?s tm:dateStartMax ?dsMax . + ?s tm:dateEndMin ?deMin . + ?s tm:dateEndMax ?deMax . + ?s tm:dateStartFuzzy ?dsFuzzy . + ?s tm:dateEndFuzzy ?deFuzzy . +} +WHERE { + ?s a migrants:work . + OPTIONAL { ?s workp:ref-IDPerson ?person } + OPTIONAL { ?s workp:ref-IDOrganisation ?organisation } + OPTIONAL { ?s workp:ref-IDLocation ?location } + OPTIONAL { ?s workp:ref-IDOrganisation2 ?org2 } + OPTIONAL { ?s workp:Profession ?profession } + OPTIONAL { ?s workp:Profession2 ?profession2 } + OPTIONAL { ?s workp:Profession3 ?profession3 } + OPTIONAL { ?s workp:EmploymentType ?emplType } + OPTIONAL { ?s workp:Employment ?employment } + OPTIONAL { ?s workp:comment ?comment } + OPTIONAL { ?s workp:DateStart_Min ?dsMin } + OPTIONAL { ?s workp:DateStart_Max ?dsMax } + OPTIONAL { ?s workp:DateEnd_Min ?deMin } + OPTIONAL { ?s workp:DateEnd_Max ?deMax } + OPTIONAL { ?s workp:DateStart_Fuzzy ?dsFuzzy } + OPTIONAL { ?s workp:DateEnd_Fuzzy ?deFuzzy } +} diff --git a/constructs_step06/006-relationships.rq b/constructs_step06/006-relationships.rq new file mode 100644 index 0000000..93947bf --- /dev/null +++ b/constructs_step06/006-relationships.rq @@ -0,0 +1,41 @@ +# Construct relationship triples with tm: vocabulary. + +PREFIX rdfs: +PREFIX tm: +PREFIX migrants: +PREFIX relp: + +CONSTRUCT { + ?s a tm:Relationship . + ?s tm:activePerson ?active . + ?s tm:passivePerson ?passive . + ?s tm:relationshipLocation ?location . + ?s tm:relationshipOrganisation ?organisation . + ?s tm:relationshipType ?relType . + ?s tm:relationshipTypePrecise ?relTypePrecise . + ?s rdfs:comment ?comment . + ?s tm:timePeriod ?timePeriod . + ?s tm:dateStartMin ?dsMin . + ?s tm:dateStartMax ?dsMax . + ?s tm:dateEndMin ?deMin . + ?s tm:dateEndMax ?deMax . + ?s tm:dateStartFuzzy ?dsFuzzy . + ?s tm:dateEndFuzzy ?deFuzzy . +} +WHERE { + ?s a migrants:relationship . + OPTIONAL { ?s relp:ref-IDPerson_active ?active } + OPTIONAL { ?s relp:ref-IDPerson_passive ?passive } + OPTIONAL { ?s relp:ref-IDLocation ?location } + OPTIONAL { ?s relp:ref-IDOrganisation ?organisation } + OPTIONAL { ?s relp:Relationshiptype ?relType } + OPTIONAL { ?s relp:relationshiptype_precise ?relTypePrecise } + OPTIONAL { ?s relp:comment ?comment } + OPTIONAL { ?s relp:Timeperiod ?timePeriod } + OPTIONAL { ?s relp:DateStart_Min ?dsMin } + OPTIONAL { ?s relp:DateStart_Max ?dsMax } + OPTIONAL { ?s relp:DateEnd_Min ?deMin } + OPTIONAL { ?s relp:DateEnd_Max ?deMax } + OPTIONAL { ?s relp:DateStart_Fuzzy ?dsFuzzy } + OPTIONAL { ?s relp:DateEnd_Fuzzy ?deFuzzy } +} diff --git a/constructs_step06/007-person-professions.rq b/constructs_step06/007-person-professions.rq new file mode 100644 index 0000000..fc3161c --- /dev/null +++ b/constructs_step06/007-person-professions.rq @@ -0,0 +1,18 @@ +# Construct person-profession association triples with tm: vocabulary. + +PREFIX tm: +PREFIX migrants: +PREFIX ppp: + +CONSTRUCT { + ?s a tm:PersonProfession . + ?s tm:personProfessionPerson ?person . + ?s tm:enumeratedProfession ?eprofession . + ?s tm:professionLabel ?profLabel . +} +WHERE { + ?s a migrants:person_profession . + OPTIONAL { ?s ppp:ref-IDPerson ?person } + OPTIONAL { ?s ppp:Eprofession ?eprofession } + OPTIONAL { ?s ppp:profession ?profLabel } +} diff --git a/constructs_step06/008-person-names.rq b/constructs_step06/008-person-names.rq new file mode 100644 index 0000000..80d4277 --- /dev/null +++ b/constructs_step06/008-person-names.rq @@ -0,0 +1,35 @@ +# Construct person-name triples with tm: vocabulary. + +PREFIX rdfs: +PREFIX tm: +PREFIX migrants: +PREFIX pnp: + +CONSTRUCT { + ?s a tm:PersonName . + ?s tm:personNamePerson ?person . + ?s tm:nameType ?nameType . + ?s tm:personName ?name . + ?s tm:personSurName ?surname . + ?s rdfs:comment ?comment . + ?s tm:dateStartMin ?dsMin . + ?s tm:dateStartMax ?dsMax . + ?s tm:dateEndMin ?deMin . + ?s tm:dateEndMax ?deMax . + ?s tm:dateStartFuzzy ?dsFuzzy . + ?s tm:dateEndFuzzy ?deFuzzy . +} +WHERE { + ?s a migrants:personnames . + OPTIONAL { ?s pnp:ref-IDPerson ?person } + OPTIONAL { ?s pnp:Nametype ?nameType } + OPTIONAL { ?s pnp:personName ?name } + OPTIONAL { ?s pnp:personSurName ?surname } + OPTIONAL { ?s pnp:comment ?comment } + OPTIONAL { ?s pnp:DateStart_Min ?dsMin } + OPTIONAL { ?s pnp:DateStart_Max ?dsMax } + OPTIONAL { ?s pnp:DateEnd_Min ?deMin } + OPTIONAL { ?s pnp:DateEnd_Max ?deMax } + OPTIONAL { ?s pnp:DateStart_Fuzzy ?dsFuzzy } + OPTIONAL { ?s pnp:DateEnd_Fuzzy ?deFuzzy } +} diff --git a/constructs_step06/009-religion-affiliations.rq b/constructs_step06/009-religion-affiliations.rq new file mode 100644 index 0000000..4154a77 --- /dev/null +++ b/constructs_step06/009-religion-affiliations.rq @@ -0,0 +1,31 @@ +# Construct religion affiliation triples with tm: vocabulary. + +PREFIX rdfs: +PREFIX tm: +PREFIX migrants: +PREFIX relgp: + +CONSTRUCT { + ?s a tm:ReligionAffiliation . + ?s tm:religionAffiliationPerson ?person . + ?s tm:religion ?religion . + ?s tm:denomination ?denomination . + ?s rdfs:comment ?comment . + ?s tm:dateStartMin ?dsMin . + ?s tm:dateStartMax ?dsMax . + ?s tm:dateEndMin ?deMin . + ?s tm:dateEndMax ?deMax . + ?s tm:dateStartFuzzy ?dsFuzzy . +} +WHERE { + ?s a migrants:religions . + OPTIONAL { ?s relgp:ref-IDPerson ?person } + OPTIONAL { ?s relgp:religion ?religion } + OPTIONAL { ?s relgp:denomination ?denomination } + OPTIONAL { ?s relgp:comment ?comment } + OPTIONAL { ?s relgp:date_start ?dsMin } + OPTIONAL { ?s relgp:DateStart_Max ?dsMax } + OPTIONAL { ?s relgp:DateEnd_Min ?deMin } + OPTIONAL { ?s relgp:DateEnd_Max ?deMax } + OPTIONAL { ?s relgp:DateStart_Fuzzy ?dsFuzzy } +} diff --git a/constructs_step06/010-occupations.rq b/constructs_step06/010-occupations.rq new file mode 100644 index 0000000..220cdac --- /dev/null +++ b/constructs_step06/010-occupations.rq @@ -0,0 +1,30 @@ +# Construct occupation instances. +# Existing schema:Occupation instances pass through. +# migrants:Profession instances are retyped as schema:Occupation. + +PREFIX rdfs: +PREFIX skos: +PREFIX schema: +PREFIX migrants: + +CONSTRUCT { + ?s a schema:Occupation . + ?s schema:name ?name . +} +WHERE { + ?s a schema:Occupation . + OPTIONAL { ?s schema:name ?name } +} +; +CONSTRUCT { + ?s a schema:Occupation . + ?s a skos:Concept . + ?s rdfs:label ?label . + ?s skos:prefLabel ?prefLabel . + ?s schema:name ?label . +} +WHERE { + ?s a migrants:Profession . + OPTIONAL { ?s rdfs:label ?label } + OPTIONAL { ?s skos:prefLabel ?prefLabel } +} diff --git a/constructs_step06/011-enumerations.rq b/constructs_step06/011-enumerations.rq new file mode 100644 index 0000000..fb43f5c --- /dev/null +++ b/constructs_step06/011-enumerations.rq @@ -0,0 +1,35 @@ +# Construct enumeration instances with tm: types. +# Replaces migrants: enum types with tm: equivalents. +# Excludes migrants:Profession (handled in 010-occupations.rq) +# and migrants:Gender (already covered by schema:GenderType). + +PREFIX rdfs: +PREFIX skos: +PREFIX tm: +PREFIX migrants: + +CONSTRUCT { + ?s a skos:Concept . + ?s a ?tmType . + ?s rdfs:label ?label . + ?s skos:prefLabel ?prefLabel . +} +WHERE { + VALUES (?oldType ?tmType) { + ( migrants:Continent tm:Continent ) + ( migrants:Country tm:Country ) + ( migrants:State tm:State ) + ( migrants:City tm:City ) + ( migrants:MigrationReason tm:MigrationReason ) + ( migrants:InstitutionType tm:InstitutionType ) + ( migrants:Nametype tm:NameType ) + ( migrants:RelationshipType tm:RelationshipType ) + ( migrants:RelationshipTypePrecise tm:RelationshipTypePrecise ) + ( migrants:Religion tm:Religion ) + ( migrants:EmploymentType tm:EmploymentType ) + ( migrants:ImportSource tm:ImportSource ) + } + ?s a ?oldType . + OPTIONAL { ?s rdfs:label ?label } + OPTIONAL { ?s skos:prefLabel ?prefLabel } +}