query-1a3e3a74adf3b8b9ab50529fbd8570d9

rq turtle/ttl

...applicants only

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#>
SELECT DISTINCT ?w ?wLabel ?affiliationType ?affiliationTypeLabel ?p ?pLabel 
WHERE 
{
    {
     ?w wdt:P463 wd:XXXQ105757481 .
  } UNION {
    ?p wdt:P31 wd:Q98270496 .
    ?p p:P1416 ?statement .
    ?statement ps:P1416 ?w .
    OPTIONAL { ?statement pq:P3831 ?affiliationType .}  
    ?statement pq:P3831 wd:Q54875338 .
  }
  BIND(IF(! Bound(?affiliationType), "Vereinsmitglied", ?affiliationTypeLabel) AS ?affiliationTypeLabel)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en" . }
} ORDER BY ASC(?wLabel)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?affiliationType"):::projected v6("?affiliationTypeLabel"):::projected v3("?p"):::projected v4("?statement") v2("?w"):::projected v1("?wLabel"):::projected c2(["wd:XXXQ105757481"]):::iri c8(["wd:Q54875338"]):::iri c10(["bd:serviceParam"]):::iri c12(["de,en"]):::literal c4(["wd:Q98270496"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v3 --"p:direct/P31"--> c4 v3 --"p:P1416"--> v4 v4 --"p:statement/P1416"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:qualifier/P3831".-> v5 end v4 --"p:qualifier/P3831"--> c8 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P463"--> c2 end union0r <== or ==> union0l end bind0[/"if(not bound(?affiliationType),'Vereinsmitglied',?affiliationTypeLabel)"/] v5 --o bind0 v6 --o bind0 bind0 --as--o v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end