migrants/updates_step05/001-person-properties.rq
Daniel Hernandez 3d0829aa9d Add Step 5: use well-known vocabularies (Schema.org, OWL, WGS84, SKOS)
SPARQL UPDATE queries add standard vocabulary properties alongside
existing custom predicates: schema:Person/Place/Organization types,
schema:givenName/familyName/birthDate, owl:sameAs for authority links,
wgs84:lat/long for coordinates, skos:Concept/prefLabel for enumerations,
and rdfs:label for persons.
2026-03-01 12:07:01 +01:00

58 lines
2.5 KiB
SPARQL

PREFIX schema: <https://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
DELETE { ?s <http://example.org/migrants/person#first_name> ?v . }
INSERT { ?s schema:givenName ?v . }
WHERE { ?s <http://example.org/migrants/person#first_name> ?v . }
;
DELETE { ?s <http://example.org/migrants/person#family_name> ?v . }
INSERT { ?s schema:familyName ?v . }
WHERE { ?s <http://example.org/migrants/person#family_name> ?v . }
;
DELETE { ?s <http://example.org/migrants/person#birthdate> ?v . }
INSERT { ?s schema:birthDate ?v . }
WHERE { ?s <http://example.org/migrants/person#birthdate> ?v . }
;
DELETE { ?s <http://example.org/migrants/person#deathdate> ?v . }
INSERT { ?s schema:deathDate ?v . }
WHERE { ?s <http://example.org/migrants/person#deathdate> ?v . }
;
DELETE { ?s <http://example.org/migrants/person#gender> <http://example.org/migrants/Gender-female> . }
INSERT { ?s schema:gender schema:Female . }
WHERE { ?s <http://example.org/migrants/person#gender> <http://example.org/migrants/Gender-female> . }
;
DELETE { ?s <http://example.org/migrants/person#gender> <http://example.org/migrants/Gender-male> . }
INSERT { ?s schema:gender schema:Male . }
WHERE { ?s <http://example.org/migrants/person#gender> <http://example.org/migrants/Gender-male> . }
;
DELETE { ?s <http://example.org/migrants/person#ref-IDBirthPlace> ?v . }
INSERT { ?s schema:birthPlace ?v . }
WHERE { ?s <http://example.org/migrants/person#ref-IDBirthPlace> ?v . }
;
DELETE { ?s <http://example.org/migrants/person#ref-IDDeathPlace> ?v . }
INSERT { ?s schema:deathPlace ?v . }
WHERE { ?s <http://example.org/migrants/person#ref-IDDeathPlace> ?v . }
;
DELETE { ?s <http://example.org/migrants/person#imageURL> ?v . }
INSERT { ?s schema:image ?v . }
WHERE { ?s <http://example.org/migrants/person#imageURL> ?v . }
;
DELETE { ?s <http://example.org/migrants/person#profession> ?v . }
INSERT {
?s schema:hasOccupation ?occ .
?occ a schema:Occupation .
?occ schema:name ?name .
}
WHERE {
?s <http://example.org/migrants/person#profession> ?v .
BIND(IRI(CONCAT("http://example.org/migrants/occupation/", ENCODE_FOR_URI(STR(?v)))) AS ?occ)
BIND(STRLANG(STR(?v), "en") AS ?name)
}
;
DELETE { ?s <http://example.org/migrants/person#comment> ?v . }
INSERT { ?s rdfs:comment ?v . }
WHERE { ?s <http://example.org/migrants/person#comment> ?v . }
;
DELETE { ?s <http://example.org/migrants/person#Source> ?v . }
INSERT { ?s schema:citation ?v . }
WHERE { ?s <http://example.org/migrants/person#Source> ?v . }