mdld-parse 0.3.4 → 0.3.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 +3 -3
- package/package.json +1 -1
- package/src/utils.js +3 -2
package/README.md
CHANGED
|
@@ -265,7 +265,7 @@ Parse MD-LD markdown and return RDF quads with origin tracking.
|
|
|
265
265
|
|
|
266
266
|
- `markdown` (string) — MD-LD formatted text
|
|
267
267
|
- `options` (object, optional):
|
|
268
|
-
- `context` (object) — Prefix mappings (default: `{ '@vocab': 'http://
|
|
268
|
+
- `context` (object) — Prefix mappings (default: `{ '@vocab': 'http://www.w3.org/2000/01/rdf-schema#', rdf, rdfs, xsd, schema }`)
|
|
269
269
|
- `dataFactory` (object) — Custom RDF/JS DataFactory
|
|
270
270
|
|
|
271
271
|
**Returns:** `{ quads, origin, context }`
|
|
@@ -280,7 +280,7 @@ Parse MD-LD markdown and return RDF quads with origin tracking.
|
|
|
280
280
|
|
|
281
281
|
```javascript
|
|
282
282
|
const result = parse(
|
|
283
|
-
`# Article {=ex:article .Article}
|
|
283
|
+
`# Article {=ex:article .ex:Article}
|
|
284
284
|
|
|
285
285
|
[Alice] {=ex:alice ?author}`,
|
|
286
286
|
{ context: { ex: 'http://example.org/' } }
|
|
@@ -291,7 +291,7 @@ console.log(result.quads);
|
|
|
291
291
|
// {
|
|
292
292
|
// subject: { termType: 'NamedNode', value: 'http://example.org/article' },
|
|
293
293
|
// predicate: { termType: 'NamedNode', value: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' },
|
|
294
|
-
// object: { termType: 'NamedNode', value: 'http://
|
|
294
|
+
// object: { termType: 'NamedNode', value: 'http://example.org/Article' }
|
|
295
295
|
// },
|
|
296
296
|
// ...
|
|
297
297
|
// ]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mdld-parse",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
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",
|
package/src/utils.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export const DEFAULT_CONTEXT = {
|
|
2
|
-
'@vocab':
|
|
2
|
+
'@vocab': "http://www.w3.org/2000/01/rdf-schema#",
|
|
3
3
|
rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
|
|
4
4
|
rdfs: 'http://www.w3.org/2000/01/rdf-schema#',
|
|
5
5
|
xsd: 'http://www.w3.org/2001/XMLSchema#',
|
|
6
|
-
|
|
6
|
+
sh: "http://www.w3.org/ns/shacl#",
|
|
7
|
+
prov: 'http://www.w3.org/ns/prov#'
|
|
7
8
|
};
|
|
8
9
|
|
|
9
10
|
export const DataFactory = {
|