query-72d9684d0547bbcee6f2f673776b4b0f

rq turtle/ttl

Propertiesproperty constraint (P2302)property (P2306)mapping relation type (P4390)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?propLabel ?mappingRelationType ?mappingRelationTypeLabel (COUNT(?p) AS ?numOccurs)
WHERE {
  ?prop wikibase:propertyType wikibase:ExternalId ;
        p:P2302 [
          ps:P2302 wd:Q21510851;
          pq:P2306 wd:P4390
        ] ;
        wikibase:claim ?p .
  ?item ?p [
    pq:P4390 ?mappingRelationType 
  ]
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?propLabel ?mappingRelationType ?mappingRelationTypeLabel
ORDER BY DESC(?numOccurs)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?item") v4("?mappingRelationType"):::projected v6("?numOccurs") v3("?p"):::projected v2("?prop") a1((" ")) a2((" ")) c6(["wd:P4390"]):::iri c2(["wikibase:ExternalId"]):::iri c4(["wd:Q21510851"]):::iri c11(["bd:serviceParam"]):::iri c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"wikibase:propertyType"--> c2 a1 --"p:statement/P2302"--> c4 a1 --"p:qualifier/P2306"--> c6 v2 --"p:P2302"--> a1 v2 --"wikibase:claim"--> v3 a2 --"p:qualifier/P4390"--> v4 v5 -->v3--> a2 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end bind1[/"count(?p)"/] v3 --o bind1 bind1 --as--o v6