query-d1c874abbd34e51a698e11ca5e9f5128

rq turtle/ttl

For now, this project is aiming to compile information about prisoners of conscience. Goals: Fill missing information (for instance place of detention) for prisoners of conscience who already have a Wikidata item. Define correct usage of properties and qualifiers for prisoners of conscience.The query below displays all prisoners of conscience, together with information about them:

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?placeOfDetentionLabel ?countryOfDetentionLabel ?startDate ?endDate ?image
WHERE 
{
  ?item wdt:P793 wd:Q4667873.
  OPTIONAL{
    ?item wdt:P2632 ?placeOfDetention.
    ?placeOfDetention wdt:P17 ?countryOfDetention.
    OPTIONAL{
      ?item p:P2632 ?startStatement.
      ?startStatement pq:P580 ?startDate.
    }
    OPTIONAL{
      ?item p:P2632 ?endStatement.
      ?endStatement pq:P582 ?endDate.
    }
  }
  OPTIONAL{?item wdt:P18 ?image.}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} 
ORDER BY DESC(?countryOfDetention)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?countryOfDetention") v7("?endDate"):::projected v6("?endStatement") v8("?image"):::projected v2("?item"):::projected v3("?placeOfDetention") v5("?startDate"):::projected v4("?startStatement") c10(["bd:serviceParam"]):::iri c2(["wd:Q4667873"]):::iri c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"p:direct/P793"--> c2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P2632".-> v3 v3 --"p:direct/P17"--> v1 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P2632".-> v4 v4 --"p:qualifier/P580"--> v5 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P2632".-> v6 v6 --"p:qualifier/P582"--> v7 end end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P18".-> v8 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end