query-8733e20c8f0d74138dafba5fa26c068c

rq turtle/ttl

SPARQL query

Use at

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/>
SELECT DISTINCT ?wikidata ?wikidata_area ?wikidata_group WHERE { 
    ?wikidata p:P39 ?mem .
    ?mem ps:P39 wd:Q654291 ; pq:P2937 wd:Q28976095 . 
    OPTIONAL { ?mem pq:P580  ?start }
    FILTER NOT EXISTS { ?mem pq:P582  ?end }
    OPTIONAL { ?mem pq:P768  ?wikidata_area }
    OPTIONAL { ?mem pq:P4100 ?wikidata_group }
  }

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?end") v1("?mem") v4("?start") v3("?wikidata"):::projected v5("?wikidata_area"):::projected v6("?wikidata_group"):::projected c4(["wd:Q654291"]):::iri c6(["wd:Q28976095"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"p:qualifier/P582"--> e0v2 e0v2("?end"):::projected e0v1("?mem"):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> v2 v1 --"p:qualifier/P582"--> v2 v3 --"p:P39"--> v1 v1 --"p:statement/P39"--> c4 v1 --"p:qualifier/P2937"--> c6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:qualifier/P580".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:qualifier/P768".-> v5 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:qualifier/P4100".-> v6 end