I wanted to explore to enrich the map popups with details from wikidata to offer more details of the woman right in the map.
I've crafted a SPARQL query that takes as a single parameter the name of the woman as in the Wikipedia title and returns some details: Name and gender, description in Spanish, birth and death dates, occupations*, and picture.
* it's a pity that in Spanish they come back in male variation, I need to investigate if wikidata offers them somehow in female version as in actriz instead of actor.
This query could be run when the user clicks on a street to fetch all these details using the Wikidata SPARQL endpoint and JSON format and render them appropriately.
Would this be something worth trying? Happy to discuss approaches and possibilities.
cc @jessisena @seleneyang
SPARQL query
SELECT
?id
(?idLabel AS ?name)
(?desc as ?description)
(?genderLabel AS ?gender)
(SAMPLE(?births) AS ?birth)
(SAMPLE(?deaths) AS ?death)
(SAMPLE(?pic) AS ?picture)
(GROUP_CONCAT(DISTINCT ?occupationsLabel; SEPARATOR = ", ") AS ?occupations)
WHERE {
VALUES ?wikiTitle {
"Ada Lovelace"@es
}
?wiki schema:about ?id;
schema:isPartOf <https://es.wikipedia.org/>;
schema:name ?wikiTitle.
OPTIONAL { ?id wdt:P21 ?gender. }
OPTIONAL { ?id wdt:P569 ?births. }
OPTIONAL { ?id wdt:P570 ?deaths. }
OPTIONAL { ?id wdt:P106 ?occupations. }
OPTIONAL { ?id wdt:P18 ?pic }.
OPTIONAL { ?id schema:description ?desc }.
FILTER (LANG(?desc) = "es")
SERVICE wikibase:label {
bd:serviceParam wikibase:language "es".
?id rdfs:label ?idLabel.
?gender rdfs:label ?genderLabel.
?occupations rdfs:label ?occupationsLabel.
}
}
GROUP BY ?id ?idLabel ?desc ?genderLabel ?wiki
I wanted to explore to enrich the map popups with details from wikidata to offer more details of the woman right in the map.
I've crafted a SPARQL query that takes as a single parameter the name of the woman as in the Wikipedia title and returns some details: Name and gender, description in Spanish, birth and death dates, occupations*, and picture.
* it's a pity that in Spanish they come back in male variation, I need to investigate if wikidata offers them somehow in female version as in
actrizinstead ofactor.This query could be run when the user clicks on a street to fetch all these details using the Wikidata SPARQL endpoint and JSON format and render them appropriately.
Would this be something worth trying? Happy to discuss approaches and possibilities.
cc @jessisena @seleneyang
SPARQL query