query-41bf5c84616771bf59da04fd79b7e62a
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 distinct ?item ?itemLabel ?linkcount (group_concat(distinct ?occupationL;separator="; ") as ?occupationLabel) (group_concat(distinct ?fieldL;separator="; ") as ?fieldLabel) WHERE
{
{?item wdt:P106/wdt:P279* wd:Q331432.}
UNION
{?item wdt:P101/wdt:P279* wd:Q331432.}
OPTIONAL {?item wdt:P106 ?occupation.}
OPTIONAL {?item wdt:P101 ?field.}
FILTER NOT EXISTS {?sitelink ^schema:name ?article .
?article schema:about ?item ;
schema:isPartOf <https://fr.wikipedia.org/> .}
?item wikibase:sitelinks ?linkcount .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?item rdfs:label ?itemLabel .
?occupation rdfs:label ?occupationL .
?field rdfs:label ?fieldL .}
} group by ?item ?itemLabel ?sitelink ?article ?linkcount order by desc(?linkcount)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?article")
v6("?field")
v9("?fieldL"):::projected
v11("?fieldLabel")
v4("?item"):::projected
v7("?itemLabel"):::projected
v1("?linkcount"):::projected
v5("?occupation")
v8("?occupationL"):::projected
v10("?occupationLabel")
v3("?sitelink")
a1((" "))
a2((" "))
c4([https://fr.wikipedia.org/]):::iri
c7(["wd:Q331432"]):::iri
c11(["bd:serviceParam"]):::iri
c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"schema:name"--> e0v2
e0v1 --"schema:about"--> e0v3
e0v1 --"schema:isPartOf"--> e0c4
e0v1("?article"):::projected
e0v3("?item"):::projected
e0v2("?sitelink"):::projected
e0c4([https://fr.wikipedia.org/]):::iri
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> c1
f0 --> v3
f0 --> c2
f0 --> v4
f0 --> c3
f0 --> c4
v2 --"schema:name"--> v3
v2 --"schema:about"--> v4
v2 --"schema:isPartOf"--> c4
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v4 --"wdt:P101"--> a2
a2 --"wdt:P279"--> c7
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v4 --"wdt:P106"--> a1
a1 --"wdt:P279"--> c7
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P106".-> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P101".-> v6
end
v4 --"wikibase:sitelinks"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
v4 --"rdfs:label"--> v7
v5 --"rdfs:label"--> v8
v6 --"rdfs:label"--> v9
end
bind3[/"?occupationL"/]
v8 --o bind3
bind3 --as--o v10
bind4[/"?fieldL"/]
v9 --o bind4
bind4 --as--o v11