Platform
Resources
Pricing
Sign in
Contact us
PAC
I explore Wikidata and Wikipedia using Observable notebooks.
Workspace
Fork
Public
By
PAC
Edited
Aug 14, 2024
Fork of
Olympic medals by continent 🥇🥈🥉
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
query
=
`SELECT ?item ?itemLabel ?country ?countryLabel ?code WHERE {
?item wdt:P31 wd:Q5107;
(wdt:P527*) ?country.
?country wdt:P31 wd:Q3624078;
wdt:P298 ?code.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}`
Insert cell
output
=
fetch
(
`https://query.wikidata.org/sparql?query=${
encodeURIComponent
(
query
)
}`
,
{
headers
:
{
accept
:
"application/sparql-results+json"
}
}
)
.
then
(
(
response
)
=>
response
.
json
(
)
)
Insert cell
data
=
aq
.
from
(
output
.
results
.
bindings
.
map
(
(
d
)
=>
(
{
item
:
d
.
item
.
value
,
itemLabel
:
d
.
itemLabel
?.
value
,
country
:
d
.
country
.
value
,
countryLabel
:
d
.
countryLabel
.
value
,
code
:
d
.
code
.
value
}
)
)
)
Insert cell
import
{
aq
,
op
}
from
"@uwdata/arquero"
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Compare fork
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
continent
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
query
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
output
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
data
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML