A loose federation of distributed, typed datasets
1<!DOCTYPE html>
2<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
3
4<meta charset="utf-8">
5<meta name="generator" content="quarto-1.7.34">
6
7<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
8
9<meta name="description" content="The atdata:// URI scheme for addressing resources">
10
11<title>URI Specification – atdata</title>
12<style>
13code{white-space: pre-wrap;}
14span.smallcaps{font-variant: small-caps;}
15div.columns{display: flex; gap: min(4vw, 1.5em);}
16div.column{flex: auto; overflow-x: auto;}
17div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
18ul.task-list{list-style: none;}
19ul.task-list li input[type="checkbox"] {
20 width: 0.8em;
21 margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
22 vertical-align: middle;
23}
24/* CSS for syntax highlighting */
25html { -webkit-text-size-adjust: 100%; }
26pre > code.sourceCode { white-space: pre; position: relative; }
27pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
28pre > code.sourceCode > span:empty { height: 1.2em; }
29.sourceCode { overflow: visible; }
30code.sourceCode > span { color: inherit; text-decoration: inherit; }
31div.sourceCode { margin: 1em 0; }
32pre.sourceCode { margin: 0; }
33@media screen {
34div.sourceCode { overflow: auto; }
35}
36@media print {
37pre > code.sourceCode { white-space: pre-wrap; }
38pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
39}
40pre.numberSource code
41 { counter-reset: source-line 0; }
42pre.numberSource code > span
43 { position: relative; left: -4em; counter-increment: source-line; }
44pre.numberSource code > span > a:first-child::before
45 { content: counter(source-line);
46 position: relative; left: -1em; text-align: right; vertical-align: baseline;
47 border: none; display: inline-block;
48 -webkit-touch-callout: none; -webkit-user-select: none;
49 -khtml-user-select: none; -moz-user-select: none;
50 -ms-user-select: none; user-select: none;
51 padding: 0 4px; width: 4em;
52 }
53pre.numberSource { margin-left: 3em; padding-left: 4px; }
54div.sourceCode
55 { }
56@media screen {
57pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
58}
59</style>
60
61
62<script src="../site_libs/quarto-nav/quarto-nav.js"></script>
63<script src="../site_libs/quarto-nav/headroom.min.js"></script>
64<script src="../site_libs/clipboard/clipboard.min.js"></script>
65<script src="../site_libs/quarto-search/autocomplete.umd.js"></script>
66<script src="../site_libs/quarto-search/fuse.min.js"></script>
67<script src="../site_libs/quarto-search/quarto-search.js"></script>
68<meta name="quarto:offset" content="../">
69<script src="../site_libs/quarto-html/quarto.js" type="module"></script>
70<script src="../site_libs/quarto-html/tabsets/tabsets.js" type="module"></script>
71<script src="../site_libs/quarto-html/popper.min.js"></script>
72<script src="../site_libs/quarto-html/tippy.umd.min.js"></script>
73<script src="../site_libs/quarto-html/anchor.min.js"></script>
74<link href="../site_libs/quarto-html/tippy.css" rel="stylesheet">
75<link href="../site_libs/quarto-html/quarto-syntax-highlighting-9582434199d49cc9e91654cdeeb4866b.css" rel="stylesheet" class="quarto-color-scheme" id="quarto-text-highlighting-styles">
76<link href="../site_libs/quarto-html/quarto-syntax-highlighting-dark-8dcd8563ea6803ab7cbb3d71ca5772e1.css" rel="stylesheet" class="quarto-color-scheme quarto-color-alternate" id="quarto-text-highlighting-styles">
77<link href="../site_libs/quarto-html/quarto-syntax-highlighting-9582434199d49cc9e91654cdeeb4866b.css" rel="stylesheet" class="quarto-color-scheme-extra" id="quarto-text-highlighting-styles">
78<script src="../site_libs/bootstrap/bootstrap.min.js"></script>
79<link href="../site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
80<link href="../site_libs/bootstrap/bootstrap-62bce24ca844314e7bb1a34dbdfe05cc.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme" id="quarto-bootstrap" data-mode="light">
81<link href="../site_libs/bootstrap/bootstrap-dark-7964ffd8887b0991fe8d71c6c8bc75d6.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme quarto-color-alternate" id="quarto-bootstrap" data-mode="dark">
82<link href="../site_libs/bootstrap/bootstrap-62bce24ca844314e7bb1a34dbdfe05cc.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme-extra" id="quarto-bootstrap" data-mode="light">
83<script id="quarto-search-options" type="application/json">{
84 "location": "navbar",
85 "copy-button": false,
86 "collapse-after": 3,
87 "panel-placement": "end",
88 "type": "overlay",
89 "limit": 50,
90 "keyboard-shortcut": [
91 "f",
92 "/",
93 "s"
94 ],
95 "show-item-context": false,
96 "language": {
97 "search-no-results-text": "No results",
98 "search-matching-documents-text": "matching documents",
99 "search-copy-link-title": "Copy link to search",
100 "search-hide-matches-text": "Hide additional matches",
101 "search-more-match-text": "more match in this document",
102 "search-more-matches-text": "more matches in this document",
103 "search-clear-button-title": "Clear",
104 "search-text-placeholder": "",
105 "search-detached-cancel-button-title": "Cancel",
106 "search-submit-button-title": "Submit",
107 "search-label": "Search"
108 }
109}</script>
110
111
112<link rel="stylesheet" href="../assets/styles.css">
113</head>
114
115<body class="nav-sidebar docked nav-fixed quarto-light"><script id="quarto-html-before-body" type="application/javascript">
116 const toggleBodyColorMode = (bsSheetEl) => {
117 const mode = bsSheetEl.getAttribute("data-mode");
118 const bodyEl = window.document.querySelector("body");
119 if (mode === "dark") {
120 bodyEl.classList.add("quarto-dark");
121 bodyEl.classList.remove("quarto-light");
122 } else {
123 bodyEl.classList.add("quarto-light");
124 bodyEl.classList.remove("quarto-dark");
125 }
126 }
127 const toggleBodyColorPrimary = () => {
128 const bsSheetEl = window.document.querySelector("link#quarto-bootstrap:not([rel=disabled-stylesheet])");
129 if (bsSheetEl) {
130 toggleBodyColorMode(bsSheetEl);
131 }
132 }
133 const setColorSchemeToggle = (alternate) => {
134 const toggles = window.document.querySelectorAll('.quarto-color-scheme-toggle');
135 for (let i=0; i < toggles.length; i++) {
136 const toggle = toggles[i];
137 if (toggle) {
138 if (alternate) {
139 toggle.classList.add("alternate");
140 } else {
141 toggle.classList.remove("alternate");
142 }
143 }
144 }
145 };
146 const toggleColorMode = (alternate) => {
147 // Switch the stylesheets
148 const primaryStylesheets = window.document.querySelectorAll('link.quarto-color-scheme:not(.quarto-color-alternate)');
149 const alternateStylesheets = window.document.querySelectorAll('link.quarto-color-scheme.quarto-color-alternate');
150 manageTransitions('#quarto-margin-sidebar .nav-link', false);
151 if (alternate) {
152 // note: dark is layered on light, we don't disable primary!
153 enableStylesheet(alternateStylesheets);
154 for (const sheetNode of alternateStylesheets) {
155 if (sheetNode.id === "quarto-bootstrap") {
156 toggleBodyColorMode(sheetNode);
157 }
158 }
159 } else {
160 disableStylesheet(alternateStylesheets);
161 enableStylesheet(primaryStylesheets)
162 toggleBodyColorPrimary();
163 }
164 manageTransitions('#quarto-margin-sidebar .nav-link', true);
165 // Switch the toggles
166 setColorSchemeToggle(alternate)
167 // Hack to workaround the fact that safari doesn't
168 // properly recolor the scrollbar when toggling (#1455)
169 if (navigator.userAgent.indexOf('Safari') > 0 && navigator.userAgent.indexOf('Chrome') == -1) {
170 manageTransitions("body", false);
171 window.scrollTo(0, 1);
172 setTimeout(() => {
173 window.scrollTo(0, 0);
174 manageTransitions("body", true);
175 }, 40);
176 }
177 }
178 const disableStylesheet = (stylesheets) => {
179 for (let i=0; i < stylesheets.length; i++) {
180 const stylesheet = stylesheets[i];
181 stylesheet.rel = 'disabled-stylesheet';
182 }
183 }
184 const enableStylesheet = (stylesheets) => {
185 for (let i=0; i < stylesheets.length; i++) {
186 const stylesheet = stylesheets[i];
187 if(stylesheet.rel !== 'stylesheet') { // for Chrome, which will still FOUC without this check
188 stylesheet.rel = 'stylesheet';
189 }
190 }
191 }
192 const manageTransitions = (selector, allowTransitions) => {
193 const els = window.document.querySelectorAll(selector);
194 for (let i=0; i < els.length; i++) {
195 const el = els[i];
196 if (allowTransitions) {
197 el.classList.remove('notransition');
198 } else {
199 el.classList.add('notransition');
200 }
201 }
202 }
203 const isFileUrl = () => {
204 return window.location.protocol === 'file:';
205 }
206 const hasAlternateSentinel = () => {
207 let styleSentinel = getColorSchemeSentinel();
208 if (styleSentinel !== null) {
209 return styleSentinel === "alternate";
210 } else {
211 return false;
212 }
213 }
214 const setStyleSentinel = (alternate) => {
215 const value = alternate ? "alternate" : "default";
216 if (!isFileUrl()) {
217 window.localStorage.setItem("quarto-color-scheme", value);
218 } else {
219 localAlternateSentinel = value;
220 }
221 }
222 const getColorSchemeSentinel = () => {
223 if (!isFileUrl()) {
224 const storageValue = window.localStorage.getItem("quarto-color-scheme");
225 return storageValue != null ? storageValue : localAlternateSentinel;
226 } else {
227 return localAlternateSentinel;
228 }
229 }
230 const toggleGiscusIfUsed = (isAlternate, darkModeDefault) => {
231 const baseTheme = document.querySelector('#giscus-base-theme')?.value ?? 'light';
232 const alternateTheme = document.querySelector('#giscus-alt-theme')?.value ?? 'dark';
233 let newTheme = '';
234 if(authorPrefersDark) {
235 newTheme = isAlternate ? baseTheme : alternateTheme;
236 } else {
237 newTheme = isAlternate ? alternateTheme : baseTheme;
238 }
239 const changeGiscusTheme = () => {
240 // From: https://github.com/giscus/giscus/issues/336
241 const sendMessage = (message) => {
242 const iframe = document.querySelector('iframe.giscus-frame');
243 if (!iframe) return;
244 iframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');
245 }
246 sendMessage({
247 setConfig: {
248 theme: newTheme
249 }
250 });
251 }
252 const isGiscussLoaded = window.document.querySelector('iframe.giscus-frame') !== null;
253 if (isGiscussLoaded) {
254 changeGiscusTheme();
255 }
256 };
257 const authorPrefersDark = false;
258 const darkModeDefault = authorPrefersDark;
259 document.querySelector('link#quarto-text-highlighting-styles.quarto-color-scheme-extra').rel = 'disabled-stylesheet';
260 document.querySelector('link#quarto-bootstrap.quarto-color-scheme-extra').rel = 'disabled-stylesheet';
261 let localAlternateSentinel = darkModeDefault ? 'alternate' : 'default';
262 // Dark / light mode switch
263 window.quartoToggleColorScheme = () => {
264 // Read the current dark / light value
265 let toAlternate = !hasAlternateSentinel();
266 toggleColorMode(toAlternate);
267 setStyleSentinel(toAlternate);
268 toggleGiscusIfUsed(toAlternate, darkModeDefault);
269 window.dispatchEvent(new Event('resize'));
270 };
271 // Switch to dark mode if need be
272 if (hasAlternateSentinel()) {
273 toggleColorMode(true);
274 } else {
275 toggleColorMode(false);
276 }
277 </script>
278
279<div id="quarto-search-results"></div>
280 <header id="quarto-header" class="headroom fixed-top">
281 <nav class="navbar navbar-expand-lg " data-bs-theme="dark">
282 <div class="navbar-container container-fluid">
283 <div class="navbar-brand-container mx-auto">
284 <a class="navbar-brand" href="../index.html">
285 <span class="navbar-title">atdata</span>
286 </a>
287 </div>
288 <div id="quarto-search" class="" title="Search"></div>
289 <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" role="menu" aria-expanded="false" aria-label="Toggle navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
290 <span class="navbar-toggler-icon"></span>
291</button>
292 <div class="collapse navbar-collapse" id="navbarCollapse">
293 <ul class="navbar-nav navbar-nav-scroll me-auto">
294 <li class="nav-item">
295 <a class="nav-link active" href="../index.html" aria-current="page">
296<span class="menu-text">Guide</span></a>
297 </li>
298 <li class="nav-item dropdown ">
299 <a class="nav-link dropdown-toggle" href="#" id="nav-menu-tutorials" role="link" data-bs-toggle="dropdown" aria-expanded="false">
300 <span class="menu-text">Tutorials</span>
301 </a>
302 <ul class="dropdown-menu" aria-labelledby="nav-menu-tutorials">
303 <li>
304 <a class="dropdown-item" href="../tutorials/quickstart.html">
305 <span class="dropdown-text">Quick Start</span></a>
306 </li>
307 <li>
308 <a class="dropdown-item" href="../tutorials/local-workflow.html">
309 <span class="dropdown-text">Local Workflow</span></a>
310 </li>
311 <li>
312 <a class="dropdown-item" href="../tutorials/atmosphere.html">
313 <span class="dropdown-text">Atmosphere Publishing</span></a>
314 </li>
315 <li>
316 <a class="dropdown-item" href="../tutorials/promotion.html">
317 <span class="dropdown-text">Promotion Workflow</span></a>
318 </li>
319 </ul>
320 </li>
321 <li class="nav-item dropdown ">
322 <a class="nav-link dropdown-toggle" href="#" id="nav-menu-reference" role="link" data-bs-toggle="dropdown" aria-expanded="false">
323 <span class="menu-text">Reference</span>
324 </a>
325 <ul class="dropdown-menu" aria-labelledby="nav-menu-reference">
326 <li>
327 <a class="dropdown-item" href="../reference/architecture.html">
328 <span class="dropdown-text">Architecture Overview</span></a>
329 </li>
330 <li>
331 <a class="dropdown-item" href="../reference/packable-samples.html">
332 <span class="dropdown-text">Packable Samples</span></a>
333 </li>
334 <li>
335 <a class="dropdown-item" href="../reference/datasets.html">
336 <span class="dropdown-text">Datasets</span></a>
337 </li>
338 <li>
339 <a class="dropdown-item" href="../reference/lenses.html">
340 <span class="dropdown-text">Lenses</span></a>
341 </li>
342 <li>
343 <a class="dropdown-item" href="../reference/local-storage.html">
344 <span class="dropdown-text">Local Storage</span></a>
345 </li>
346 <li>
347 <a class="dropdown-item" href="../reference/atmosphere.html">
348 <span class="dropdown-text">Atmosphere</span></a>
349 </li>
350 <li>
351 <a class="dropdown-item" href="../reference/promotion.html">
352 <span class="dropdown-text">Promotion</span></a>
353 </li>
354 <li>
355 <a class="dropdown-item" href="../reference/load-dataset.html">
356 <span class="dropdown-text">load_dataset API</span></a>
357 </li>
358 <li>
359 <a class="dropdown-item" href="../reference/protocols.html">
360 <span class="dropdown-text">Protocols</span></a>
361 </li>
362 <li>
363 <a class="dropdown-item" href="../reference/uri-spec.html">
364 <span class="dropdown-text">URI Specification</span></a>
365 </li>
366 <li>
367 <a class="dropdown-item" href="../reference/troubleshooting.html">
368 <span class="dropdown-text">Troubleshooting & FAQ</span></a>
369 </li>
370 <li>
371 <a class="dropdown-item" href="../reference/deployment.html">
372 <span class="dropdown-text">Deployment Guide</span></a>
373 </li>
374 </ul>
375 </li>
376 <li class="nav-item">
377 <a class="nav-link" href="../api/index.html">
378<span class="menu-text">API</span></a>
379 </li>
380</ul>
381 <ul class="navbar-nav navbar-nav-scroll ms-auto">
382 <li class="nav-item compact">
383 <a class="nav-link" href="https://github.com/your-org/atdata"> <i class="bi bi-github" role="img">
384</i>
385<span class="menu-text"></span></a>
386 </li>
387</ul>
388 </div> <!-- /navcollapse -->
389 <div class="quarto-navbar-tools">
390 <a href="" class="quarto-color-scheme-toggle quarto-navigation-tool px-1" onclick="window.quartoToggleColorScheme(); return false;" title="Toggle dark mode"><i class="bi"></i></a>
391</div>
392 </div> <!-- /container-fluid -->
393 </nav>
394 <nav class="quarto-secondary-nav">
395 <div class="container-fluid d-flex">
396 <button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" role="button" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
397 <i class="bi bi-layout-text-sidebar-reverse"></i>
398 </button>
399 <nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="../reference/architecture.html">Reference</a></li><li class="breadcrumb-item"><a href="../reference/uri-spec.html">URI Specification</a></li></ol></nav>
400 <a class="flex-grow-1" role="navigation" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
401 </a>
402 </div>
403 </nav>
404</header>
405<!-- content -->
406<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article page-navbar">
407<!-- sidebar -->
408 <nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation docked overflow-auto">
409 <div class="sidebar-menu-container">
410 <ul class="list-unstyled mt-1">
411 <li class="sidebar-item">
412 <div class="sidebar-item-container">
413 <a href="../index.html" class="sidebar-item-text sidebar-link">
414 <span class="menu-text">atdata</span></a>
415 </div>
416</li>
417 <li class="sidebar-item sidebar-item-section">
418 <div class="sidebar-item-container">
419 <a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="true">
420 <span class="menu-text">Getting Started</span></a>
421 <a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="true" aria-label="Toggle section">
422 <i class="bi bi-chevron-right ms-2"></i>
423 </a>
424 </div>
425 <ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 show">
426 <li class="sidebar-item">
427 <div class="sidebar-item-container">
428 <a href="../tutorials/quickstart.html" class="sidebar-item-text sidebar-link">
429 <span class="menu-text">Quick Start</span></a>
430 </div>
431</li>
432 <li class="sidebar-item">
433 <div class="sidebar-item-container">
434 <a href="../tutorials/local-workflow.html" class="sidebar-item-text sidebar-link">
435 <span class="menu-text">Local Workflow</span></a>
436 </div>
437</li>
438 <li class="sidebar-item">
439 <div class="sidebar-item-container">
440 <a href="../tutorials/atmosphere.html" class="sidebar-item-text sidebar-link">
441 <span class="menu-text">Atmosphere Publishing</span></a>
442 </div>
443</li>
444 <li class="sidebar-item">
445 <div class="sidebar-item-container">
446 <a href="../tutorials/promotion.html" class="sidebar-item-text sidebar-link">
447 <span class="menu-text">Promotion Workflow</span></a>
448 </div>
449</li>
450 </ul>
451 </li>
452 <li class="sidebar-item sidebar-item-section">
453 <div class="sidebar-item-container">
454 <a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-2" role="navigation" aria-expanded="true">
455 <span class="menu-text">Reference</span></a>
456 <a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-2" role="navigation" aria-expanded="true" aria-label="Toggle section">
457 <i class="bi bi-chevron-right ms-2"></i>
458 </a>
459 </div>
460 <ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 show">
461 <li class="sidebar-item">
462 <div class="sidebar-item-container">
463 <a href="../reference/architecture.html" class="sidebar-item-text sidebar-link">
464 <span class="menu-text">Architecture Overview</span></a>
465 </div>
466</li>
467 <li class="sidebar-item">
468 <div class="sidebar-item-container">
469 <a href="../reference/packable-samples.html" class="sidebar-item-text sidebar-link">
470 <span class="menu-text">Packable Samples</span></a>
471 </div>
472</li>
473 <li class="sidebar-item">
474 <div class="sidebar-item-container">
475 <a href="../reference/datasets.html" class="sidebar-item-text sidebar-link">
476 <span class="menu-text">Datasets</span></a>
477 </div>
478</li>
479 <li class="sidebar-item">
480 <div class="sidebar-item-container">
481 <a href="../reference/lenses.html" class="sidebar-item-text sidebar-link">
482 <span class="menu-text">Lenses</span></a>
483 </div>
484</li>
485 <li class="sidebar-item">
486 <div class="sidebar-item-container">
487 <a href="../reference/local-storage.html" class="sidebar-item-text sidebar-link">
488 <span class="menu-text">Local Storage</span></a>
489 </div>
490</li>
491 <li class="sidebar-item">
492 <div class="sidebar-item-container">
493 <a href="../reference/atmosphere.html" class="sidebar-item-text sidebar-link">
494 <span class="menu-text">Atmosphere (ATProto Integration)</span></a>
495 </div>
496</li>
497 <li class="sidebar-item">
498 <div class="sidebar-item-container">
499 <a href="../reference/promotion.html" class="sidebar-item-text sidebar-link">
500 <span class="menu-text">Promotion Workflow</span></a>
501 </div>
502</li>
503 <li class="sidebar-item">
504 <div class="sidebar-item-container">
505 <a href="../reference/load-dataset.html" class="sidebar-item-text sidebar-link">
506 <span class="menu-text">load_dataset API</span></a>
507 </div>
508</li>
509 <li class="sidebar-item">
510 <div class="sidebar-item-container">
511 <a href="../reference/protocols.html" class="sidebar-item-text sidebar-link">
512 <span class="menu-text">Protocols</span></a>
513 </div>
514</li>
515 <li class="sidebar-item">
516 <div class="sidebar-item-container">
517 <a href="../reference/uri-spec.html" class="sidebar-item-text sidebar-link active">
518 <span class="menu-text">URI Specification</span></a>
519 </div>
520</li>
521 <li class="sidebar-item">
522 <div class="sidebar-item-container">
523 <a href="../reference/troubleshooting.html" class="sidebar-item-text sidebar-link">
524 <span class="menu-text">Troubleshooting & FAQ</span></a>
525 </div>
526</li>
527 <li class="sidebar-item">
528 <div class="sidebar-item-container">
529 <a href="../reference/deployment.html" class="sidebar-item-text sidebar-link">
530 <span class="menu-text">Deployment Guide</span></a>
531 </div>
532</li>
533 </ul>
534 </li>
535 </ul>
536 </div>
537</nav>
538<div id="quarto-sidebar-glass" class="quarto-sidebar-collapse-item" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item"></div>
539<!-- margin-sidebar -->
540 <div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
541 <nav id="TOC" role="doc-toc" class="toc-active">
542 <h2 id="toc-title">On this page</h2>
543
544 <ul>
545 <li><a href="#overview" id="toc-overview" class="nav-link active" data-scroll-target="#overview">Overview</a></li>
546 <li><a href="#uri-format" id="toc-uri-format" class="nav-link" data-scroll-target="#uri-format">URI Format</a>
547 <ul class="collapse">
548 <li><a href="#authority" id="toc-authority" class="nav-link" data-scroll-target="#authority">Authority</a></li>
549 <li><a href="#resource-types" id="toc-resource-types" class="nav-link" data-scroll-target="#resource-types">Resource Types</a></li>
550 <li><a href="#version-specifiers" id="toc-version-specifiers" class="nav-link" data-scroll-target="#version-specifiers">Version Specifiers</a></li>
551 </ul></li>
552 <li><a href="#examples" id="toc-examples" class="nav-link" data-scroll-target="#examples">Examples</a>
553 <ul class="collapse">
554 <li><a href="#local-development" id="toc-local-development" class="nav-link" data-scroll-target="#local-development">Local Development</a></li>
555 <li><a href="#atmosphere-atproto-federation" id="toc-atmosphere-atproto-federation" class="nav-link" data-scroll-target="#atmosphere-atproto-federation">Atmosphere (ATProto Federation)</a></li>
556 </ul></li>
557 <li><a href="#relationship-to-at-protocol-uris" id="toc-relationship-to-at-protocol-uris" class="nav-link" data-scroll-target="#relationship-to-at-protocol-uris">Relationship to AT Protocol URIs</a></li>
558 <li><a href="#legacy-format" id="toc-legacy-format" class="nav-link" data-scroll-target="#legacy-format">Legacy Format</a></li>
559 </ul>
560<div class="toc-actions"><ul><li><a href="https://github.com/your-org/atdata/edit/main/reference/uri-spec.qmd" class="toc-action"><i class="bi bi-github"></i>Edit this page</a></li><li><a href="https://github.com/your-org/atdata/issues/new" class="toc-action"><i class="bi empty"></i>Report an issue</a></li></ul></div></nav>
561 </div>
562<!-- main -->
563<main class="content" id="quarto-document-content">
564
565
566<header id="title-block-header" class="quarto-title-block default"><nav class="quarto-page-breadcrumbs quarto-title-breadcrumbs d-none d-lg-block" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="../reference/architecture.html">Reference</a></li><li class="breadcrumb-item"><a href="../reference/uri-spec.html">URI Specification</a></li></ol></nav>
567<div class="quarto-title">
568<h1 class="title">URI Specification</h1>
569</div>
570
571<div>
572 <div class="description">
573 The atdata:// URI scheme for addressing resources
574 </div>
575</div>
576
577
578<div class="quarto-title-meta">
579
580
581
582
583 </div>
584
585
586
587</header>
588
589
590<p>The <code>atdata://</code> URI scheme provides a unified way to address atdata resources across local development and the ATProto federation.</p>
591<section id="overview" class="level2">
592<h2 class="anchored" data-anchor-id="overview">Overview</h2>
593<p>The atdata URI scheme:</p>
594<ul>
595<li>Follows <a href="https://datatracker.ietf.org/doc/html/rfc3986">RFC 3986</a> syntax</li>
596<li>Provides consistent addressing for local and atmosphere resources</li>
597<li>Enables seamless promotion from development to production</li>
598</ul>
599</section>
600<section id="uri-format" class="level2">
601<h2 class="anchored" data-anchor-id="uri-format">URI Format</h2>
602<pre><code>atdata://{authority}/{resource_type}/{name}@{version}</code></pre>
603<section id="authority" class="level3">
604<h3 class="anchored" data-anchor-id="authority">Authority</h3>
605<p>The authority identifies where the resource is stored:</p>
606<table class="caption-top table">
607<thead>
608<tr class="header">
609<th>Authority</th>
610<th>Description</th>
611<th>Example</th>
612</tr>
613</thead>
614<tbody>
615<tr class="odd">
616<td><code>local</code></td>
617<td>Local Redis/S3 storage</td>
618<td><code>atdata://local/...</code></td>
619</tr>
620<tr class="even">
621<td><code>{handle}</code></td>
622<td>ATProto handle</td>
623<td><code>atdata://alice.bsky.social/...</code></td>
624</tr>
625<tr class="odd">
626<td><code>{did}</code></td>
627<td>ATProto DID</td>
628<td><code>atdata://did:plc:abc123/...</code></td>
629</tr>
630</tbody>
631</table>
632</section>
633<section id="resource-types" class="level3">
634<h3 class="anchored" data-anchor-id="resource-types">Resource Types</h3>
635<table class="caption-top table">
636<thead>
637<tr class="header">
638<th>Resource Type</th>
639<th>Description</th>
640</tr>
641</thead>
642<tbody>
643<tr class="odd">
644<td><code>sampleSchema</code></td>
645<td>PackableSample type definitions</td>
646</tr>
647<tr class="even">
648<td><code>dataset</code></td>
649<td>Dataset entries (future)</td>
650</tr>
651<tr class="odd">
652<td><code>lens</code></td>
653<td>Lens transformations (future)</td>
654</tr>
655</tbody>
656</table>
657</section>
658<section id="version-specifiers" class="level3">
659<h3 class="anchored" data-anchor-id="version-specifiers">Version Specifiers</h3>
660<p>Versions follow semantic versioning and are specified with <code>@</code>:</p>
661<table class="caption-top table">
662<thead>
663<tr class="header">
664<th>Specifier</th>
665<th>Description</th>
666<th>Example</th>
667</tr>
668</thead>
669<tbody>
670<tr class="odd">
671<td><code>@{major}.{minor}.{patch}</code></td>
672<td>Exact version</td>
673<td><code>@1.0.0</code>, <code>@2.1.3</code></td>
674</tr>
675<tr class="even">
676<td>(none)</td>
677<td>Latest version</td>
678<td>Resolves to highest semver</td>
679</tr>
680</tbody>
681</table>
682</section>
683</section>
684<section id="examples" class="level2">
685<h2 class="anchored" data-anchor-id="examples">Examples</h2>
686<section id="local-development" class="level3">
687<h3 class="anchored" data-anchor-id="local-development">Local Development</h3>
688<div id="f60296a7" class="cell">
689<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> atdata.local <span class="im">import</span> Index</span>
690<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a></span>
691<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a>index <span class="op">=</span> Index()</span>
692<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a></span>
693<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="co"># Publish a schema (returns atdata:// URI)</span></span>
694<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a>ref <span class="op">=</span> index.publish_schema(MySample, version<span class="op">=</span><span class="st">"1.0.0"</span>)</span>
695<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a><span class="co"># => "atdata://local/sampleSchema/MySample@1.0.0"</span></span>
696<span id="cb2-8"><a href="#cb2-8" aria-hidden="true" tabindex="-1"></a></span>
697<span id="cb2-9"><a href="#cb2-9" aria-hidden="true" tabindex="-1"></a><span class="co"># Auto-increment version</span></span>
698<span id="cb2-10"><a href="#cb2-10" aria-hidden="true" tabindex="-1"></a>ref <span class="op">=</span> index.publish_schema(MySample)</span>
699<span id="cb2-11"><a href="#cb2-11" aria-hidden="true" tabindex="-1"></a><span class="co"># => "atdata://local/sampleSchema/MySample@1.0.1"</span></span>
700<span id="cb2-12"><a href="#cb2-12" aria-hidden="true" tabindex="-1"></a></span>
701<span id="cb2-13"><a href="#cb2-13" aria-hidden="true" tabindex="-1"></a><span class="co"># Retrieve by URI</span></span>
702<span id="cb2-14"><a href="#cb2-14" aria-hidden="true" tabindex="-1"></a>schema <span class="op">=</span> index.get_schema(<span class="st">"atdata://local/sampleSchema/MySample@1.0.0"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
703</div>
704</section>
705<section id="atmosphere-atproto-federation" class="level3">
706<h3 class="anchored" data-anchor-id="atmosphere-atproto-federation">Atmosphere (ATProto Federation)</h3>
707<div id="339436d2" class="cell">
708<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> atdata.atmosphere <span class="im">import</span> Client</span>
709<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a></span>
710<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a>client <span class="op">=</span> Client()</span>
711<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a></span>
712<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a><span class="co"># Publish returns at:// URI that maps to atdata://</span></span>
713<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a>ref <span class="op">=</span> client.publish_schema(MySample)</span>
714<span id="cb3-7"><a href="#cb3-7" aria-hidden="true" tabindex="-1"></a><span class="co"># => "at://did:plc:abc123/ac.foundation.dataset.sampleSchema/xyz"</span></span>
715<span id="cb3-8"><a href="#cb3-8" aria-hidden="true" tabindex="-1"></a></span>
716<span id="cb3-9"><a href="#cb3-9" aria-hidden="true" tabindex="-1"></a><span class="co"># Can also be addressed as:</span></span>
717<span id="cb3-10"><a href="#cb3-10" aria-hidden="true" tabindex="-1"></a><span class="co"># => "atdata://did:plc:abc123/sampleSchema/MySample@1.0.0"</span></span>
718<span id="cb3-11"><a href="#cb3-11" aria-hidden="true" tabindex="-1"></a><span class="co"># => "atdata://alice.bsky.social/sampleSchema/MySample@1.0.0"</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
719</div>
720</section>
721</section>
722<section id="relationship-to-at-protocol-uris" class="level2">
723<h2 class="anchored" data-anchor-id="relationship-to-at-protocol-uris">Relationship to AT Protocol URIs</h2>
724<p>The <code>atdata://</code> scheme is inspired by and maps to ATProto’s <code>at://</code> scheme:</p>
725<table class="caption-top table">
726<colgroup>
727<col style="width: 61%">
728<col style="width: 38%">
729</colgroup>
730<thead>
731<tr class="header">
732<th>atdata://</th>
733<th>at://</th>
734</tr>
735</thead>
736<tbody>
737<tr class="odd">
738<td><code>atdata://{did}/sampleSchema/{name}@{version}</code></td>
739<td><code>at://{did}/ac.foundation.dataset.sampleSchema/{rkey}</code></td>
740</tr>
741<tr class="even">
742<td><code>atdata://local/...</code></td>
743<td>(local only, no at:// equivalent)</td>
744</tr>
745</tbody>
746</table>
747<p>When publishing to the atmosphere, atdata URIs are automatically resolved to their corresponding <code>at://</code> URIs for federation compatibility.</p>
748</section>
749<section id="legacy-format" class="level2">
750<h2 class="anchored" data-anchor-id="legacy-format">Legacy Format</h2>
751<p>For backwards compatibility, the local index also accepts the legacy format:</p>
752<pre><code>local://schemas/{module.Class}@{version}</code></pre>
753<p>This format is deprecated and will be removed in a future version. Use <code>atdata://local/sampleSchema/{name}@{version}</code> instead.</p>
754
755
756</section>
757
758</main> <!-- /main -->
759<script id="quarto-html-after-body" type="application/javascript">
760 window.document.addEventListener("DOMContentLoaded", function (event) {
761 // Ensure there is a toggle, if there isn't float one in the top right
762 if (window.document.querySelector('.quarto-color-scheme-toggle') === null) {
763 const a = window.document.createElement('a');
764 a.classList.add('top-right');
765 a.classList.add('quarto-color-scheme-toggle');
766 a.href = "";
767 a.onclick = function() { try { window.quartoToggleColorScheme(); } catch {} return false; };
768 const i = window.document.createElement("i");
769 i.classList.add('bi');
770 a.appendChild(i);
771 window.document.body.appendChild(a);
772 }
773 setColorSchemeToggle(hasAlternateSentinel())
774 const icon = "";
775 const anchorJS = new window.AnchorJS();
776 anchorJS.options = {
777 placement: 'right',
778 icon: icon
779 };
780 anchorJS.add('.anchored');
781 const isCodeAnnotation = (el) => {
782 for (const clz of el.classList) {
783 if (clz.startsWith('code-annotation-')) {
784 return true;
785 }
786 }
787 return false;
788 }
789 const onCopySuccess = function(e) {
790 // button target
791 const button = e.trigger;
792 // don't keep focus
793 button.blur();
794 // flash "checked"
795 button.classList.add('code-copy-button-checked');
796 var currentTitle = button.getAttribute("title");
797 button.setAttribute("title", "Copied!");
798 let tooltip;
799 if (window.bootstrap) {
800 button.setAttribute("data-bs-toggle", "tooltip");
801 button.setAttribute("data-bs-placement", "left");
802 button.setAttribute("data-bs-title", "Copied!");
803 tooltip = new bootstrap.Tooltip(button,
804 { trigger: "manual",
805 customClass: "code-copy-button-tooltip",
806 offset: [0, -8]});
807 tooltip.show();
808 }
809 setTimeout(function() {
810 if (tooltip) {
811 tooltip.hide();
812 button.removeAttribute("data-bs-title");
813 button.removeAttribute("data-bs-toggle");
814 button.removeAttribute("data-bs-placement");
815 }
816 button.setAttribute("title", currentTitle);
817 button.classList.remove('code-copy-button-checked');
818 }, 1000);
819 // clear code selection
820 e.clearSelection();
821 }
822 const getTextToCopy = function(trigger) {
823 const codeEl = trigger.previousElementSibling.cloneNode(true);
824 for (const childEl of codeEl.children) {
825 if (isCodeAnnotation(childEl)) {
826 childEl.remove();
827 }
828 }
829 return codeEl.innerText;
830 }
831 const clipboard = new window.ClipboardJS('.code-copy-button:not([data-in-quarto-modal])', {
832 text: getTextToCopy
833 });
834 clipboard.on('success', onCopySuccess);
835 if (window.document.getElementById('quarto-embedded-source-code-modal')) {
836 const clipboardModal = new window.ClipboardJS('.code-copy-button[data-in-quarto-modal]', {
837 text: getTextToCopy,
838 container: window.document.getElementById('quarto-embedded-source-code-modal')
839 });
840 clipboardModal.on('success', onCopySuccess);
841 }
842 var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//);
843 var mailtoRegex = new RegExp(/^mailto:/);
844 var filterRegex = new RegExp("https:\/\/github\.com\/your-org\/atdata");
845 var isInternal = (href) => {
846 return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href);
847 }
848 // Inspect non-navigation links and adorn them if external
849 var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)');
850 for (var i=0; i<links.length; i++) {
851 const link = links[i];
852 if (!isInternal(link.href)) {
853 // undo the damage that might have been done by quarto-nav.js in the case of
854 // links that we want to consider external
855 if (link.dataset.originalHref !== undefined) {
856 link.href = link.dataset.originalHref;
857 }
858 }
859 }
860 function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {
861 const config = {
862 allowHTML: true,
863 maxWidth: 500,
864 delay: 100,
865 arrow: false,
866 appendTo: function(el) {
867 return el.parentElement;
868 },
869 interactive: true,
870 interactiveBorder: 10,
871 theme: 'quarto',
872 placement: 'bottom-start',
873 };
874 if (contentFn) {
875 config.content = contentFn;
876 }
877 if (onTriggerFn) {
878 config.onTrigger = onTriggerFn;
879 }
880 if (onUntriggerFn) {
881 config.onUntrigger = onUntriggerFn;
882 }
883 window.tippy(el, config);
884 }
885 const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
886 for (var i=0; i<noterefs.length; i++) {
887 const ref = noterefs[i];
888 tippyHover(ref, function() {
889 // use id or data attribute instead here
890 let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
891 try { href = new URL(href).hash; } catch {}
892 const id = href.replace(/^#\/?/, "");
893 const note = window.document.getElementById(id);
894 if (note) {
895 return note.innerHTML;
896 } else {
897 return "";
898 }
899 });
900 }
901 const xrefs = window.document.querySelectorAll('a.quarto-xref');
902 const processXRef = (id, note) => {
903 // Strip column container classes
904 const stripColumnClz = (el) => {
905 el.classList.remove("page-full", "page-columns");
906 if (el.children) {
907 for (const child of el.children) {
908 stripColumnClz(child);
909 }
910 }
911 }
912 stripColumnClz(note)
913 if (id === null || id.startsWith('sec-')) {
914 // Special case sections, only their first couple elements
915 const container = document.createElement("div");
916 if (note.children && note.children.length > 2) {
917 container.appendChild(note.children[0].cloneNode(true));
918 for (let i = 1; i < note.children.length; i++) {
919 const child = note.children[i];
920 if (child.tagName === "P" && child.innerText === "") {
921 continue;
922 } else {
923 container.appendChild(child.cloneNode(true));
924 break;
925 }
926 }
927 if (window.Quarto?.typesetMath) {
928 window.Quarto.typesetMath(container);
929 }
930 return container.innerHTML
931 } else {
932 if (window.Quarto?.typesetMath) {
933 window.Quarto.typesetMath(note);
934 }
935 return note.innerHTML;
936 }
937 } else {
938 // Remove any anchor links if they are present
939 const anchorLink = note.querySelector('a.anchorjs-link');
940 if (anchorLink) {
941 anchorLink.remove();
942 }
943 if (window.Quarto?.typesetMath) {
944 window.Quarto.typesetMath(note);
945 }
946 if (note.classList.contains("callout")) {
947 return note.outerHTML;
948 } else {
949 return note.innerHTML;
950 }
951 }
952 }
953 for (var i=0; i<xrefs.length; i++) {
954 const xref = xrefs[i];
955 tippyHover(xref, undefined, function(instance) {
956 instance.disable();
957 let url = xref.getAttribute('href');
958 let hash = undefined;
959 if (url.startsWith('#')) {
960 hash = url;
961 } else {
962 try { hash = new URL(url).hash; } catch {}
963 }
964 if (hash) {
965 const id = hash.replace(/^#\/?/, "");
966 const note = window.document.getElementById(id);
967 if (note !== null) {
968 try {
969 const html = processXRef(id, note.cloneNode(true));
970 instance.setContent(html);
971 } finally {
972 instance.enable();
973 instance.show();
974 }
975 } else {
976 // See if we can fetch this
977 fetch(url.split('#')[0])
978 .then(res => res.text())
979 .then(html => {
980 const parser = new DOMParser();
981 const htmlDoc = parser.parseFromString(html, "text/html");
982 const note = htmlDoc.getElementById(id);
983 if (note !== null) {
984 const html = processXRef(id, note);
985 instance.setContent(html);
986 }
987 }).finally(() => {
988 instance.enable();
989 instance.show();
990 });
991 }
992 } else {
993 // See if we can fetch a full url (with no hash to target)
994 // This is a special case and we should probably do some content thinning / targeting
995 fetch(url)
996 .then(res => res.text())
997 .then(html => {
998 const parser = new DOMParser();
999 const htmlDoc = parser.parseFromString(html, "text/html");
1000 const note = htmlDoc.querySelector('main.content');
1001 if (note !== null) {
1002 // This should only happen for chapter cross references
1003 // (since there is no id in the URL)
1004 // remove the first header
1005 if (note.children.length > 0 && note.children[0].tagName === "HEADER") {
1006 note.children[0].remove();
1007 }
1008 const html = processXRef(null, note);
1009 instance.setContent(html);
1010 }
1011 }).finally(() => {
1012 instance.enable();
1013 instance.show();
1014 });
1015 }
1016 }, function(instance) {
1017 });
1018 }
1019 let selectedAnnoteEl;
1020 const selectorForAnnotation = ( cell, annotation) => {
1021 let cellAttr = 'data-code-cell="' + cell + '"';
1022 let lineAttr = 'data-code-annotation="' + annotation + '"';
1023 const selector = 'span[' + cellAttr + '][' + lineAttr + ']';
1024 return selector;
1025 }
1026 const selectCodeLines = (annoteEl) => {
1027 const doc = window.document;
1028 const targetCell = annoteEl.getAttribute("data-target-cell");
1029 const targetAnnotation = annoteEl.getAttribute("data-target-annotation");
1030 const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));
1031 const lines = annoteSpan.getAttribute("data-code-lines").split(",");
1032 const lineIds = lines.map((line) => {
1033 return targetCell + "-" + line;
1034 })
1035 let top = null;
1036 let height = null;
1037 let parent = null;
1038 if (lineIds.length > 0) {
1039 //compute the position of the single el (top and bottom and make a div)
1040 const el = window.document.getElementById(lineIds[0]);
1041 top = el.offsetTop;
1042 height = el.offsetHeight;
1043 parent = el.parentElement.parentElement;
1044 if (lineIds.length > 1) {
1045 const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);
1046 const bottom = lastEl.offsetTop + lastEl.offsetHeight;
1047 height = bottom - top;
1048 }
1049 if (top !== null && height !== null && parent !== null) {
1050 // cook up a div (if necessary) and position it
1051 let div = window.document.getElementById("code-annotation-line-highlight");
1052 if (div === null) {
1053 div = window.document.createElement("div");
1054 div.setAttribute("id", "code-annotation-line-highlight");
1055 div.style.position = 'absolute';
1056 parent.appendChild(div);
1057 }
1058 div.style.top = top - 2 + "px";
1059 div.style.height = height + 4 + "px";
1060 div.style.left = 0;
1061 let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
1062 if (gutterDiv === null) {
1063 gutterDiv = window.document.createElement("div");
1064 gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter");
1065 gutterDiv.style.position = 'absolute';
1066 const codeCell = window.document.getElementById(targetCell);
1067 const gutter = codeCell.querySelector('.code-annotation-gutter');
1068 gutter.appendChild(gutterDiv);
1069 }
1070 gutterDiv.style.top = top - 2 + "px";
1071 gutterDiv.style.height = height + 4 + "px";
1072 }
1073 selectedAnnoteEl = annoteEl;
1074 }
1075 };
1076 const unselectCodeLines = () => {
1077 const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"];
1078 elementsIds.forEach((elId) => {
1079 const div = window.document.getElementById(elId);
1080 if (div) {
1081 div.remove();
1082 }
1083 });
1084 selectedAnnoteEl = undefined;
1085 };
1086 // Handle positioning of the toggle
1087 window.addEventListener(
1088 "resize",
1089 throttle(() => {
1090 elRect = undefined;
1091 if (selectedAnnoteEl) {
1092 selectCodeLines(selectedAnnoteEl);
1093 }
1094 }, 10)
1095 );
1096 function throttle(fn, ms) {
1097 let throttle = false;
1098 let timer;
1099 return (...args) => {
1100 if(!throttle) { // first call gets through
1101 fn.apply(this, args);
1102 throttle = true;
1103 } else { // all the others get throttled
1104 if(timer) clearTimeout(timer); // cancel #2
1105 timer = setTimeout(() => {
1106 fn.apply(this, args);
1107 timer = throttle = false;
1108 }, ms);
1109 }
1110 };
1111 }
1112 // Attach click handler to the DT
1113 const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
1114 for (const annoteDlNode of annoteDls) {
1115 annoteDlNode.addEventListener('click', (event) => {
1116 const clickedEl = event.target;
1117 if (clickedEl !== selectedAnnoteEl) {
1118 unselectCodeLines();
1119 const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');
1120 if (activeEl) {
1121 activeEl.classList.remove('code-annotation-active');
1122 }
1123 selectCodeLines(clickedEl);
1124 clickedEl.classList.add('code-annotation-active');
1125 } else {
1126 // Unselect the line
1127 unselectCodeLines();
1128 clickedEl.classList.remove('code-annotation-active');
1129 }
1130 });
1131 }
1132 const findCites = (el) => {
1133 const parentEl = el.parentElement;
1134 if (parentEl) {
1135 const cites = parentEl.dataset.cites;
1136 if (cites) {
1137 return {
1138 el,
1139 cites: cites.split(' ')
1140 };
1141 } else {
1142 return findCites(el.parentElement)
1143 }
1144 } else {
1145 return undefined;
1146 }
1147 };
1148 var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
1149 for (var i=0; i<bibliorefs.length; i++) {
1150 const ref = bibliorefs[i];
1151 const citeInfo = findCites(ref);
1152 if (citeInfo) {
1153 tippyHover(citeInfo.el, function() {
1154 var popup = window.document.createElement('div');
1155 citeInfo.cites.forEach(function(cite) {
1156 var citeDiv = window.document.createElement('div');
1157 citeDiv.classList.add('hanging-indent');
1158 citeDiv.classList.add('csl-entry');
1159 var biblioDiv = window.document.getElementById('ref-' + cite);
1160 if (biblioDiv) {
1161 citeDiv.innerHTML = biblioDiv.innerHTML;
1162 }
1163 popup.appendChild(citeDiv);
1164 });
1165 return popup.innerHTML;
1166 });
1167 }
1168 }
1169 });
1170 </script>
1171</div> <!-- /content -->
1172<footer class="footer">
1173 <div class="nav-footer">
1174 <div class="nav-footer-left">
1175<p>Built with <a href="https://quarto.org/">Quarto</a></p>
1176</div>
1177 <div class="nav-footer-center">
1178
1179 <div class="toc-actions d-sm-block d-md-none"><ul><li><a href="https://github.com/your-org/atdata/edit/main/reference/uri-spec.qmd" class="toc-action"><i class="bi bi-github"></i>Edit this page</a></li><li><a href="https://github.com/your-org/atdata/issues/new" class="toc-action"><i class="bi empty"></i>Report an issue</a></li></ul></div></div>
1180 <div class="nav-footer-right">
1181<p>MIT License</p>
1182</div>
1183 </div>
1184</footer>
1185
1186
1187
1188
1189</body></html>