Skip to content

Only one citizenship value pulled in to author page from Wikidata #1779

@aruskin

Description

@aruskin

When a person has multiple values for country of citizenship, only one is getting pulled in to the author page (unlike how educated at is handled). For example, Masha Gessen's author page displays "Citizenship: Soviet Union", while their Wikidata item has values Soviet Union, Russia, and United States of America for country of citizenship.

var sparqlQuery = "SELECT ?entity ?image ?citizenship ?label ?description (group_concat(DISTINCT ?educated_at; separator = \", \") as ?education) (group_concat(DISTINCT ?pseudos; separator = \", \") as ?pseudonyms) "
+ " WHERE { ?entity wdt:P244 '" + localname + "' . ?entity rdfs:label ?label . FILTER (langMatches( lang(?label), \"EN\" ) ) "
+ " OPTIONAL {?entity wdt:P18 ?image . ?entity wdt:P27 ?citizenshipRoot . ?citizenshipRoot rdfs:label ?citizenship . FILTER (langMatches( lang(?citizenship), \"EN\" ) ) }"
+ " OPTIONAL {?entity wdt:P69 ?educationRoot . ?educationRoot rdfs:label ?educated_at . FILTER (langMatches( lang(?educated_at), \"EN\" ) ) }"
+ " OPTIONAL {?entity wdt:P69 ?educationRoot . ?educationRoot rdfs:label ?educated_at . FILTER (langMatches( lang(?educated_at), \"EN\" ) ) }"
+ " OPTIONAL {?entity wdt:P742 ?pseudos . }"
+ " OPTIONAL {?entity schema:description ?description . FILTER(lang(?description) = \"en\")}"
+ " } GROUP BY ?entity ?image ?citizenship ?label?description LIMIT 1";

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions