query-cf34f0cbd3991fee4f42201587ca235a
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 ?sitelink ?article (group_concat(distinct ?occupationL;separator="; ") as ?occupationLabel) (group_concat(distinct ?fieldL;separator="; ") as ?fieldLabel) WHERE
{
# ?item wdt:P106 wd:Q5716684.
{?item wdt:P106 wd:Q331432.}
UNION
{?item wdt:P101 wd:Q331432.}
OPTIONAL {?item wdt:P106 ?occupation.}
OPTIONAL {?item wdt:P101 ?field.}
?sitelink ^schema:name ?article .
?article schema:about ?item ;
schema:isPartOf <https://fr.wikipedia.org/> .
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
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?article"):::projected
v3("?field")
v8("?fieldL"):::projected
v10("?fieldLabel")
v1("?item"):::projected
v6("?itemLabel"):::projected
v2("?occupation")
v7("?occupationL"):::projected
v9("?occupationLabel")
v5("?sitelink"):::projected
c2(["wd:Q331432"]):::iri
c9(["bd:serviceParam"]):::iri
c7([https://fr.wikipedia.org/]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P101"--> c2
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P106"--> c2
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P106".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P101".-> v3
end
v4 --"schema:name"--> v5
v4 --"schema:about"--> v1
v4 --"schema:isPartOf"--> c7
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
v1 --"rdfs:label"--> v6
v2 --"rdfs:label"--> v7
v3 --"rdfs:label"--> v8
end
bind2[/"?occupationL"/]
v7 --o bind2
bind2 --as--o v9
bind3[/"?fieldL"/]
v8 --o bind3
bind3 --as--o v10