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 ==
Data fetched from [https://wd.hxmn.dev Wikibase (wd.hxmn.dev)] via SPARQL.
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}}
| '''France''' || Paris || 67,750,000 || 843 || Europe || [https://wd.hxmn.dev/wiki/Item:Q10 Q10]
|-
| '''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]
|}
|}


=== 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}}
| '''Berlin''' || Germany || 3,748,000 || 1237 || [https://wd.hxmn.dev/wiki/Item:Q11 Q11]
|-
| '''Paris''' || France || 2,161,000 || 259 BC || [https://wd.hxmn.dev/wiki/Item:Q14 Q14]
|-
| '''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]
|}
|}


=== 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].
Countries with capitals:
<pre>
PREFIX wd: <https://wd.hxmn.dev/entity/>
PREFIX wdt: <https://wd.hxmn.dev/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?country ?countryLabel ?capital ?capitalLabel ?population WHERE {
  ?country wdt:P1 wd:Q1 .
  ?country wdt:P5 ?capital .
  ?country wdt:P3 ?population .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
ORDER BY DESC(?population)
</pre>


[[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.