User:Jneubert/SWIB queries - Wikidata User:Jneubert/SWIB queries From Wikidata < User:Jneubert Jump to navigation Jump to search SWIB20 institution map[edit] Federated query, using a custom set of instition items with the number of SWIB20 participants from these institutions. The following query uses these: Properties: image (P18)   , logo image (P154)   , coordinate location (P625)   , headquarters location (P159)   , located in the administrative territorial entity (P131)   , country (P17)    Features: Map (Q24515275)    1#defaultView:Map 2# 3# SWIB20 participants' institutions, mapped to Wikidata and enriched from there 4# 5PREFIX zbwext: 6# 7# from possibly multi-valued fields, use an arbitrary value 8select distinct ?item ?itemLabel (sample(?logo1) as ?logo) (sample(?img) as ?image) (sample(?pos) as ?coord) ?participants 9where { 10 # institutions' items and count of participants from custom WDQS-enabled endpoint 11 service { 12 ?item zbwext:swib20participants ?count . 13 bind(concat(str(?count), ' participant', if(?count > 1, 's', '')) as ?participants) 14 } 15 optional { ?item wdt:P18 ?img . } 16 optional { ?item wdt:P154 ?logo1 . } 17 optional { ?item wdt:P625 ?pos1 . } 18 optional { ?item wdt:P159/wdt:P625 ?pos2 . } 19 optional { ?item wdt:P131/wdt:P625 ?pos3 . } 20 optional { ?item wdt:P17/wdt:P625 ?pos4 . } 21 # use the most precise position 22 bind(coalesce(?pos1, ?pos2, ?pos3, ?pos4) as ?pos) 23 SERVICE wikibase:label { bd:serviceParam wikibase:language "en,[AUTO_LANGUAGE],de,fr,es". } 24} 25group by ?item ?itemLabel ?participants Try it! Static version of the query - all information explicitly put into a "values" clause, does not need a custom SPARQL endpoint Institutions with most participants at SWIB20[edit] Federated query, using a custom set of instition items with the number of SWIB20 participants from these institutions. # SWIB20 participants aggregated by institution # PREFIX zbwext: # select ?item ?itemLabel ?count where { # institutions' items and count of participants from custom WDQS-enabled endpoint service { ?item zbwext:swib20participants ?count. bind(concat(str(?count), ' participant', if(?count > 1, 's', '')) as ?participants) } SERVICE wikibase:label { bd:serviceParam wikibase:language "en,[AUTO_LANGUAGE],de,fr,es". } } order by desc(?count) Try it! Retrieved from "https://www.wikidata.org/w/index.php?title=User:Jneubert/SWIB_queries&oldid=1313299700" Navigation menu Personal tools English Not logged in Talk Contributions Create account Log in Namespaces User page Discussion Variants Views Read Edit View history More Search Navigation Main page Community portal Project chat Create a new Item Recent changes Random Item Query Service Nearby Help Donate Lexicographical data Create a new Lexeme Recent changes Random Lexeme Tools What links here Related changes User contributions Logs View user groups Special pages Permanent link Page information Print/export Create a book Download as PDF Printable version This page was last edited on 26 November 2020, at 07:55. All structured data from the main, Property, Lexeme, and EntitySchema namespaces is available under the Creative Commons CC0 License; text in the other namespaces is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Privacy policy About Wikidata Disclaimers Mobile view Data access Developers Statistics Cookie statement