Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
aruskin opened this issue Feb 25, 2022 · 0 comments
Open

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

aruskin opened this issue Feb 25, 2022 · 0 comments

Comments

@aruskin
Copy link

aruskin commented Feb 25, 2022

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";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant