query-05e81fb546a8b1517da07f66d0f38cf0

rq turtle/ttl

mamífers segons classificació de l'article SELECT DISTINCT ?distincioLabel (COUNT(DISTINCT(?sitelink)) AS ?numArticles) WHERE { ?item wdt:P31 wd:Q16521. ?item wdt:P171* wd:Q7377. ?sitelink schema:isPartOf https://ca.wikipedia.org/; schema:about ?item. OPTIONAL {?sitelink wikibase:badge ?distincio.} # Sitelink is badged SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ca" } . } GROUP BY ?distincioLabel

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# mamífers segons classificació de l'article
SELECT DISTINCT ?distincioLabel (COUNT(DISTINCT(?sitelink)) AS ?numArticles)  WHERE {
  ?item wdt:P31 wd:Q16521.
  ?item wdt:P171* wd:Q7377.
  ?sitelink schema:isPartOf <https://ca.wikipedia.org/>;
     schema:about ?item.
OPTIONAL {?sitelink wikibase:badge ?distincio.} # Sitelink is badged 
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ca" } .
} 
GROUP BY ?distincioLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?distincio") v1("?item") v4("?numArticles") v2("?sitelink"):::projected c4(["wd:Q7377"]):::iri c10(["bd:serviceParam"]):::iri c12(["#91;AUTO_LANGUAGE#93;,ca"]):::literal c2(["wd:Q16521"]):::iri c6([https://ca.wikipedia.org/]):::iri v1 --"wdt:P31"--> c2 v1 --"wdt:P171"--> c4 v2 --"schema:isPartOf"--> c6 v2 --"schema:about"--> v1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wikibase:badge".-> v3 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end bind1[/"count(?sitelink)"/] v2 --o bind1 bind1 --as--o v4