n3 2.10.4 → 2.10.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/browser/n3.esm.min.js +5 -5
- package/browser/n3.min.js +4 -4
- package/lib/N3Writer.js +3 -1
- package/package.json +1 -1
- package/src/N3Writer.js +4 -2
package/lib/N3Writer.js
CHANGED
|
@@ -164,7 +164,9 @@ class N3Writer {
|
|
|
164
164
|
if (entity.termType !== 'NamedNode') {
|
|
165
165
|
// If it is a list head, pretty-print it
|
|
166
166
|
if (this._lists && entity.value in this._lists) entity = this.list(this._lists[entity.value]);
|
|
167
|
-
|
|
167
|
+
// Terms from this library already hold their serialization as id
|
|
168
|
+
if (entity instanceof _N3DataFactory.Term) return entity.id;
|
|
169
|
+
return entity.termType === 'Variable' ? `?${entity.value}` : `_:${entity.value}`;
|
|
168
170
|
}
|
|
169
171
|
let iri = entity.value;
|
|
170
172
|
// Use relative IRIs if requested and possible
|
package/package.json
CHANGED
package/src/N3Writer.js
CHANGED
|
@@ -163,8 +163,10 @@ export default class N3Writer {
|
|
|
163
163
|
// If it is a list head, pretty-print it
|
|
164
164
|
if (this._lists && (entity.value in this._lists))
|
|
165
165
|
entity = this.list(this._lists[entity.value]);
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
// Terms from this library already hold their serialization as id
|
|
167
|
+
if (entity instanceof Term)
|
|
168
|
+
return entity.id;
|
|
169
|
+
return entity.termType === 'Variable' ? `?${entity.value}` : `_:${entity.value}`;
|
|
168
170
|
}
|
|
169
171
|
let iri = entity.value;
|
|
170
172
|
// Use relative IRIs if requested and possible
|