rdfjs-wrapper 0.3.0 → 0.8.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.
Files changed (57) hide show
  1. package/LICENSE.Apache-2.0.md +201 -0
  2. package/{LICENSE → LICENSE.MIT.md} +1 -1
  3. package/README.md +19 -6
  4. package/dist/TermMapping.d.ts +6 -0
  5. package/dist/TermMapping.d.ts.map +1 -0
  6. package/dist/TermMapping.js +2 -0
  7. package/dist/TermMapping.js.map +1 -0
  8. package/dist/TermMappings.d.ts +6 -0
  9. package/dist/TermMappings.d.ts.map +1 -0
  10. package/dist/TermMappings.js +12 -0
  11. package/dist/TermMappings.js.map +1 -0
  12. package/dist/ValueMapping.d.ts +5 -0
  13. package/dist/ValueMapping.d.ts.map +1 -0
  14. package/dist/ValueMapping.js +2 -0
  15. package/dist/ValueMapping.js.map +1 -0
  16. package/dist/ValueMappings.d.ts +5 -0
  17. package/dist/ValueMappings.d.ts.map +1 -0
  18. package/dist/ValueMappings.js +8 -0
  19. package/dist/ValueMappings.js.map +1 -0
  20. package/dist/Wrapper.d.ts +17 -0
  21. package/dist/Wrapper.d.ts.map +1 -0
  22. package/dist/Wrapper.js +59 -0
  23. package/dist/Wrapper.js.map +1 -0
  24. package/dist/WrappingSet.d.ts +25 -0
  25. package/dist/WrappingSet.d.ts.map +1 -0
  26. package/dist/WrappingSet.js +74 -0
  27. package/dist/WrappingSet.js.map +1 -0
  28. package/dist/mod.d.ts +7 -6
  29. package/dist/mod.d.ts.map +1 -0
  30. package/dist/mod.js +6 -6
  31. package/dist/mod.js.map +1 -1
  32. package/dist/stuff/decorators.d.ts +10 -0
  33. package/dist/stuff/decorators.d.ts.map +1 -0
  34. package/dist/stuff/decorators.js +99 -0
  35. package/dist/stuff/decorators.js.map +1 -0
  36. package/package.json +28 -40
  37. package/dist/class/context.d.ts +0 -9
  38. package/dist/class/context.js +0 -21
  39. package/dist/class/context.js.map +0 -1
  40. package/dist/class/property.d.ts +0 -20
  41. package/dist/class/property.js +0 -77
  42. package/dist/class/property.js.map +0 -1
  43. package/dist/class/property_reader.d.ts +0 -13
  44. package/dist/class/property_reader.js +0 -53
  45. package/dist/class/property_reader.js.map +0 -1
  46. package/dist/class/property_writer.d.ts +0 -8
  47. package/dist/class/property_writer.js +0 -33
  48. package/dist/class/property_writer.js.map +0 -1
  49. package/dist/class/resource.d.ts +0 -21
  50. package/dist/class/resource.js +0 -131
  51. package/dist/class/resource.js.map +0 -1
  52. package/dist/class/wrapper.d.ts +0 -25
  53. package/dist/class/wrapper.js +0 -56
  54. package/dist/class/wrapper.js.map +0 -1
  55. package/dist/vocabulary/xsd.d.ts +0 -41
  56. package/dist/vocabulary/xsd.js +0 -43
  57. package/dist/vocabulary/xsd.js.map +0 -1
