mdld-parse 0.9.3 → 0.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/dist/README.md +4 -3
- package/dist/docs/API.md +3 -1
- package/dist/docs/Guide.md +660 -166
- package/dist/docs/LiterateRDF.md +472 -0
- package/dist/docs/Nostr.md +544 -0
- package/dist/docs/Parser.md +57 -1
- package/dist/docs/guide-m.md +56 -0
- package/dist/docs/one-page.md +322 -0
- package/dist/docs/primary-subject.md +64 -13
- package/dist/examples/Status-SHACL.md +8 -10
- package/dist/examples/demo/journal.md +110 -9
- package/dist/examples/demo/minimal.md +18 -6
- package/dist/examples/demo/project.md +90 -7
- package/dist/examples/demo/prov.md +107 -0
- package/dist/examples/demo/rdf.md +69 -0
- package/dist/examples/demo/recipe.md +79 -15
- package/dist/examples/demo/research.md +110 -30
- package/dist/examples/demo/shacl.md +161 -0
- package/dist/examples/demo/space-mission.md +109 -28
- package/dist/examples/demo/tasks.md +175 -0
- package/dist/examples/demo/xsd.md +91 -0
- package/dist/index.html +686 -260
- package/dist/index.js +474 -248
- package/dist/spec/Spec-compact.md +13 -8
- package/dist/spec/Spec-ultra.md +14 -3
- package/dist/spec/Spec.md +68 -20
- package/package.json +2 -2
- package/dist/examples/prov-o.md +0 -2367
- package/dist/examples/rdf.md +0 -827
- package/dist/examples/shacl.md +0 -3399
package/README.md
CHANGED
|
@@ -57,6 +57,7 @@ console.log(result.quads);
|
|
|
57
57
|
- **⚡ Polarity system** - Sophisticated diff authoring with `+` and `-` prefixes
|
|
58
58
|
- **📍 Origin tracking** - Complete provenance with lean quad-to-source mapping
|
|
59
59
|
- **🎯 Elevated statements** - Automatic rdf:Statement pattern detection for "golden" graph extraction
|
|
60
|
+
- **🏷️ Primary metadata** - Instant access to primarySubject, primaryType, and primaryLabel for document identity
|
|
60
61
|
|
|
61
62
|
## 🌟 What is MD-LD?
|
|
62
63
|
|
|
@@ -232,9 +233,7 @@ Parse MD-LD markdown and return RDF quads with lean origin tracking.
|
|
|
232
233
|
- `dataFactory` (object, optional) — Custom RDF/JS DataFactory
|
|
233
234
|
- `graph` (string, optional) — Named graph IRI
|
|
234
235
|
|
|
235
|
-
**Returns:** `{ quads, remove, statements, origin, context, primarySubject, md }`
|
|
236
|
-
|
|
237
|
-
> **Legacy:** `parse(text, options)` still works for backward compatibility
|
|
236
|
+
**Returns:** `{ quads, remove, statements, origin, context, primarySubject, primaryType, primaryLabel, md }`
|
|
238
237
|
|
|
239
238
|
- `quads` — Array of RDF/JS Quads (final resolved graph state)
|
|
240
239
|
- `remove` — Array of RDF/JS Quads (external retractions targeting prior state)
|
|
@@ -242,6 +241,8 @@ Parse MD-LD markdown and return RDF quads with lean origin tracking.
|
|
|
242
241
|
- `origin` — Lean origin tracking object with quadIndex for UI navigation
|
|
243
242
|
- `context` — Final context used (includes prefixes)
|
|
244
243
|
- `primarySubject` — String IRI or null (first non-fragment subject declaration)
|
|
244
|
+
- `primaryType` — String IRI or null (first rdf:type declaration)
|
|
245
|
+
- `primaryLabel` — String or null (first rdfs:label literal)
|
|
245
246
|
- `md` — Clean Markdown with all MD-LD annotations stripped (round-trip safe)
|
|
246
247
|
|
|
247
248
|
### `merge(docs, options)`
|
package/dist/README.md
CHANGED
|
@@ -57,6 +57,7 @@ console.log(result.quads);
|
|
|
57
57
|
- **⚡ Polarity system** - Sophisticated diff authoring with `+` and `-` prefixes
|
|
58
58
|
- **📍 Origin tracking** - Complete provenance with lean quad-to-source mapping
|
|
59
59
|
- **🎯 Elevated statements** - Automatic rdf:Statement pattern detection for "golden" graph extraction
|
|
60
|
+
- **🏷️ Primary metadata** - Instant access to primarySubject, primaryType, and primaryLabel for document identity
|
|
60
61
|
|
|
61
62
|
## 🌟 What is MD-LD?
|
|
62
63
|
|
|
@@ -232,9 +233,7 @@ Parse MD-LD markdown and return RDF quads with lean origin tracking.
|
|
|
232
233
|
- `dataFactory` (object, optional) — Custom RDF/JS DataFactory
|
|
233
234
|
- `graph` (string, optional) — Named graph IRI
|
|
234
235
|
|
|
235
|
-
**Returns:** `{ quads, remove, statements, origin, context, primarySubject, md }`
|
|
236
|
-
|
|
237
|
-
> **Legacy:** `parse(text, options)` still works for backward compatibility
|
|
236
|
+
**Returns:** `{ quads, remove, statements, origin, context, primarySubject, primaryType, primaryLabel, md }`
|
|
238
237
|
|
|
239
238
|
- `quads` — Array of RDF/JS Quads (final resolved graph state)
|
|
240
239
|
- `remove` — Array of RDF/JS Quads (external retractions targeting prior state)
|
|
@@ -242,6 +241,8 @@ Parse MD-LD markdown and return RDF quads with lean origin tracking.
|
|
|
242
241
|
- `origin` — Lean origin tracking object with quadIndex for UI navigation
|
|
243
242
|
- `context` — Final context used (includes prefixes)
|
|
244
243
|
- `primarySubject` — String IRI or null (first non-fragment subject declaration)
|
|
244
|
+
- `primaryType` — String IRI or null (first rdf:type declaration)
|
|
245
|
+
- `primaryLabel` — String or null (first rdfs:label literal)
|
|
245
246
|
- `md` — Clean Markdown with all MD-LD annotations stripped (round-trip safe)
|
|
246
247
|
|
|
247
248
|
### `merge(docs, options)`
|
package/dist/docs/API.md
CHANGED
|
@@ -14,13 +14,15 @@ Parse MD-LD markdown and return RDF quads.
|
|
|
14
14
|
- `dataFactory` (object, optional) — Custom RDF/JS DataFactory
|
|
15
15
|
- `graph` (string, optional) — Named graph IRI
|
|
16
16
|
|
|
17
|
-
**Returns:** `{ quads, context, primarySubject, origin, remove, statements }`
|
|
17
|
+
**Returns:** `{ quads, context, primarySubject, primaryType, primaryLabel, origin, remove, statements }`
|
|
18
18
|
|
|
19
19
|
- `quads` — Array of RDF/JS Quads (final resolved graph state)
|
|
20
20
|
- `remove` — Array of RDF/JS Quads (external retractions targeting prior state)
|
|
21
21
|
- `origin` — Lean origin tracking object with quadIndex for UI navigation
|
|
22
22
|
- `context` — Final context used (includes prefixes)
|
|
23
23
|
- `primarySubject` — String IRI or null (first non-fragment subject declaration)
|
|
24
|
+
- `primaryType` — String IRI or null (first rdf:type declaration)
|
|
25
|
+
- `primaryLabel` — String or null (first rdfs:label literal)
|
|
24
26
|
|
|
25
27
|
> Legacy: `parse(text, options)` supported for backward compatibility (deprecated)
|
|
26
28
|
|