query-19056254e04904f442d2fdc06dd1c355

rq turtle/ttl

title: Justice that cites reports by commissions they self took part in SELECT ?Justice ?Case ?Rapporteur ?SOU ?Report ?Commission ?Role WHERE { ?justice wdt:P39 wd:Q96336792. ?commission p:P710 [ ps:P710 ?justice; pq:P3831 ?role ]; wdt:P800 ?report. ?report wdt:P1031 ?SOU. ?case wdt:P1594 ?justice; wdt:P2860 ?report. OPTIONAL { ?case p:P1594 ?statement. ?statement ps:P1594 ?justice; pq:P3831 wd:Q96971913. } BIND ( IF ( BOUND (?statement) , 'yes', 'no' ) AS ?Rapporteur ) SERVICE wikibase:label { bd:serviceParam wikibase:language "en,sv". ?justice rdfs:label ?Justice. ?case rdfs:label ?Case. ?role rdfs:label ?Role. ?commission rdfs:label ?Commission. ?report rdfs:label ?Report. } } ORDER BY ?justice ?report

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
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#>
#title: Justice that cites reports by commissions they self took part in
SELECT ?Justice ?Case ?Rapporteur ?SOU ?Report ?Commission ?Role WHERE {
  ?justice wdt:P39 wd:Q96336792.
  ?commission p:P710 [ ps:P710 ?justice; pq:P3831 ?role ];
             wdt:P800 ?report.
  ?report wdt:P1031 ?SOU.
  ?case wdt:P1594 ?justice;
       wdt:P2860 ?report.
  OPTIONAL {
    ?case p:P1594 ?statement.
    ?statement ps:P1594 ?justice; pq:P3831 wd:Q96971913.
  }
  BIND ( IF ( BOUND (?statement) , 'yes', 'no' ) AS ?Rapporteur )
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en,sv".
    ?justice rdfs:label ?Justice.
    ?case rdfs:label ?Case.
    ?role rdfs:label ?Role.
    ?commission rdfs:label ?Commission.
    ?report rdfs:label ?Report.
  }
}
ORDER BY ?justice ?report

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v10("?Case"):::projected v12("?Commission"):::projected v9("?Justice"):::projected v8("?Rapporteur"):::projected v13("?Report"):::projected v11("?Role"):::projected v5("?SOU"):::projected v6("?case") v4("?commission") v1("?justice") v2("?report") v3("?role") v7("?statement") a1((" ")) c2(["wd:Q96336792"]):::iri c12(["wd:Q96971913"]):::iri c16(["en,sv"]):::literal c14(["bd:serviceParam"]):::iri v1 --"p:direct/P39"--> c2 a1 --"p:statement/P710"--> v1 a1 --"p:qualifier/P3831"--> v3 v4 --"p:P710"--> a1 v4 --"p:direct/P800"--> v2 v2 --"p:direct/P1031"--> v5 v6 --"p:direct/P1594"--> v1 v6 --"p:direct/P2860"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:P1594".-> v7 v7 --"p:statement/P1594"--> v1 v7 --"p:qualifier/P3831"--> c12 end bind0[/"if(bound(?statement),'yes','no')"/] v7 --o bind0 bind0 --as--o v8 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 v1 --"rdfs:label"--> v9 v6 --"rdfs:label"--> v10 v3 --"rdfs:label"--> v11 v4 --"rdfs:label"--> v12 v2 --"rdfs:label"--> v13 end