Wikibase Sample Data: Difference between revisions
Appearance
Wikibase sample data page (auto-generated) |
Wikibase sample data page (auto-generated) |
||
| Line 1: | Line 1: | ||
== Wikibase Sample Data == | == Wikibase Sample Data == | ||
Data fetched from [https://wd.hxmn.dev Wikibase | Data fetched '''dynamically''' from [https://wd.hxmn.dev Wikibase] via SPARQL on each page view. | ||
=== Countries === | === Countries === | ||
{{#get_web_data:url=https://wd.hxmn.dev/query/sparql?format=json|format=json with jsonpath|post data=query=SELECT ?item ?itemLabel ?capitalLabel ?population ?founded ?continentLabel WHERE { ?item <https://wd.hxmn.dev/prop/direct/P1> <https://wd.hxmn.dev/entity/Q1> . ?item <http://www.w3.org/2000/01/rdf-schema#label> ?itemLabel . FILTER(LANG(?itemLabel) = "en") OPTIONAL { ?item <https://wd.hxmn.dev/prop/direct/P5> ?capital . ?capital <http://www.w3.org/2000/01/rdf-schema#label> ?capitalLabel . FILTER(LANG(?capitalLabel) = "en") } OPTIONAL { ?item <https://wd.hxmn.dev/prop/direct/P3> ?population . } OPTIONAL { ?item <https://wd.hxmn.dev/prop/direct/P4> ?founded . } OPTIONAL { ?item <https://wd.hxmn.dev/prop/direct/P6> ?continent . ?continent <http://www.w3.org/2000/01/rdf-schema#label> ?continentLabel . FILTER(LANG(?continentLabel) = "en") } } ORDER BY ?itemLabel|data=item=$.results.bindings[*].item.value,name=$.results.bindings[*].itemLabel.value,capital=$.results.bindings[*].capitalLabel.value,population=$.results.bindings[*].population.value,founded=$.results.bindings[*].founded.value,continent=$.results.bindings[*].continentLabel.value}} | |||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
! Country !! Capital !! Population !! Founded !! Continent !! Wikibase Item | ! Country !! Capital !! Population !! Founded !! Continent !! Wikibase Item | ||
{{#display_external_table:template=Wikibase country row}} | |||
|} | |} | ||
=== Cities === | === Cities === | ||
{{#get_web_data:url=https://wd.hxmn.dev/query/sparql?format=json|format=json with jsonpath|post data=query=SELECT ?item ?itemLabel ?countryLabel ?population ?founded WHERE { ?item <https://wd.hxmn.dev/prop/direct/P1> <https://wd.hxmn.dev/entity/Q2> . ?item <http://www.w3.org/2000/01/rdf-schema#label> ?itemLabel . FILTER(LANG(?itemLabel) = "en") OPTIONAL { ?item <https://wd.hxmn.dev/prop/direct/P2> ?country . ?country <http://www.w3.org/2000/01/rdf-schema#label> ?countryLabel . FILTER(LANG(?countryLabel) = "en") } OPTIONAL { ?item <https://wd.hxmn.dev/prop/direct/P3> ?population . } OPTIONAL { ?item <https://wd.hxmn.dev/prop/direct/P4> ?founded . } } ORDER BY ?itemLabel|data=item=$.results.bindings[*].item.value,name=$.results.bindings[*].itemLabel.value,country=$.results.bindings[*].countryLabel.value,population=$.results.bindings[*].population.value,founded=$.results.bindings[*].founded.value}} | |||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
! City !! Country !! Population !! Founded !! Wikibase Item | ! City !! Country !! Population !! Founded !! Wikibase Item | ||
{{#display_external_table:template=Wikibase city row}} | |||
|} | |} | ||
=== SPARQL Queries === | === SPARQL Queries === | ||
Run queries at [https://wd.hxmn.dev/query/ WDQS Query Service]. | Run queries at [https://wd.hxmn.dev/query/ WDQS Query Service]. | ||
[[Category:Wikibase]] | [[Category:Wikibase]] | ||
Revision as of 22:17, 4 April 2026
Wikibase Sample Data
Data fetched dynamically from Wikibase via SPARQL on each page view.
Countries
| Country | Capital | Population | Founded | Continent | Wikibase Item |
|---|---|---|---|---|---|
| France | Paris | 67750000 | 843 | Europe | https://wd.hxmn.dev/entity/Q10 |
| Germany | Berlin | 84482000 | 1871 | Europe | https://wd.hxmn.dev/entity/Q7 |
| Japan | Tokyo | 125124000 | 660 BC | Asia | https://wd.hxmn.dev/entity/Q8 |
| United States | Washington, D.C. | 331449000 | 1776 | North America | https://wd.hxmn.dev/entity/Q9 |
Cities
| City | Country | Population | Founded | Wikibase Item |
|---|---|---|---|---|
| Berlin | Germany | 3748000 | 1237 | https://wd.hxmn.dev/entity/Q11 |
| Paris | France | 2161000 | 259 BC | https://wd.hxmn.dev/entity/Q14 |
| Tokyo | Japan | 13960000 | 1457 | https://wd.hxmn.dev/entity/Q12 |
| Washington, D.C. | United States | 689545 | 1790 | https://wd.hxmn.dev/entity/Q13 |
SPARQL Queries
Run queries at WDQS Query Service.