query-bea810210e2198fc7d551b17b567abf7
VIM3
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
select
?clause
(group_concat(distinct ?namedAs; separator = "; ") as ?officialLabels)
(sample(?item) as ?item)
(sample(?label) as ?label)
(sample(?desc) as ?desc)
(sample(?iev) as ?iev)
(count(distinct ?wp) as ?wpCount)
where {
?item p:P1343 [
ps:P1343 wd:Q70257574 ;
pq:P958 ?clause ;
pq:P1810 ?namedAs ;
] .
optional { ?item rdfs:label ?label . filter (lang(?label) = "en") }
optional { ?item schema:description ?desc . filter (lang(?desc) = "en") }
optional { ?item wdt:P8855 ?iev }
optional {
?wp schema:about ?item ;
schema:isPartOf / wikibase:wikiGroup "wikipedia" .
}
}
group by ?clause
order by (100 * xsd:integer(strbefore(?clause, ".")) + xsd:integer(strafter(?clause, ".")))
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?clause"):::projected
v9("?desc"):::projected
v9("?iev"):::projected
v9("?item"):::projected
v9("?label"):::projected
v4("?namedAs"):::projected
v8("?officialLabels")
v7("?wp"):::projected
v9("?wpCount")
a1((" "))
a2((" "))
c5(["wd:Q70257574"]):::iri
c15(["wikipedia"]):::literal
a1 --"p:statement/P1343"--> c5
a1 --"p:qualifier/P958"--> v1
a1 --"p:qualifier/P1810"--> v4
v9 --"p:P1343"--> a1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v9 -."rdfs:label".-> v9
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v9 -."schema:description".-> v9
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v9 -."p:direct/P8855".-> v9
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v7 -."schema:about".-> v9
v7 --"schema:isPartOf"--> a2
a2 --"wikibase:wikiGroup"--> c15
end
bind6[/"?namedAs"/]
v4 --o bind6
bind6 --as--o v8
bind7[/"sample(?item)"/]
v9 --o bind7
bind7 --as--o v9
bind8[/"sample(?label)"/]
v9 --o bind8
bind8 --as--o v9
bind9[/"sample(?desc)"/]
v9 --o bind9
bind9 --as--o v9
bind10[/"sample(?iev)"/]
v9 --o bind10
bind10 --as--o v9
bind11[/"count(?wp)"/]
v7 --o bind11
bind11 --as--o v9