User:Juandev/Queries
Jump to navigation
Jump to search
Try it!
Try it!
Try it!
Sídla v ČR v kilometrické vzdálenosti od bodu s odkazy do Wikipedie
[edit]# Czech settlements in radius of a specific distance from the point
# Česká sídla (vesnice, města) v určité vzdálenosti od bodu
SELECT ?place ?location ?centerpointLoc ?placeLabel ?distance ?article ?sitelink WHERE {
wd:Q2180733 wdt:P625 ?centerpointLoc . # wd stays for point (settlement) from which the radius goes - proměnná za wd je položkou (sídlem) dle Wikidat, od kterého se v učité vzdálenosti vypíší sídla
SERVICE wikibase:around {
?place wdt:P625 ?location .
bd:serviceParam wikibase:center ?centerpointLoc .
bd:serviceParam wikibase:radius "35" . # set number of a diameter in km - číslo urči kilometrickou vzdálenost od bodu
bd:serviceParam wikibase:distance ?distance .
}
?place wdt:P2788 ?P2788.
optional { ?article1 schema:about ?place ;
schema:isPartOf <https://cs.wikipedia.org/> .
?sitelink1 ^schema:name ?article1 .}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],cs". }
OPTIONAL {?place wdt:P131 ?P131 .
?article2 schema:about ?P131 ;
schema:isPartOf <https://cs.wikipedia.org/> .
?sitelink2 ^schema:name ?article2 .}
bind(coalesce(?sitelink1, ?sitelink2) as ?sitelink)
bind(coalesce(?article1, ?article2) as ?article)
}
Vesnice v Polsku v kilometrické vzdálenosti od bodu s odkazy do Wikipedie
[edit]Pokud existuje více souřadnic, volí jen jedinou.
#Display villages within the specific radius from a specific place
SELECT ?place ?placeLabel ?plwp ?location WITH {
SELECT ?place (SAMPLE(?location) AS ?location) {
wd:Q7264829 wdt:P625 ?polvillLoc .
SERVICE wikibase:around {
?place wdt:P625 ?location.
bd:serviceParam wikibase:center ?polvillLoc;
wikibase:radius "27".
}
?place wdt:P31 wd:Q3558970 .
}
GROUP BY ?place
} AS %i WHERE {
include %i
OPTIONAL { ?plwp schema:about ?place; schema:isPartOf <https://pl.wikipedia.org/> . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Konkrétní příklad použití pro Wikiexpedici Dolní Slezsko
[edit]#Display villages within the specific radius from a specific place
#defaultView:Map
SELECT ?place ?placeLabel ?plwp ?location WITH {
SELECT ?place (SAMPLE(?location) AS ?location) {
wd:Q6895050 wdt:P625 ?polvillLoc .
SERVICE wikibase:around {
?place wdt:P625 ?location.
bd:serviceParam wikibase:center ?polvillLoc;
wikibase:radius "55".
}
?place wdt:P31 wd:Q3558970 .
}
GROUP BY ?place
} AS %i WHERE {
include %i
OPTIONAL { ?plwp schema:about ?place; schema:isPartOf <https://pl.wikipedia.org/> . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],pl". }
}
Švédské spisovatelky 20. století narozené ve Stockholmu
[edit]- Items used: Stockholm (Q1754)
, writer (Q36180)
, Sweden (Q34)
, female (Q6581072)
, human (Q5)
SELECT DISTINCT ?item ?itemLabel ?itemDescription ?gender ?genderLabel ?pob ?pobLabel
WHERE
{
?item wdt:P19 / wdt:P276* / wdt:P131* wd:Q1754.
?item wdt:P106 wd:Q36180.
?item wdt:P27 wd:Q34.
VALUES ?gender { wd:Q6581072 }.
?item wdt:P21 ?gender .
{ ?item wdt:P570 ?dod . FILTER( YEAR(?dod) > 1900 ) }
UNION { ?item wdt:P569 ?dob . FILTER( YEAR(?dob) > 1900 && YEAR(?dob) < 2001 ) }
?item wdt:P31 wd:Q5 .
?item wdt:P19 ?pob .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],sv,en". }
}
LIMIT 1000
Železniční stanice v Polsku v kilometrické vzdálenosti od bodu s odkazy do Wikipedie
[edit]- Items used: Mojesz (Q6895050)
, railway station (Q55488)
- Properties used: coordinate location (P625)
, instance of (P31)
#Display villages within the specific radius from a specific place
SELECT ?place ?placeLabel ?plwp ?location WITH {
SELECT ?place (SAMPLE(?location) AS ?location) {
wd:Q6895050 wdt:P625 ?polvillLoc .
SERVICE wikibase:around {
?place wdt:P625 ?location.
bd:serviceParam wikibase:center ?polvillLoc;
wikibase:radius "55".
}
?place wdt:P31 wd:Q55488 .
}
GROUP BY ?place
} AS %i WHERE {
include %i
OPTIONAL { ?plwp schema:about ?place; schema:isPartOf <https://pl.wikipedia.org/> . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],pl,cs,de". }
}