query-86be3bdeb7d6a09072a2bdecc7bff29b
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
#?item
(SAMPLE (?USOP) AS ?USOP)
(COUNT(?druh) AS ?pocet)
(GROUP_CONCAT(?druhLabel; SEPARATOR = "&") AS ?druhy)
(SAMPLE (?itemLabel) AS ?Nazev)
(SAMPLE (?datum) AS ?Datum)
(SAMPLE (?obecLabel) AS ?Obec)
(SAMPLE (?GPS) AS ?GPS)
(SAMPLE (?obvod) AS ?Obvod)
(SAMPLE (?obrazek) AS ?image)
WHERE {
?item wdt:P677 ?usop .
?item wdt:P31 ?druh .
?druh wdt:P31 wd:Q16521 .
?item wdt:P131 ?obec .
?obec wdt:P131 ?Okres .
?obec wdt:P131 wd:Q579648 .
OPTIONAL{?item wdt:P625 ?GPS } .
OPTIONAL{?item wdt:P677 ?USOP } .
OPTIONAL{?item wdt:P2547 ?obvod } .
OPTIONAL{?item wdt:P18 ?obrazek } .
OPTIONAL{?item p:P31/pq:P580 ?datum } .
SERVICE wikibase:label { bd:serviceParam wikibase:language "cs" .
?druh rdfs:label ?druhLabel .
?obec rdfs:label ?obecLabel .
?item rdfs:label ?itemLabel .
}
}
GROUP BY ?item
ORDER BY DESC(?pocet)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v17("?Datum")
v19("?GPS"):::projected
v16("?Nazev")
v18("?Obec")
v19("?Obvod")
v6("?Okres")
v15("?USOP"):::projected
v11("?datum"):::projected
v4("?druh"):::projected
v12("?druhLabel"):::projected
v15("?druhy")
v20("?image")
v2("?item")
v14("?itemLabel"):::projected
v5("?obec")
v13("?obecLabel"):::projected
v10("?obrazek"):::projected
v9("?obvod"):::projected
v15("?pocet")
v3("?usop")
a1((" "))
c5(["wd:Q579648"]):::iri
c14(["cs"]):::literal
c12(["bd:serviceParam"]):::iri
c3(["wd:Q16521"]):::iri
v2 --"p:direct/P677"--> v3
v2 --"p:direct/P31"--> v4
v4 --"p:direct/P31"--> c3
v2 --"p:direct/P131"--> v5
v5 --"p:direct/P131"--> v6
v5 --"p:direct/P131"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P625".-> v19
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P677".-> v15
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P2547".-> v9
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P18".-> v10
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:P31".-> a1
a1 --"p:qualifier/P580"--> v11
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
v4 --"rdfs:label"--> v12
v5 --"rdfs:label"--> v13
v2 --"rdfs:label"--> v14
end
bind9[/"sample(?USOP)"/]
v15 --o bind9
bind9 --as--o v15
bind10[/"count(?druh)"/]
v4 --o bind10
bind10 --as--o v15
bind11[/"?druhLabel"/]
v12 --o bind11
bind11 --as--o v15
bind12[/"sample(?itemLabel)"/]
v14 --o bind12
bind12 --as--o v16
bind13[/"sample(?datum)"/]
v11 --o bind13
bind13 --as--o v17
bind14[/"sample(?obecLabel)"/]
v13 --o bind14
bind14 --as--o v18
bind15[/"sample(?GPS)"/]
v19 --o bind15
bind15 --as--o v19
bind16[/"sample(?obvod)"/]
v9 --o bind16
bind16 --as--o v19
bind17[/"sample(?obrazek)"/]
v10 --o bind17
bind17 --as--o v20