n3 2.2.16 → 2.4.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/LICENSE.md +1 -1
- package/README.md +12 -3
- 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/lib/N3Parser.js +82 -41
- package/package.json +1 -1
- package/src/IRIs.js +1 -0
- package/src/N3DataFactory.js +6 -1
- package/src/N3Parser.js +93 -40
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# License
|
|
2
2
|
The MIT License (MIT)
|
|
3
|
-
Copyright ©2012–present
|
|
3
|
+
Copyright ©2012–present N3.js contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
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,
|
|
@@ -599,8 +609,7 @@ The N3.js submodules are compatible with the following [RDF.js](http://rdf.js.or
|
|
|
599
609
|
[`DatasetCore`](https://rdf.js.org/dataset-spec/#datasetcore-interface)
|
|
600
610
|
|
|
601
611
|
## License and contributions
|
|
602
|
-
|
|
603
|
-
and released under the [MIT License](https://github.com/rdfjs/N3.js/blob/master/LICENSE.md).
|
|
612
|
+
N3.js is released under the [MIT License](https://github.com/rdfjs/N3.js/blob/master/LICENSE.md).
|
|
604
613
|
|
|
605
614
|
Contributions are welcome, and bug reports or pull requests are always helpful.
|
|
606
|
-
If you plan to implement a larger feature, it's best to contact
|
|
615
|
+
If you plan to implement a larger feature, it's best to contact us first.
|