Skip to content

Commit 02bc3ad

Browse files
committed
Fix audit findings on the Astro port
- HIGH: graph island fetched /lokfgraph.json (BASE_URL has no trailing slash) — join with a slash so it fetches /lokf/graph.json; the dev server masked this, the built site was broken - HIGH: restore dropped sections on guide/concepts (Bundle structure + the root index.md frontmatter + Body) — the POC page had been abbreviated - HIGH: getting-started 'Work on the docs' now shows the Astro npm commands, not the removed mkdocs stack - MED: re-add the 'Draft profile / not affiliated with Google' disclaimer to the home page (Starlight Aside) + restore the 'concept at a glance' example (surfacing the previously-orphaned concept-glance partial) - MED: README docs link -> the real deploy host www.nolan-nichols.com/lokf/ - tutorial 'Visualize it' now points at lokf serve + lokf export, not the removed MkDocs hook Links + security audit came back clean. astro build green (21 pages); verified in-browser the graph fetches /lokf/graph.json (200, 6 nodes).
1 parent 2c7f4da commit 02bc3ad

6 files changed

Lines changed: 83 additions & 20 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ontology are all generated from that single source.
99

1010
> One sentence: *write OKF markdown, get a queryable knowledge graph for free.*
1111
12-
**Documentation:** <https://lokf.nolan-nichols.com/>
12+
**Documentation:** <https://www.nolan-nichols.com/lokf/>
1313

1414
## Why
1515

web/src/components/KnowledgeGraph.astro

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
// node opens its details. Themed with Starlight's CSS variables.
66
---
77

8-
<div class="lokf-graph" data-graph-src={import.meta.env.BASE_URL + "graph.json"}>
8+
<div
9+
class="lokf-graph"
10+
data-graph-src={import.meta.env.BASE_URL.replace(/\/$/, "") + "/graph.json"}
11+
>
912
<div class="lokf-graph__controls">
1013
<input
1114
type="search"

web/src/content/docs/getting-started.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,16 @@ just docs-build # strict build, exactly as CI runs it
9191
```
9292

9393
</TabItem>
94-
<TabItem label="uv">
94+
<TabItem label="npm">
9595

9696
```bash
97-
uv run --group docs mkdocs serve
98-
uv run --group docs mkdocs build --strict
97+
cd web && npm install && npm run dev # live-reloading dev server
98+
cd web && npm ci && npm run build # strict build, exactly as CI runs it
9999
```
100100

101101
</TabItem>
102102
</Tabs>
103+
104+
The docs site is an [Astro Starlight](https://starlight.astro.build/) project
105+
in `web/`; the graph data and API reference are generated from the `lokf`
106+
package by a prebuild step.
Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
title: Bundles & concepts
33
description: How a LOKF bundle is laid out and what a concept looks like.
4+
sidebar:
5+
order: 1
46
---
57

68
import { Content as CoreFields } from "../../../generated/core-fields-table.md";
@@ -9,24 +11,61 @@ LOKF keeps OKF's authoring model intact: a **knowledge bundle** is a directory
911
tree of markdown files, each file describing one **concept** with a small YAML
1012
frontmatter block. Everything here is readable with `cat` and diffable in git.
1113

14+
## Bundle structure
15+
16+
Identical to OKF §3. `index.md` and `log.md` remain reserved; distribution as a
17+
git repo is recommended. LOKF adds **optional keys to the bundle-root
18+
`index.md` frontmatter** — the one place OKF already permits frontmatter in an
19+
index:
20+
21+
```yaml title="index.md (bundle root)"
22+
---
23+
lokf_version: "0.1" # LOKF version this bundle targets
24+
okf_version: "0.1" # OKF version it remains compatible with
25+
base_iri: https://acme.example/knowledge/ # resolves Concept IDs to Concept IRIs
26+
context: https://w3id.org/lokf/context.jsonld # the @context to attach to concepts
27+
title: Acme Knowledge Bundle
28+
description: Canonical, agent-readable knowledge for Acme's data org.
29+
license: https://creativecommons.org/licenses/by/4.0/
30+
publisher:
31+
type: Organization
32+
id: https://acme.example
33+
name: Acme Corp
34+
---
35+
```
36+
37+
:::note[Plain OKF consumers are unaffected]
38+
A consumer that ignores these keys sees a perfectly ordinary OKF bundle. A
39+
semantic consumer uses `base_iri` + `context` to lift the whole bundle into RDF.
40+
:::
41+
1242
## Concept documents
1343

1444
Every concept is a UTF-8 markdown file: a YAML **frontmatter** block followed
1545
by a markdown **body**, exactly as in OKF. LOKF specifies what the frontmatter
16-
keys *mean* by mapping each to an RDF property. `type` is the only required
17-
field; all others are optional.
46+
keys *mean* by mapping each to an RDF property.
47+
48+
### Core frontmatter fields
49+
50+
`type` is the only required field (as in OKF). All others are optional.
1851

1952
<CoreFields />
2053

2154
(`*` = multivalued.)
2255

23-
:::note[Permissive by design]
56+
:::tip[Permissive by design]
2457
Producers MAY add any other keys; consumers MUST preserve unknown keys and
25-
MUST NOT reject documents that carry them. Missing optional fields, unknown
26-
`type` values, and broken cross-links MUST NOT cause rejection either.
58+
MUST NOT reject documents that carry them (OKF §4.1). Missing optional fields,
59+
unknown `type` values, and broken cross-links MUST NOT cause rejection either.
2760
:::
2861

62+
### Body
63+
64+
Unchanged from OKF §4.2. Standard markdown, structural headings preferred. The
65+
conventional headings `# Schema`, `# Examples`, and `# Citations` retain their
66+
OKF meaning. The body is mapped to `schema:text` in the RDF projection.
67+
2968
## Next
3069

