Wikidata:WikiProject Slovakia/Showcase Queries
Jump to navigation
Jump to search
People of Slovakia by the number of sitelinks[edit]
The following query uses these:
- Items: human (Q5) , Slovakia (Q214)
- Properties: instance of (P31) , place of birth (P19) , country (P17) , date of birth (P569) , date of death (P570) , place of death (P20)
select distinct ?itemLabel ?item ?number ?dob ?pobLabel ?dod ?podLabel with { # select all the numbers of sitelinks select ?number (count(*) as ?total) { [] wikibase:sitelinks ?number . } group by ?number } as %numbers where { include %numbers . filter (?number > 40) . ?item wikibase:sitelinks ?number . ?item wdt:P31 wd:Q5. ?item wdt:P19 ?pob. ?pob wdt:P17 wd:Q214. OPTIONAL { ?item wdt:P569 ?dob } OPTIONAL { ?item wdt:P570 ?dod } OPTIONAL { ?item wdt:P20 ?pod } ?sitelink <http://schema.org/about> ?item . service wikibase:label { bd:serviceParam wikibase:language "sk,en". } } order by desc(?number)
Map of railway lines[edit]
The following query uses these:
- Properties: instance of (P31) , subclass of (P279) , part of (P361) , country (P17) , coordinate location (P625) , adjacent station (P197) , end time (P582)
Features: map (Q24515275)
#defaultView:Map{"hide":["?coord1", "?coord1lat", "?coord1lon", "?coord2", "?coord2lat", "?coord2lon", "?str", "?line"]}
SELECT * WHERE {
?comm1 wdt:P31/wdt:P279*/wdt:P361 wd:Q22667 ; wdt:P17 wd:Q214 ; wdt:P625 ?coord1 ; wdt:P197 ?comm2 .
MINUS { ?comm1 p:P31 [ ps:P31 wd:Q55488 ; pq:P582 [] ] } .
MINUS { ?comm2 p:P31 [ ps:P31 wd:Q55488 ; pq:P582 [] ] } .
MINUS { ?comm1 p:P31 [ ps:P31 wd:Q928830 ] } .
MINUS { ?comm2 p:P31 [ ps:P31 wd:Q928830 ] } .
?comm2 wdt:P625 ?coord2 .
?comm1 p:P625 [ ps:P625 []; psv:P625 [ wikibase:geoLongitude ?coord1lon; wikibase:geoLatitude ?coord1lat; ] ] .
?comm2 p:P625 [ ps:P625 []; psv:P625 [ wikibase:geoLongitude ?coord2lon; wikibase:geoLatitude ?coord2lat; ] ] .
BIND(CONCAT('LINESTRING (', STR(?coord1lon), ' ', STR(?coord1lat), ',', STR(?coord2lon), ' ', STR(?coord2lat), ')') AS ?str) .
BIND(STRDT(?str, geo:wktLiteral) AS ?line) .
}
List of Slovak companies by revenue[edit]
The following query uses these:
- Items: business (Q4830453) , Slovakia (Q214)
- Properties: instance of (P31) , headquarters location (P159) , country (P17) , net profit (P2295) , employees (P1128) , Slovak Registration ID (P8174) , total revenue (P2139) , point in time (P585)
SELECT ?item ?itemLabel ?hqLabel ?revenue ?revenueSt ?profit ?empl ?ico WHERE { ?item wdt:P31 wd:Q4830453 . ?item wdt:P159 ?hq . ?hq wdt:P17 wd:Q214 . ?item p:P2139 ?revenueSt . ?revenueSt a wikibase:BestRank; ps:P2139 ?revenue . ?revenueSt pq:P585 ?date . OPTIONAL { ?item wdt:P2295 ?profit } . OPTIONAL { ?item wdt:P1128 ?empl } . OPTIONAL { ?item wdt:P8174 ?ico } . SERVICE wikibase:label { bd:serviceParam wikibase:language "sk,en" } . } ORDER BY DESC(?revenue) LIMIT 100