Public
Edited
Mar 30, 2023
Insert cell
Insert cell
Insert cell
Insert cell
md`Note: I *stole* this request from the browser's developper tool when accessing beol.

It returns the first 25 matching letters, that you can browse below:`
Insert cell
result_json_as_text = fetch(knora_search_url, {
method: 'POST',
body: correspondance_request})
.then(response => response.text())
;
Insert cell
md`maybe easier to scroll through as json:`
Insert cell
result_as_json = JSON.parse(result_json_as_text);
Insert cell
Insert cell
result_text_as_xml = fetch(knora_search_url, {
method: 'POST',
headers: { 'Accept': 'application/rdf+xml' },
body: correspondance_request})
.then(response => response.text());

Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
result_html = result_text_as_xml.replace(/beol:letter/g,'beol_letter');
Insert cell
html`<style>
beol_letter {
display: block;
font-weight: bold;
margin: -.75em 0px .25em -.25em;
padding: .1em .25em;
}
`
Insert cell
html`${result_html}`
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