@@ -1,56 +0,0 @@
1
- import { Property } from "./property.js";
2
- import { Resource } from "./resource.js";
3
- import { PropertyReader } from "./property_reader.js";
4
- import { PropertyWriter } from "./property_writer.js";
5
- export class Wrapper {
6
- #resource;
7
- #context;
8
- constructor(resource, context) {
9
- Resource.assertNode(resource);
10
- this.#resource = resource;
11
- this.#context = context;
12
- }
13
- get resource() {
14
- return this.#resource;
15
- }
16
- get factory() {
17
- return this.#context.factory;
18
- }
19
- read(s, p, o, g) {
20
- return this.#context.read(s, p, o, g);
21
- }
22
- write(q) {
23
- this.#context.write(q);
24
- }
25
- delete(q) {
26
- this.#context.delete(q);
27
- }
28
- property(iri, reader, writer) {
29
- var p = Resource.asNamedNode(iri, this.factory);
30
- return new Property(p, reader(this.#context), writer(this.resource, p, this.#context), this);
31
- }
32
- item(iri, reader, writer) {
33
- var property = this.property(iri, reader, writer);
34
- // TODO: Add options that throw, require 1:1 ...
35
- return {
36
- get: () => property.values().next().value,
37
- set: (x) => {
38
- property.clear();
39
- property.add(x);
40
- }
41
- };
42
- }
43
- stringProperty(iri) {
44
- return this.property(iri, PropertyReader.toString, PropertyWriter.fromString);
45
- }
46
- stringItem(iri) {
47
- return this.item(iri, PropertyReader.toString, PropertyWriter.fromString);
48
- }
49
- wrapperProperty(iri, w) {
50
- return this.property(iri, PropertyReader.toWrapper(w), PropertyWriter.fromWrapper(w));
51
- }
52
- wrapperItem(iri, w) {
53
- return this.item(iri, PropertyReader.toWrapper(w), PropertyWriter.fromWrapper(w));
54
- }
55
- }
56
- //# sourceMappingURL=wrapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../src/class/wrapper.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAWtD,MAAM,OAAgB,OAAO;IAC3B,SAAS,CAAuB;IAChC,QAAQ,CAAS;IAEjB,YAAmB,QAAc,EAAE,OAAgB;QACjD,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAE9B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAA;QACzB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;IACzB,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAA;IACvB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAA;IAC9B,CAAC;IAEM,IAAI,CAAC,CAAe,EAAE,CAAe,EAAE,CAAe,EAAE,CAAe;QAC5E,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IACvC,CAAC;IAEM,KAAK,CAAC,CAAO;QAClB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACxB,CAAC;IAEM,MAAM,CAAC,CAAO;QACnB,IAAI,CAAC,QAAQ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AAc,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;IACvF,CAAC;IAES,WAAW,CAAoB,GAA6B,EAAE,CAAwB;QAC9F,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;IACnF,CAAC;CACF"}
@@ -1,41 +0,0 @@
1
- export declare const XSD: {
2
- string: string;
3
- boolean: string;
4
- decimal: string;
5
- integer: string;
6
- double: string;
7
- float: string;
8
- date: string;
9
- time: string;
10
- dateTime: string;
11
- dateTimeStamp: string;
12
- gYear: string;
13
- gMonth: string;
14
- gDay: string;
15
- gYearMonth: string;
16
- gMonthDay: string;
17
- duration: string;
18
- yearMonthDuration: string;
19
- dayTimeDuration: string;
20
- byte: string;
21
- short: string;
22
- int: string;
23
- long: string;
24
- unsignedByte: string;
25
- unsignedShort: string;
26
- unsignedInt: string;
27
- unsignedLong: string;
28
- positiveInteger: string;
29
- nonNegativeInteger: string;
30
- negativeInteger: string;
31
- nonPositiveInteger: string;
32
- hexBinary: string;
33
- base64Binary: string;
34
- anyURI: string;
35
- language: string;
36
- normalizedString: string;
37
- token: string;
38
- NMTOKEN: string;
39
- Name: string;
40
- NCName: string;
41
- };
@@ -1,43 +0,0 @@
1
- const baseUri = "http://www.w3.org/2001/XMLSchema#";
2
- export const XSD = {
3
- string: baseUri.concat("string"),
4
- boolean: baseUri.concat("boolean"),
5
- decimal: baseUri.concat("decimal"),
6
- integer: baseUri.concat("integer"),
7
- double: baseUri.concat("double"),
8
- float: baseUri.concat("float"),
9
- date: baseUri.concat("date"),
10
- time: baseUri.concat("time"),
11
- dateTime: baseUri.concat("dateTime"),
12
- dateTimeStamp: baseUri.concat("dateTimeStamp"),
13
- gYear: baseUri.concat("gYear"),
14
- gMonth: baseUri.concat("gMonth"),
15
- gDay: baseUri.concat("gDay"),
16
- gYearMonth: baseUri.concat("gYearMonth"),
17
- gMonthDay: baseUri.concat("gMonthDay"),
18
- duration: baseUri.concat("duration"),
19
- yearMonthDuration: baseUri.concat("yearMonthDuration"),
20
- dayTimeDuration: baseUri.concat("dayTimeDuration"),
21
- byte: baseUri.concat("byte"),
22
- short: baseUri.concat("short"),
23
- int: baseUri.concat("int"),
24
- long: baseUri.concat("long"),
25
- unsignedByte: baseUri.concat("unsignedByte"),
26
- unsignedShort: baseUri.concat("unsignedShort"),
27
- unsignedInt: baseUri.concat("unsignedInt"),
28
- unsignedLong: baseUri.concat("unsignedLong"),
29
- positiveInteger: baseUri.concat("positiveInteger"),
30
- nonNegativeInteger: baseUri.concat("nonNegativeInteger"),
31
- negativeInteger: baseUri.concat("negativeInteger"),
32
- nonPositiveInteger: baseUri.concat("nonPositiveInteger"),
33
- hexBinary: baseUri.concat("hexBinary"),
34
- base64Binary: baseUri.concat("base64Binary"),
35
- anyURI: baseUri.concat("anyURI"),
36
- language: baseUri.concat("language"),
37
- normalizedString: baseUri.concat("normalizedString"),
38
- token: baseUri.concat("token"),
39
- NMTOKEN: baseUri.concat("NMTOKEN"),
40
- Name: baseUri.concat("Name"),
41
- NCName: baseUri.concat("NCName"),
42
- };
43
- //# sourceMappingURL=xsd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"xsd.js","sourceRoot":"","sources":["../../src/vocabulary/xsd.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG,mCAAmC,CAAC;AAEpD,MAAM,CAAC,MAAM,GAAG,GAAG;IACjB,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;IAClC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;IAChC,KAAK,EAAE,OAAO,CA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