query-e8f1d1b7228017cf1bfb000a8e2d8f35

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?P31 ?P31Label ?count where
{
  {
  SELECT ?item ?P31 (count(?other) as ?count) 
  WHERE 
  {
    {?item wdt:P31 wd:Q202444 . } 
    UNION
    {?item wdt:P31 wd:Q12308941 . }
    UNION
    {?item wdt:P31 wd:Q11879590 . }
    ?other wdt:P735 ?item.
    ?item wdt:P31 ?P31 .
  } group by ?item ?P31 having (?count=1) 
 }
 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } 
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?P31"):::projected v5("?count"):::projected v2("?item"):::projected v3("?other") c4(["wd:Q12308941"]):::iri c8(["bd:serviceParam"]):::iri c5(["wd:Q11879590"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal c3(["wd:Q202444"]):::iri f0[["?count = '1^^xsd:integer'"]] f0 --> v5 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c5 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c4 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c3 end union0r <== or ==> union0l end v3 --"wdt:P735"--> v2 v2 --"wdt:P31"--> v4 bind2[/"count(?other)"/] v3 --o bind2 bind2 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end