query-958ef6097126b74341c27b4e3b71725b

rq turtle/ttl

... both combined in one Bubblechart (doesn't work yet) FDM-assoziiert und FDM-Kontaktstellen

Use at

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#>
#defaultView:BubbleChart
SELECT DISTINCT ?w ?wLabel ?students ?rgb {  
  ?w wdt:P31/wdt:P279* wd:Q38723 .      # nur Hochschulen
  # ?w wdt:P31/wdt:P279* wd:Q1365560 .      # HAWs only
  # ?w wdt:P31/wdt:P279* wd:Q3918 .      # Unis only
  ?w wdt:P17 wd:Q183 .
  OPTIONAL {
    ?p wdt:P101 wd:Q30089794 .
    ?p wdt:P31 wd:Q679206 .
    ?p wdt:P361 ?w . 
    BIND(TRUE AS ?kontaktstelle)
  }
  OPTIONAL {?w wdt:P2196 ?students .} # Lernende
  # OPTIONAL {?w wdt:P1128 ?students .}  # Mitarbeiter
  OPTIONAL { ?w wdt:P463 wd:Q105757481 .
   BIND("Vereinsmitglied" AS ?affiliationTypeLabel)
   BIND(TRUE AS ?NFDIassociated)
  }
  OPTIONAL {
    ?p wdt:P31 wd:Q98270496 .
    ?p p:P1416 ?statement .
    ?statement ps:P1416 ?w .
    OPTIONAL { ?statement pq:P3831 ?affiliationType .}   
    BIND(TRUE AS ?NFDIassociated)
  } 
  #BIND(IF(Bound(?NFDIassociated), "0abaf0", "666666") AS ?rgb)  # NFDI: blau
  #BIND(IF(Bound(?kontaktstelle), "a3c717", "666666") AS ?rgb)  # Kontaktstelle: grĂ¼n
  BIND(IF(Bound(?NFDIassociated), IF(Bound(?kontaktstelle), "a3c717", "0abaf0"), IF(Bound(?kontaktstelle), "a3c717", "666666")) AS ?rgb)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de" }
} ORDER BY DESC(?students) ASC(?wLabel)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v10("?NFDIassociated") v9("?affiliationType") v6("?affiliationTypeLabel") v5("?kontaktstelle") v4("?p") v10("?rgb"):::projected v8("?statement") v1("?students"):::projected v3("?w"):::projected v2("?wLabel"):::projected a1((" ")) c12(["wd:Q105757481"]):::iri c8(["wd:Q679206"]):::iri c18(["bd:serviceParam"]):::iri c7(["wd:Q30089794"]):::iri c5(["wd:Q183"]):::iri c20(["#91;AUTO_LANGUAGE#93;,en,de"]):::literal c3(["wd:Q38723"]):::iri c13(["wd:Q98270496"]):::iri v3 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> c3 v3 --"p:direct/P17"--> c5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P101".-> c7 v4 --"p:direct/P31"--> c8 v4 --"p:direct/P361"--> v3 bind0[/"'true^^xsd:boolean'"/] bind0 --as--o v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P2196".-> v1 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P463".-> c12 bind1[/"'Vereinsmitglied'"/] bind1 --as--o v6 bind2[/"'true^^xsd:boolean'"/] bind2 --as--o v10 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P31".-> c13 v4 --"p:P1416"--> v8 v8 --"p:statement/P1416"--> v3 subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v8 -."p:qualifier/P3831".-> v9 end bind3[/"'true^^xsd:boolean'"/] bind3 --as--o v10 end bind4[/"if(bound(?NFDIassociated),if(bound(?kontaktstelle),'a3c717','0abaf0'),if(bound(?kontaktstelle),'a3c717','666666'))"/] v10 --o bind4 v5 --o bind4 bind4 --as--o v10 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c18 --"wikibase:language"--> c20 end