n3 2.2.16 → 2.3.0
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 +10 -0
- package/browser/n3.esm.min.js +6 -6
- package/browser/n3.min.js +1 -1
- package/lib/IRIs.js +1 -0
- package/lib/N3DataFactory.js +6 -1
- package/package.json +1 -1
- package/src/IRIs.js +1 -0
- package/src/N3DataFactory.js +6 -1
package/README.md
CHANGED
|
@@ -78,6 +78,16 @@ console.log(myQuad.object.datatype.value); // http://www.w3.org/1999/02/22-rdf-s
|
|
|
78
78
|
console.log(myQuad.object.language); // en
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
+
When no language or datatype is supplied, `literal` automatically assigns XSD datatypes
|
|
82
|
+
to JavaScript booleans, numbers, and valid `Date` objects. Dates are converted to UTC
|
|
83
|
+
using `Date.prototype.toISOString()` and receive the `xsd:dateTime` datatype:
|
|
84
|
+
|
|
85
|
+
```JavaScript
|
|
86
|
+
const created = literal(new Date('2017-04-27T14:39:48.901Z'));
|
|
87
|
+
console.log(created.value); // 2017-04-27T14:39:48.901Z
|
|
88
|
+
console.log(created.datatype.value); // http://www.w3.org/2001/XMLSchema#dateTime
|
|
89
|
+
```
|
|
90
|
+
|
|
81
91
|
Always create terms through a data factory such as `N3.DataFactory`,
|
|
82
92
|
and not by instantiating the term classes directly:
|
|
83
93
|
direct construction is deprecated,
|