glossarist 0.4.9 → 0.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glossarist",
3
- "version": "0.4.9",
3
+ "version": "0.4.10",
4
4
  "description": "JavaScript SDK for Glossarist GCR packages — read, write, validate, and manage terminology concepts",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -10,7 +10,7 @@
10
10
  // to its relatives (the ontology declares these as owl:TransitiveProperty
11
11
  // for cascading section membership).
12
12
 
13
- import { namedNode, literal, quad } from './terms.js';
13
+ import { namedNode, blankNode, literal, quad } from './terms.js';
14
14
 
15
15
  // Prefix namespaces used by this emitter. Hard-coded (not via PREFIXES)
16
16
  // because dcat and prov are absent from the JSON-LD context that
@@ -138,8 +138,10 @@ export function* datasetToQuads(input) {
138
138
 
139
139
  function* distributionToQuads(ds, dist) {
140
140
  // Distributions are blank nodes — they don't have stable identity
141
- // outside their parent dataset.
142
- const distSubject = namedNode(`_:b${deterministicId('dist', dist.id, dist.downloadUrl)}`);
141
+ // outside their parent dataset. Using blankNode() (not namedNode with
142
+ // a "_:..." string) so the n3 writer serializes them as _:bXXXX
143
+ // rather than <_:bXXXX> which would be an invalid IRI.
144
+ const distSubject = blankNode(`b${deterministicId('dist', dist.id, dist.downloadUrl)}`);
143
145
  yield quad(ds, namedNode(DCAT.distribution), distSubject);
144
146
  yield quad(distSubject, namedNode(RDF_TYPE), namedNode(DCAT.Distribution));
145
147
  yield quad(distSubject, namedNode(DCTERMS.title), literal(dist.title));