mdld-parse 0.2.9 → 0.2.10
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 +2 -2
- package/index.js +8 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ MD-LD allows you to author RDF graphs directly in Markdown using explicit `{...}
|
|
|
14
14
|
# Apollo 11 {=ex:apollo11 .SpaceMission}
|
|
15
15
|
|
|
16
16
|
Launch: [1969-07-16] {startDate ^^xsd:date}
|
|
17
|
-
Crew: [Neil Armstrong] {=?ex:armstrong ?crewMember
|
|
17
|
+
Crew: [Neil Armstrong] {=?ex:armstrong ?crewMember name}
|
|
18
18
|
Description: [First crewed Moon landing] {description}
|
|
19
19
|
|
|
20
20
|
[Section] {=?#overview ?hasPart}
|
|
@@ -29,7 +29,7 @@ ex:apollo11 a schema:SpaceMission ;
|
|
|
29
29
|
schema:crewMember ex:armstrong ;
|
|
30
30
|
schema:description "First crewed Moon landing" .
|
|
31
31
|
|
|
32
|
-
ex:armstrong schema:
|
|
32
|
+
ex:armstrong schema:name "Neil Armstrong" .
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
## Core Features
|
package/index.js
CHANGED
|
@@ -660,11 +660,17 @@ function processListContext(contextSem, listTokens, state, contextSubject = null
|
|
|
660
660
|
|
|
661
661
|
contextSem.predicates.forEach(pred => {
|
|
662
662
|
const P = state.df.namedNode(expandIRI(pred.iri, state.ctx));
|
|
663
|
-
|
|
663
|
+
|
|
664
|
+
// According to MD-LD spec: list predicates that connect to item subjects MUST use object predicate forms (?p or ^?p)
|
|
665
|
+
// Literal predicate forms (p, ^p) in list scope emit no quads
|
|
666
|
+
if (pred.form === '^?') {
|
|
667
|
+
// Reverse object property: O —p→ S
|
|
664
668
|
emitQuad(state.quads, state.origin.quadIndex, 'list-context', itemSubject, P, contextSubject, state.df);
|
|
665
|
-
} else {
|
|
669
|
+
} else if (pred.form === '?') {
|
|
670
|
+
// Object property: S —p→ O
|
|
666
671
|
emitQuad(state.quads, state.origin.quadIndex, 'list-context', contextSubject, P, itemSubject, state.df);
|
|
667
672
|
}
|
|
673
|
+
// Note: pred.form === '' and pred.form === '^' are intentionally ignored (literal predicate forms)
|
|
668
674
|
});
|
|
669
675
|
|
|
670
676
|
const prevSubject = state.currentSubject;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mdld-parse",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
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",
|