query-d4e4d4ca4b1c57baa80b49db699660e1
District and other types ]reply[22:40, 12 March 2018 (UTC)) talk (Fralambert format? Also I think that we sould create a complex constraint for the alowed type. What do you think? --(Q20856087)NRHP district : (P2868)subject has role --> (Q19558910)National Register of Historic Places listed place to a (Q20856087)NRHP district , sould we ask a bot to move (P2868)subject has role : Hi, since we agreed to use Ipoellet@]reply[02:56, 10 April 2018 (UTC)) talk (FralambertStatistics by ressource types. Also the districts were moved today.-- ]reply[05:54, 14 March 2018 (UTC)) talk (Ipoellet: I think those are both good ideas, but technologically well out of my depth. I wouldn't know where to start. — Fralambert@ TODO
Use at
- https://query.wikidata.org/sparql
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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?value ?valueLabel (count(?value) as ?count) WHERE
{
# VALUES ?value { "wd:Q47162123" "wd:Q20856087" "wd:Q47162146" "wd:Q47162186" "wd:Q47162172"}
?item wdt:P1435 wd:Q19558910 .
?item p:P1435 ?name .
?name ps:P1435 []; pq:P2868 ?value .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
group by ?value ?valueLabel
Query found at
- https://www.wikidata.org/wiki/Property_talk:P649
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2018/04
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?count")
v1("?item")
v2("?name")
v3("?value"):::projected
a1((" "))
c2(["wd:Q19558910"]):::iri
c7(["bd:serviceParam"]):::iri
c9(["en"]):::literal
v1 --"p:direct/P1435"--> c2
v1 --"p:P1435"--> v2
v2 --"p:statement/P1435"--> a1
v2 --"p:qualifier/P2868"--> v3
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end
bind1[/"count(?value)"/]
v3 --o bind1
bind1 --as--o v4