query-bc9201f433a5856f18904edd97536ef8
...count (Co-)Applicants only, i.e. no Participants
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?stadtLabel (COUNT(DISTINCT(?p)) AS ?numberDistinct) (COUNT(?p) AS ?number) WHERE {
{
SELECT DISTINCT ?bundesland ?stadt ?w ?affiliationType ?p WHERE {
?p wdt:P31 wd:Q98270496 .
?p p:P1416 ?statement .
?statement ps:P1416 ?w .
{?statement pq:P3831 wd:Q54875338} UNION {?statement pq:P3831 wd:Q105906738} # this line modified to exclude participants
OPTIONAL {
?w wdt:P131+ ?stadt .
?stadt wdt:P31/wdt:P279* wd:Q515 .
}
OPTIONAL {
?w wdt:P159/wdt:P131* ?stadt .
?stadt wdt:P31/wdt:P279* wd:Q515 .
}
FILTER NOT EXISTS {?w wdt:P31 wd:Q98270496 } # To not display Konsortia associations to Base4NFDI
}
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en" . }
} GROUP BY ?stadt ?stadtLabel
ORDER BY DESC(?numberDistinct) ASC(?stadtLabel)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?number")
v7("?numberDistinct")
v4("?p"):::projected
v6("?stadt")
v2("?stadtLabel"):::projected
v5("?statement")
v3("?w")
a1((" "))
a2((" "))
a3((" "))
c6(["wd:Q54875338"]):::iri
c13(["bd:serviceParam"]):::iri
c10(["wd:Q515"]):::iri
c7(["wd:Q105906738"]):::iri
c15(["de,en"]):::literal
c2(["wd:Q98270496"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:direct/P31"--> e0c2
e0v1("?w"):::projected
e0c2(["wd:Q98270496"]):::iri
end
f0--EXISTS--> f0e0
f0 --> v3
f0 --> c1
f0 --> c2
v3 --"p:direct/P31"--> c2
v4 --"p:direct/P31"--> c2
v4 --"p:P1416"--> v5
v5 --"p:statement/P1416"--> v3
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v5 --"p:qualifier/P3831"--> c7
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v5 --"p:qualifier/P3831"--> c6
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:direct/P131".-> v6
v6 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c10
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:direct/P159".-> a2
a2 --"p:direct/P131"--> v6
v6 --"p:direct/P31"--> a3
a3 --"p:direct/P279"--> c10
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c13 --"wikibase:language"--> c15
end
bind3[/"count(?p)"/]
v4 --o bind3
bind3 --as--o v7
bind4[/"count(?p)"/]
v4 --o bind4
bind4 --as--o v7