Public
Edited
Oct 20, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
screenShot20241015At71710Pm1 = FileAttachment("Screen Shot 2024-10-15 at 7.17.10 PM.png").image({ width: 600 })
Insert cell
Insert cell
Insert cell
import {tex} from "@lukesmurray/wikidata-sparql-cell-mode-hack"
Insert cell
query_most_frequent_guests_bill_maher = `
SELECT DISTINCT (COUNT (?guest) as ?count) ?guestLabel
WHERE {
?episode (wdt:P31/wdt:P279) wd:Q1983062.
?episode p:P179 ?statement.
OPTIONAL { ?episode wdt:P5030 ?guest. }
?statement ps:P179 wd:Q2030903.
?statement pq:P1545 ?numero_episode.
SERVICE wikibase:label { bd:serviceParam wikibase:language "mul,en,fr".
?guest rdfs:label ?guestLabel.}
}
GROUP BY (?guestLabel)
ORDER BY DESC (?count)
`
Insert cell
res_most_frequent_guests_bill_maher = fetch(`https://query.wikidata.org/sparql?query=${encodeURIComponent(query_most_frequent_guests_bill_maher)}`, {headers: {accept: "application/sparql-results+json"}}).then(response => response.json())
Insert cell
import {aq, op} from "@uwdata/arquero"
Insert cell
df_most_frequent_guests_bill_maher = aq.from(res_most_frequent_guests_bill_maher.results.bindings.map(res => ({
guest: res.guestLabel.value,
count: res.count.value
})))
Insert cell
df_most_frequent_guests_bill_maher.view()
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more