Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions examples/api.ht/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,25 @@ the `/callback` key page — each of which links straight into live JSON views.
| `phone` | phone number (vanity letters OK) | offline dataset (**DEMO** — labeled) |
| `asn` | ASN (`13335` or `AS13335`) | RIPEstat as-overview (live) |
| `entity` | slug (`cloudflare`, `united-states`) | Wikipedia REST (live) — entity stub (**DEMO** — labeled) |
| `shapes` | `<dataset>/<id>` (`jobs/4266196009`, `classes/Q5`; `?shape=a\|b\|c`) | embedded static data (53 Job records + 20 Wikidata classes, zero request-time fetches) |

`asn` and `entity` are the entity-link layer: `ip → asn → entity → dns →
whois → dns → ip` is a closed browsable loop. Anything mocked or heuristic
says so in its `source` field.

`shapes` is the live link-shape comparison for
[dot-do/data#36](https://github.com/dot-do/data/issues/36) (feeding the
[#13](https://github.com/dot-do/data/issues/13) per-brand link-contract
ruling): the SAME entity in three candidate link shapes, switched by
`?shape=` — (a) typed camelCase edges (`postedBy`, `locatedIn`, `sameAs`,
`potentialAction`) as the envelope `links` block, (b) label-keyed maps as the
recovered workers did, (c) = (a) plus a `variations` block of real
representation alternates (for classes: Wikidata JSON/TTL/HTML). Every
response carries a `shapes` hop map to the same page in the other shapes; a
miss is a page too (404 + `suggestions` as the current shape's link map —
try `shapes.api.ht/jobs/staff-engineer`). The `shapes.api.ht/` root is a
clickable index explaining all three.

## The graph

```
Expand Down
107 changes: 107 additions & 0 deletions examples/api.ht/src/data/shapes-classes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
// Embedded dataset for the shapes tool (link-shape comparison, dot-do/data#36).
// Top-20 head Wikidata classes by direct-P31 instance count, from the committed
// catalog packages/wiki-sources/catalog-data/wikidata-classes.json (snapshot 2026-08-23, CC0-1.0).
export interface WikidataClass { qid: string; label: string; instanceCount: number }
export const CLASSES: WikidataClass[] = [
{
"qid": "13442814",
"label": "scholarly article",
"instanceCount": 45882453
},
{
"qid": "5",
"label": "human",
"instanceCount": 13645558
},
{
"qid": "4167836",
"label": "Wikimedia category",
"instanceCount": 5831849
},
{
"qid": "16521",
"label": "taxon",
"instanceCount": 3844128
},
{
"qid": "523",
"label": "star",
"instanceCount": 3281394
},
{
"qid": "318",
"label": "galaxy",
"instanceCount": 2094346
},
{
"qid": "4167410",
"label": "Wikimedia disambiguation page",
"instanceCount": 1528202
},
{
"qid": "113145171",
"label": "type of chemical entity",
"instanceCount": 1280245
},
{
"qid": "7187",
"label": "gene",
"instanceCount": 1225241
},
{
"qid": "3305213",
"label": "painting",
"instanceCount": 1081643
},
{
"qid": "8054",
"label": "protein",
"instanceCount": 1020498
},
{
"qid": "3331189",
"label": "version, edition or translation",
"instanceCount": 845018
},
{
"qid": "11266439",
"label": "Wikimedia template",
"instanceCount": 830148
},
{
"qid": "79007",
"label": "street",
"instanceCount": 725984
},
{
"qid": "101352",
"label": "family name",
"instanceCount": 694227
},
{
"qid": "13433827",
"label": "encyclopedia article",
"instanceCount": 688505
},
{
"qid": "486972",
"label": "human settlement",
"instanceCount": 607263
},
{
"qid": "13100073",
"label": "village of the People's Republic of China",
"instanceCount": 592642
},
{
"qid": "43229",
"label": "organization",
"instanceCount": 529166
},
{
"qid": "7725634",
"label": "literary work",
"instanceCount": 518642
}
]
export const CLASSES_SNAPSHOT = "2026-08-23"
Loading