query-40c0c2a86caed1cef00b6b940679d637

rq turtle/ttl

Items with multiple values for a given property

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 ?school ?schoolLabel (COUNT(?isni) AS ?isniC) {
  {
    SELECT DISTINCT ?school ?isni {
      ?school wdt:P31/wdt:P279* wd:Q3914 .
      ?school wdt:P213 ?isni .
      ?school wdt:P17 wd:Q30 .
    }
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
GROUP BY ?school ?schoolLabel
HAVING (COUNT(?isni) > 1)
ORDER BY ?schoolLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?_anon_d00291b7e9a143df8ec0be8c8ebd714c79827") v3("?isni"):::projected v5("?isniC") v2("?school"):::projected v1("?schoolLabel"):::projected a2((" ")) a1((" ")) c9(["bd:serviceParam"]):::iri c4(["wd:Q3914"]):::iri c7(["wd:Q30"]):::iri c11(["en"]):::literal f0[[" > '1^^xsd:integer'"]] f0 --> a1 v2 --"wdt:P31"--> a2 a2 --"wdt:P279"--> c4 v2 --"wdt:P213"--> v3 v2 --"wdt:P17"--> c7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end bind3[/"count(?isni)"/] v3 --o bind3 bind3 --as--o v4 bind4[/"count(?isni)"/] v3 --o bind4 bind4 --as--o v5