mdld-parse 0.4.2 → 0.5.0
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 +14 -2
- package/package.json +1 -1
- package/src/parse.js +410 -311
- package/src/serialize.js +527 -0
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ ex:armstrong schema:name "Neil Armstrong" .
|
|
|
40
40
|
- **Four predicate forms**: `p` (S→L), `?p` (S→O), `!p` (O→S)
|
|
41
41
|
- **Type declarations**: `.Class` for rdf:type triples
|
|
42
42
|
- **Datatypes & language**: `^^xsd:date` and `@en` support
|
|
43
|
-
- **Lists**: Explicit subject declarations
|
|
43
|
+
- **Lists**: Explicit subject declarations and numbered ordered lists with `rdf:List` support
|
|
44
44
|
- **Fragments**: Built-in document structuring with `{=#fragment}`
|
|
45
45
|
- **Round-trip serialization**: Markdown ↔ RDF ↔ Markdown preserves structure
|
|
46
46
|
|
|
@@ -184,7 +184,7 @@ ex:armstrong a schema:Person .
|
|
|
184
184
|
|
|
185
185
|
### Lists
|
|
186
186
|
|
|
187
|
-
Lists require explicit subjects per item:
|
|
187
|
+
Lists require explicit subjects per item. Use numbered ordered lists for `rdf:List` structures:
|
|
188
188
|
|
|
189
189
|
```markdown
|
|
190
190
|
# Recipe {=ex:recipe}
|
|
@@ -193,12 +193,24 @@ Ingredients: {?ingredient .Ingredient}
|
|
|
193
193
|
|
|
194
194
|
- Flour {=ex:flour name}
|
|
195
195
|
- Water {=ex:water name}
|
|
196
|
+
|
|
197
|
+
## Status Values {=ex:statusValues}
|
|
198
|
+
Status values: {?ex:in .ex:StatusType label}
|
|
199
|
+
1. Active {=ex:Active}
|
|
200
|
+
2. Pending {=ex:Pending}
|
|
201
|
+
3. Inactive {=ex:Inactive}
|
|
196
202
|
```
|
|
197
203
|
|
|
198
204
|
```turtle
|
|
199
205
|
ex:recipe schema:ingredient ex:flour, ex:water .
|
|
200
206
|
ex:flour a schema:Ingredient ; schema:name "Flour" .
|
|
201
207
|
ex:water a schema:Ingredient ; schema:name "Water" .
|
|
208
|
+
|
|
209
|
+
# Ordered list generates W3C RDF Collections
|
|
210
|
+
ex:statusValues ex:in ex:statusValues#list-1-1 .
|
|
211
|
+
ex:statusValues#list-1-1 rdf:first ex:Active ; rdf:rest ex:statusValues#list-1-2 .
|
|
212
|
+
ex:statusValues#list-1-2 rdf:first ex:Pending ; rdf:rest ex:statusValues#list-1-3 .
|
|
213
|
+
ex:statusValues#list-1-3 rdf:first ex:Inactive ; rdf:rest rdf:nil .
|
|
202
214
|
```
|
|
203
215
|
|
|
204
216
|
### Code Blocks
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mdld-parse",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "A standards-compliant parser for **MD-LD (Markdown-Linked Data)** — a human-friendly RDF authoring format that extends Markdown with semantic annotations.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|