query-a7cd6f0dca9317b3ce844bcd8b72fd38
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel (SAMPLE(?p19label) AS ?birthplace)
(GROUP_CONCAT(?p106label;SEPARATOR=', ') AS ?occupations)
(?fame AS ?wikipedialinks)
WHERE
{
{
SELECT ?item (COUNT(?wikipedialink) AS ?fame)
WHERE
{
{
SELECT ?item
WHERE
{
?item wdt:P31 wd:Q5 .
?item wdt:P27 wd:Q30 .
?item wikibase:sitelinks ?fame1 . FILTER(?fame1 > 55)
}
} ?wikipedialink schema:isPartOf [ wikibase:wikiGroup "wikipedia" ]; schema:about ?item .
}
GROUP BY ?item
HAVING (?fame > 55)
} ?item wdt:P106 ?p106 . ?p106 rdfs:label ?p106label . FILTER(LANG(?p106label)='en')
?item wdt:P19 ?p19 . ?p19 rdfs:label ?p19label . FILTER(LANG(?p19label)='en')
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?item ?itemLabel ?fame
ORDER BY DESC(?wikipedialinks) ?itemLabel
LIMIT 1000
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v11("?birthplace")
v9("?fame"):::projected
v6("?fame1")
v7("?item"):::projected
v2("?itemLabel"):::projected
v12("?occupations")
v9("?p106")
v4("?p106label"):::projected
v10("?p19")
v3("?p19label"):::projected
v8("?wikipedialink")
v13("?wikipedialinks")
a1((" "))
c6(["wd:Q30"]):::iri
c16(["bd:serviceParam"]):::iri
c4(["wd:Q5"]):::iri
c18(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c9(["wikipedia"]):::literal
f0[["?p19label = 'en'"]]
f0 --> v3
f1[["?p106label = 'en'"]]
f1 --> v4
f2[["?fame > '55^^xsd:integer'"]]
f2 --> v9
f3[["?fame1 > '55^^xsd:integer'"]]
f3 --> v6
v7 --"wdt:P31"--> c4
v7 --"wdt:P27"--> c6
v7 --"wikibase:sitelinks"--> v6
a1 --"wikibase:wikiGroup"--> c9
v8 --"schema:isPartOf"--> a1
v8 --"schema:about"--> v7
bind5[/"count(?wikipedialink)"/]
v8 --o bind5
bind5 --as--o v9
v7 --"wdt:P106"--> v9
v9 --"rdfs:label"--> v4
v7 --"wdt:P19"--> v10
v10 --"rdfs:label"--> v3
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c16 --"wikibase:language"--> c18
end
bind8[/"sample(?p19label)"/]
v3 --o bind8
bind8 --as--o v11
bind9[/"?p106label"/]
v4 --o bind9
bind9 --as--o v12
bind10[/"?fame"/]
v9 --o bind10
bind10 --as--o v13