query-a172a2d02ae2a1b119b723a31300d3e0

rq turtle/ttl

get the label of a propertyHow do I get the refTypeLabel to print out the actual textual representation of refType here instead of the URI?

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?refType ?refTypeLabel (COUNT(*) AS ?refTypeCnt) WHERE {
  ?item wdt:P31 wd:Q4164871;
    p:P31 ?inst.
  ?inst ps:P31 wd:Q4164871;
    prov:wasDerivedFrom ?ref.
  ?ref ?refType ?reference.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?refType ?refTypeLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?inst") v1("?item") v3("?ref") v4("?refType"):::projected v6("?refTypeCnt") v5("?reference") c7(["bd:serviceParam"]):::iri c2(["wd:Q4164871"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal v1 --"p:direct/P31"--> c2 v1 --"p:P31"--> v2 v2 --"p:statement/P31"--> c2 v2 --"prov:wasDerivedFrom"--> v3 v3 -->v4--> v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end bind1[/"count(*)"/] bind1 --as--o v6