query-d2130249156b1cfbd92c7d1e1106ef7e

rq turtle/ttl

Propertiesinstance of (P31)

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 DISTINCT ?topicLabel ?prop ?propLabel (COUNT(DISTINCT ?item) AS ?itemCount) (SAMPLE(?item) AS ?example) ?typeLabel 
WHERE {
  VALUES ?topic {
    wd:Q12727779 # ethics of artificial intelligence
    wd:Q96482266 # regulation of artificial intelligence
  }
  ?item ?wdt ?topic;
    wdt:P31 ?type.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?prop wikibase:directClaim ?wdt.

}
GROUP BY ?prop ?propLabel ?typeLabel ?topicLabel
ORDER BY ?topicLabel (?propLabel) DESC (?itemCount)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v9("?example") v5("?item"):::projected v9("?itemCount") v8("?prop"):::projected v2("?propLabel"):::projected v4("?topic") v1("?topicLabel"):::projected v7("?type") v6("?wdt") c3(["bd:serviceParam"]):::iri c5(["#91;AUTO_LANGUAGE#93;,en"]):::literal bind0[/VALUES ?topic/] bind0-->v4 bind00(["wd:Q12727779"]) bind00 --> bind0 bind01(["wd:Q96482266"]) bind01 --> bind0 v5 -->v6--> v4 v5 --"wdt:P31"--> v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c3 --"wikibase:language"--> c5 end v8 --"wikibase:directClaim"--> v6 bind3[/"count(?item)"/] v5 --o bind3 bind3 --as--o v9 bind4[/"sample(?item)"/] v5 --o bind4 bind4 --as--o v9