Jump to content

Wikibase Sample Data: Difference between revisions

From HxmnWiki
Wikibase sample data page (auto-generated)
 
Wikibase sample data page (auto-generated)
Line 1: Line 1:
== Wikibase Sample Data ==
== Wikibase Sample Data ==
This page displays sample data from [https://wd.hxmn.dev Wikibase (wd.hxmn.dev)].
Data fetched from [https://wd.hxmn.dev Wikibase (wd.hxmn.dev)] via SPARQL.


=== Countries ===
=== Countries ===
{| class="wikitable sortable"
{| class="wikitable sortable"
! Country !! Capital !! Population !! Founded !! Continent !! Wikibase Item
! Country !! Capital !! Population !! Founded !! Continent !! Wikibase Item
|-
| '''Germany''' || Berlin || 84,482,000 || 1871 || Europe || [https://wd.hxmn.dev/wiki/Item:Q7 Q7]
|-
| '''Japan''' || Tokyo || 125,124,000 || 660 BC || Asia || [https://wd.hxmn.dev/wiki/Item:Q8 Q8]
|-
| '''United States''' || Washington, D.C. || 331,449,000 || 1776 || North America || [https://wd.hxmn.dev/wiki/Item:Q9 Q9]
|-
| '''France''' || Paris || 67,750,000 || 843 || Europe || [https://wd.hxmn.dev/wiki/Item:Q10 Q10]
|}
|}


Line 18: Line 10:
{| class="wikitable sortable"
{| class="wikitable sortable"
! City !! Country !! Population !! Founded !! Wikibase Item
! City !! Country !! Population !! Founded !! Wikibase Item
|-
| '''Berlin''' || Germany || 3,748,000 || 1237 || [https://wd.hxmn.dev/wiki/Item:Q11 Q11]
|-
| '''Tokyo''' || Japan || 13,960,000 || 1457 || [https://wd.hxmn.dev/wiki/Item:Q12 Q12]
|-
| '''Washington, D.C.''' || United States || 689,545 || 1790 || [https://wd.hxmn.dev/wiki/Item:Q13 Q13]
|-
| '''Paris''' || France || 2,161,000 || 259 BC || [https://wd.hxmn.dev/wiki/Item:Q14 Q14]
|}
|}


=== SPARQL Query ===
=== SPARQL Queries ===
You can run SPARQL queries against the Wikibase data at [https://wd.hxmn.dev/query/ WDQS Query Service].
Run queries at [https://wd.hxmn.dev/query/ WDQS Query Service].


Example query to get all countries with their capitals:
Countries with capitals:
<pre>
<pre>
SELECT ?country ?countryLabel ?capital ?capitalLabel ?population WHERE {
SELECT ?country ?countryLabel ?capital ?capitalLabel ?population WHERE {
   ?country wdt:P1 wd:Q1 .
   ?country wdt: wd: .
   ?country wdt:P5 ?capital .
   ?country wdt: ?capital .
   ?country wdt:P3 ?population .
   ?country wdt: ?population .
   SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
}

Revision as of 21:32, 4 April 2026

Wikibase Sample Data

Data fetched from Wikibase (wd.hxmn.dev) via SPARQL.

Countries

Country Capital Population Founded Continent Wikibase Item

Cities

City Country Population Founded Wikibase Item

SPARQL Queries

Run queries at WDQS Query Service.

Countries with capitals:

SELECT ?country ?countryLabel ?capital ?capitalLabel ?population WHERE {
  ?country wdt: wd: .
  ?country wdt: ?capital .
  ?country wdt: ?population .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
ORDER BY DESC(?population)