586
edits
Line 2,487: | Line 2,487: | ||
} | } | ||
ORDER BY ?proposerLabel | ORDER BY ?proposerLabel | ||
</sparql> | |||
==== Male proposers who have occupations data in Wikidata==== | |||
<sparql tryit="1"> | |||
#title:Men who proposed for SAL/RAI elections who have occupation(s) in wikidata | |||
# with occupation labels, which was slightly trickier than expected | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | |||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | |||
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/> | |||
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | |||
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/> | |||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | |||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | |||
SELECT distinct ?personLabel ?proposerLabel | |||
(group_concat(distinct ?wd_label; SEPARATOR="; ") as ?proposer_occupations) | |||
?wikidata ?person ?proposer | |||
WHERE { | |||
?person (bnp:P16 | bnp:P7) ?s . # proposed to either SAL or RAI | |||
?s (bnps:P16 | bnps:P7) ?proposer . | |||
?proposer bnwdt:P3 bnwd:Q10 . | |||
?proposer bnwdt:P117 ?wikidata_ID . #get wikidata ID | |||
bind(iri(concat("http://www.wikidata.org/entity/", str(?wikidata_ID))) as ?wikidata) . | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
?wikidata wdt:P106 ?wd_occupation . | |||
# automatic *Label doesn't work with a federated query; this works instead. | |||
SERVICE wikibase:label { | |||
bd:serviceParam wikibase:language "en". | |||
?wd_occupation rdfs:label ?wd_label. | |||
} | |||
} #/ wikidata service | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en, en-gb". } | |||
} | |||
group by ?personLabel ?proposerLabel ?wikidata ?person ?proposer | |||
ORDER BY ?proposerLabel ?person | |||
</sparql> | </sparql> | ||
edits