query-7c53633b950dd38a26858699ef945886
title:External identifiers used for sculptures SELECT ?id ?idLabel ?statedLabel (COUNT(?value) AS ?count) WITH { SELECT DISTINCT ?item WHERE { ?item wdt:P31/wdt:P279? wd:Q860861. } } AS %subquery WHERE { INCLUDE %subquery . ?id wikibase:propertyType wikibase:ExternalId; wikibase:claim ?p; wikibase:statementProperty ?ps. ?item ?p [ ?ps ?value ] . OPTIONAL {?id wdt:P9073 ?stated}
?id rdfs:label ?idlabel FILTER (lang(?idlabel) = "en").
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } GROUP BY ?id ?idLabel ?statedLabel ORDER BY DESC(?count)
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title:External identifiers used for sculptures
SELECT ?id ?idLabel ?statedLabel (COUNT(?value) AS ?count) WHERE {
{
SELECT DISTINCT ?item WHERE {
?item wdt:P31/wdt:P279? wd:Q860861.
}
}.
?id wikibase:propertyType wikibase:ExternalId; wikibase:claim ?p; wikibase:statementProperty ?ps.
?item ?p [ ?ps ?value ] . OPTIONAL {?id wdt:P9073 ?stated}
# ?id rdfs:label ?idlabel FILTER (lang(?idlabel) = "en").
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
} GROUP BY ?id ?idLabel ?statedLabel
ORDER BY DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?count")
v3("?id"):::projected
v2("?item")
v4("?p")
v5("?ps")
v7("?stated")
v6("?value"):::projected
a1((" "))
a2((" "))
c10(["bd:serviceParam"]):::iri
c2(["wd:Q860861"]):::iri
c5(["wikibase:ExternalId"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,mul,en"]):::literal
v2 --"wdt:P31"--> a1
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
a1 --"wdt:P279"--> c2
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
end
union0r <== or ==> union0l
end
v3 --"wikibase:propertyType"--> c5
v3 --"wikibase:claim"--> v4
v3 --"wikibase:statementProperty"--> v5
a2 -->v5--> v6
v2 -->v4--> a2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P9073".-> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end
bind1[/"count(?value)"/]
v6 --o bind1
bind1 --as--o v8