3170
- Give links meaning with [typed relationships](/lokf/guide/relationships/).
32-
- See the whole vocabulary in the [type reference](/lokf/guide/types/).
71+
- Pick the right class from the [type vocabulary](/lokf/guide/types/).

web/src/content/docs/index.mdx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ hero:
1818
variant: minimal
1919
---
2020

21-
import { Card, CardGrid } from '@astrojs/starlight/components';
21+
import { Card, CardGrid, Aside } from '@astrojs/starlight/components';
22+
import { Content as ConceptGlance } from '../../generated/concept-glance.md';
2223

2324
LOKF keeps OKF's markdown-plus-frontmatter authoring model but binds every
2425
concept, field, and relationship to **schema.org, W3C DCAT, and W3C PROV-O**,
@@ -27,6 +28,15 @@ losslessly to **RDF**. The format is defined once in **LinkML**; the JSON-LD
2728
context, JSON Schema, SHACL shapes, and OWL ontology are all generated from
2829
that single source.
2930

31+
## A concept at a glance
32+
33+
Ordinary OKF markdown, where every key has a defined RDF meaning:
34+
35+
<ConceptGlance />
36+
37+
Attach the published `lokf.context.jsonld` and this expands to RDF triples
38+
using `schema:`, `prov:`, `dcterms:`, and `lokf:` predicates — no separate file.
39+
3040
<CardGrid>
3141
<Card title="Convert" icon="seti:markdown">
3242
`lokf convert` projects a concept or a whole bundle to Turtle,
@@ -45,3 +55,11 @@ that single source.
4555
toolkit.
4656
</Card>
4757
</CardGrid>
58+
59+
<Aside type="caution" title="Draft profile">
60+
LOKF v0.1 is a **draft profile** and is **not affiliated with or endorsed by
61+
Google**. "Open Knowledge Format" / "OKF" refer to the format published by
62+
Google Cloud
63+
([`GoogleCloudPlatform/knowledge-catalog`](https://github.com/GoogleCloudPlatform/knowledge-catalog));
64+
LOKF extends it under its open terms.
65+
</Aside>

web/src/content/docs/toolkit/tutorial.mdx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -281,14 +281,13 @@ json.dump(to_cytoscape(bundle), open("graph.json", "w"), indent=2)
281281
EOF
282282
```
283283

284-
This site feeds the same output to a small MkDocs hook
285-
([`docs/hooks/lokf_hooks.py`](https://github.com/nicholsn/lokf/blob/main/docs/hooks/lokf_hooks.py))
286-
that emits `assets/graph.json` at build time and renders it with Cytoscape.js
287-
— point the hook's bundle path at `mykb/` and you have a graph page for your
288-
own knowledge base. The same hook also injects the output of
289-
`lokf.export.dataset_search_jsonld()` — schema.org `Dataset` JSON-LD for each
290-
Dataset/Table concept — into the HTML, making your datasets discoverable by
291-
search engines.
284+
Or skip the file entirely: [`lokf serve mykb/`](/lokf/toolkit/serve/) publishes
285+
a live graph explorer (and a SPARQL endpoint) for your bundle with no build
286+
step. This documentation site uses the same projection — the
287+
[`lokf export`](/lokf/reference/api/) command emits `graph.json` and the
288+
schema.org `Dataset` JSON-LD (from `lokf.export.dataset_search_jsonld()`) that
289+
its knowledge-graph page and `<head>` consume, so your datasets are
290+
discoverable by search engines.
292291

293292
## Recap
294293

0 commit comments

Comments
 (0)