query-ad54843cd3cb2e74dc4fa0eb513f8ac7
irish women scientists without wikipedia pages, and what their particular occupation is, with the various occupations on one line. SELECT ?item ?itemLabel (group_concat(?occLabel ;separator=", ") as ?occupations)
WHERE { ?item wdt:P27 wd:Q27; wdt:P21 wd:Q6581072 ; wdt:P106/wdt:P279* wd:Q901 . ?item wdt:P106 ?occ
MINUS { ?article schema:about ?item }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?occ rdfs:label ?occLabel . #not sure what this bit actually does
?item rdfs:label ?itemLabel . #i have no idea why these two lines are important but it doesn't work without them.
}
} group by ?item ?itemLabel
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#>
#irish women scientists without wikipedia pages, and what their particular occupation is, with the various occupations on one line.
SELECT ?item ?itemLabel (group_concat(?occLabel ;separator=", ") as ?occupations)
WHERE {
?item wdt:P27 wd:Q27;
wdt:P21 wd:Q6581072 ;
wdt:P106/wdt:P279* wd:Q901 .
?item wdt:P106 ?occ
MINUS { ?article schema:about ?item }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?occ rdfs:label ?occLabel . #not sure what this bit actually does
?item rdfs:label ?itemLabel . #i have no idea why these two lines are important but it doesn't work without them.
}
}
group by ?item ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?article")
v1("?item"):::projected
v5("?itemLabel"):::projected
v2("?occ")
v4("?occLabel"):::projected
v6("?occupations")
a1((" "))
c4(["wd:Q6581072"]):::iri
c2(["wd:Q27"]):::iri
c10(["bd:serviceParam"]):::iri
c7(["wd:Q901"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v1 --"wdt:P27"--> c2
v1 --"wdt:P21"--> c4
v1 --"wdt:P106"--> a1
a1 --"wdt:P279"--> c7
v1 --"wdt:P106"--> v2
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v3 --"schema:about"--> v1
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
v2 --"rdfs:label"--> v4
v1 --"rdfs:label"--> v5
end
bind2[/"?occLabel"/]
v4 --o bind2
bind2 --as--o v6