query-565ee55efe79509bc30f5fb5d52bafd7

rq turtle/ttl

...all properties of type Wikidata property to identify substances (Q19833835) that are used by chemical elements or chemical compounds! elements only, to prevent timeout

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 ?prop ?propLabel (COUNT(?prop) AS ?number)
WHERE {
   # recommended to display the property's label
  ?prop wikibase:directClaim ?p .    # needed to display the property's label
  # {?instance wdt:P31 wd:Q11344} UNION {?instance wdt:P31 wd:Q11173}  
  ?instance wdt:P31 wd:Q11344 . 
  ?instance ?p ?o .
  ?prop wdt:P31 wd:Q19833835 .
  SERVICE wikibase:label {bd:serviceParam wikibase:language "en,de"}
} GROUP BY ?prop ?propLabel 
ORDER BY DESC(?number)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?instance") v6("?number") v5("?o") v3("?p") v2("?prop"):::projected c6(["bd:serviceParam"]):::iri c4(["wd:Q19833835"]):::iri c8(["en,de"]):::literal c3(["wd:Q11344"]):::iri v2 --"wikibase:directClaim"--> v3 v4 --"wdt:P31"--> c3 v4 -->v3--> v5 v2 --"wdt:P31"--> c4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end bind1[/"count(?prop)"/] v2 --o bind1 bind1 --as--o v6