Public
Edited
Feb 21, 2024
Insert cell
Insert cell
Insert cell
Insert cell
query = `#defaultEndpoint:Lingualibre
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT
(COUNT(DISTINCT ?record) AS ?records)
(COUNT(DISTINCT ?speaker) AS ?speakers)
(COUNT(DISTINCT ?language) AS ?languages)
WHERE {
?record prop:P2 entity:Q2 .
#?records prop:P3 entity:Q133 # focus on one language
?record prop:P6 ?date .
?record prop:P5 ?speaker .
?record prop:P4 ?language .
# Filters:
FILTER(?date >= "2018-05-01T00:00:00Z"^^xsd:dateTime )
FILTER(?date < "2023-12-01T00:00:00Z"^^xsd:dateTime + "P1M"^^xsd:duration)
}`
Insert cell
Insert cell
endpoint = `https://lingualibre.org/bigdata/sparql`
Insert cell
url = `${endpoint}?query=${encodeURIComponent(query)}`
Insert cell
Insert cell
data = fetch(url, {
headers: { accept: "application/sparql-results+json" }
}).then((response) => response.json())
Insert cell
Insert cell
array = data.results.bindings.map((d) => ({
records: d.records.value,
speakers: d.speakers.value,
languages: d.languages.value
}))
Insert cell
Insert cell
Inputs.table(array)
Insert cell
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.
Learn more