mdld-parse 0.3.1 → 0.3.3
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 +11 -11
- package/package.json +5 -5
- package/src/index.js +10 -0
- package/src/parse.js +788 -0
- package/src/serialize.js +531 -0
- package/src/utils.js +305 -0
- package/index.js +0 -1364
package/README.md
CHANGED
|
@@ -91,8 +91,8 @@ Each predicate form determines the graph edge:
|
|
|
91
91
|
| Form | Edge | Example | Meaning |
|
|
92
92
|
|-------|---------|------------------------------|------------------|
|
|
93
93
|
| `p` | S → L | `[Alice] {name}` | literal property |
|
|
94
|
-
| `?p` | S → O | `[NASA]
|
|
95
|
-
| `!p` | O → S
|
|
94
|
+
| `?p` | S → O | `[NASA] {=ex:nasa ?org}` | object property |
|
|
95
|
+
| `!p` | O → S | `[Parent] {=ex:p !hasPart}` | reverse object |
|
|
96
96
|
|
|
97
97
|
## Syntax Reference
|
|
98
98
|
|
|
@@ -248,9 +248,9 @@ ex:book schema:hasPart ex:part .
|
|
|
248
248
|
### Prefix Declarations
|
|
249
249
|
|
|
250
250
|
```markdown
|
|
251
|
-
[ex]
|
|
252
|
-
[foaf]
|
|
253
|
-
[@vocab]
|
|
251
|
+
[ex] <http://example.org/>
|
|
252
|
+
[foaf] <http://xmlns.com/foaf/0.1/>
|
|
253
|
+
[@vocab] <http://schema.org/>
|
|
254
254
|
|
|
255
255
|
# Person {=ex:alice .foaf:Person}
|
|
256
256
|
```
|
|
@@ -282,7 +282,7 @@ Parse MD-LD markdown and return RDF quads with origin tracking.
|
|
|
282
282
|
const result = parse(
|
|
283
283
|
`# Article {=ex:article .Article}
|
|
284
284
|
|
|
285
|
-
[Alice]
|
|
285
|
+
[Alice] {=ex:alice ?author}`,
|
|
286
286
|
{ context: { ex: 'http://example.org/' } }
|
|
287
287
|
);
|
|
288
288
|
|
|
@@ -432,14 +432,14 @@ Therefore, the algebra is **closed**.
|
|
|
432
432
|
```markdown
|
|
433
433
|
# Meeting Notes {=urn:note:2024-01-15 .Meeting}
|
|
434
434
|
|
|
435
|
-
Attendees: {?attendee}
|
|
435
|
+
Attendees: {?attendee name}
|
|
436
436
|
|
|
437
|
-
- Alice {=urn:person:alice
|
|
438
|
-
- Bob {=urn:person:bob
|
|
437
|
+
- Alice {=urn:person:alice}
|
|
438
|
+
- Bob {=urn:person:bob}
|
|
439
439
|
|
|
440
|
-
Action items: {?actionItem}
|
|
440
|
+
Action items: {?actionItem name}
|
|
441
441
|
|
|
442
|
-
- Review proposal {=urn:task:1
|
|
442
|
+
- Review proposal {=urn:task:1}
|
|
443
443
|
```
|
|
444
444
|
|
|
445
445
|
### Developer Documentation
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mdld-parse",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
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",
|
|
7
7
|
"exports": {
|
|
8
|
-
".": "./index.js"
|
|
8
|
+
".": "./src/index.js"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
|
-
"index.js"
|
|
11
|
+
"index.js",
|
|
12
|
+
"src"
|
|
12
13
|
],
|
|
13
14
|
"scripts": {
|
|
14
|
-
"test": "node tests.js"
|
|
15
|
-
"spec": "node validate-spec.js"
|
|
15
|
+
"test": "node tests/index.js"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|
|
18
18
|
"mdld",
|