query-a73c40bc1f6aa9b7d04bfb61f354da74

rq turtle/ttl

title:items that are both a manga series and an anime tv series SELECT ?item ?itemLabel ?mediumLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

{ SELECT ?item (COUNT(?medium) AS ?count) WHERE { VALUES ?medium {wd:Q21198342 wd:Q63952888 wd:Q220898 wd:Q20650540 wd:Q7889} ?item wdt:P31 ?medium. } GROUP BY ?item HAVING (?count > 1 ) }

VALUES ?medium {wd:Q21198342 wd:Q63952888 wd:Q220898 wd:Q20650540 wd:Q7889} ?item wdt:P31 ?medium. } ORDER BY (?item)

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#>
#title:items that are both a manga series and an anime tv series
SELECT ?item ?itemLabel ?mediumLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

  {
    SELECT ?item (COUNT(?medium) AS ?count) WHERE {
      VALUES ?medium {wd:Q21198342 wd:Q63952888 wd:Q220898 wd:Q20650540 wd:Q7889}
      ?item wdt:P31 ?medium.
    }
    GROUP BY ?item
    HAVING (?count > 1 )
  }

  VALUES ?medium {wd:Q21198342 wd:Q63952888 wd:Q220898 wd:Q20650540 wd:Q7889}
  ?item wdt:P31 ?medium.
}
ORDER BY (?item)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?count") v1("?item"):::projected v4("?medium") c2(["bd:serviceParam"]):::iri c4(["#91;AUTO_LANGUAGE#93;,en"]):::literal subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end f0[["?count > '1^^xsd:integer'"]] f0 --> v4 bind1[/VALUES ?medium/] bind1-->v4 bind10(["wd:Q21198342"]) bind10 --> bind1 bind11(["wd:Q63952888"]) bind11 --> bind1 bind12(["wd:Q220898"]) bind12 --> bind1 bind13(["wd:Q20650540"]) bind13 --> bind1 bind14(["wd:Q7889"]) bind14 --> bind1 v1 --"wdt:P31"--> v4 bind3[/"count(?medium)"/] v4 --o bind3 bind3 --as--o v4 bind4[/VALUES ?medium/] bind4-->v4 bind40(["wd:Q21198342"]) bind40 --> bind4 bind41(["wd:Q63952888"]) bind41 --> bind4 bind42(["wd:Q220898"]) bind42 --> bind4 bind43(["wd:Q20650540"]) bind43 --> bind4 bind44(["wd:Q7889"]) bind44 --> bind4 v1 --"wdt:P31"--> v4