rdflib 2.2.21 → 2.2.22-0de51c50

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 (115) hide show
  1. package/dist/rdflib.min.js +1 -1
  2. package/dist/rdflib.min.js.LICENSE.txt +13 -1
  3. package/dist/rdflib.min.js.map +1 -1
  4. package/esm/blank-node.js +3 -27
  5. package/esm/collection.js +7 -29
  6. package/esm/default-graph.js +1 -15
  7. package/esm/empty.js +0 -13
  8. package/esm/factories/canonical-data-factory.js +5 -40
  9. package/esm/factories/extended-term-factory.js +0 -11
  10. package/esm/factories/factory-types.js +2 -1
  11. package/esm/factories/rdflib-data-factory.js +0 -8
  12. package/esm/fetcher.js +257 -481
  13. package/esm/formula.js +43 -142
  14. package/esm/index.js +19 -36
  15. package/esm/jsonldparser.js +20 -29
  16. package/esm/jsonparser.js +0 -7
  17. package/esm/lists.js +18 -33
  18. package/esm/literal.js +10 -42
  19. package/esm/n3parser.js +38 -351
  20. package/esm/named-node.js +8 -27
  21. package/esm/namespace.js +0 -1
  22. package/esm/node-internal.js +11 -24
  23. package/esm/node.js +1 -6
  24. package/esm/parse.js +10 -17
  25. package/esm/patch-parser.js +9 -29
  26. package/esm/query-to-sparql.js +0 -18
  27. package/esm/query.js +50 -133
  28. package/esm/rdfaparser.js +72 -210
  29. package/esm/rdfxmlparser.js +31 -128
  30. package/esm/serialize.js +8 -33
  31. package/esm/serializer.js +122 -286
  32. package/esm/sparql-to-query.js +44 -134
  33. package/esm/statement.js +8 -19
  34. package/esm/store.js +109 -280
  35. package/esm/types.js +3 -2
  36. package/esm/update-manager.js +110 -246
  37. package/esm/updates-via.js +0 -27
  38. package/esm/uri.js +6 -50
  39. package/esm/utils/default-graph-uri.js +1 -0
  40. package/esm/utils/termValue.js +0 -1
  41. package/esm/utils/terms.js +15 -16
  42. package/esm/utils-js.js +16 -57
  43. package/esm/utils.js +4 -15
  44. package/esm/variable.js +0 -20
  45. package/lib/blank-node.js +3 -28
  46. package/lib/class-order.js +0 -1
  47. package/lib/collection.js +7 -34
  48. package/lib/default-graph.js +0 -20
  49. package/lib/empty.js +0 -18
  50. package/lib/factories/canonical-data-factory.js +4 -51
  51. package/lib/factories/extended-term-factory.js +0 -18
  52. package/lib/factories/factory-types.d.ts +6 -6
  53. package/lib/factories/factory-types.js +0 -3
  54. package/lib/factories/rdflib-data-factory.js +0 -12
  55. package/lib/fetcher.d.ts +6 -6
  56. package/lib/fetcher.js +258 -470
  57. package/lib/formula.d.ts +1 -1
  58. package/lib/formula.js +43 -151
  59. package/lib/index.d.ts +1 -2
  60. package/lib/index.js +14 -82
  61. package/lib/jsonldparser.js +19 -33
  62. package/lib/jsonparser.js +0 -9
  63. package/lib/lists.js +14 -39
  64. package/lib/literal.js +10 -49
  65. package/lib/log.d.ts +0 -6
  66. package/lib/log.js +0 -1
  67. package/lib/n3parser.d.ts +1 -0
  68. package/lib/n3parser.js +39 -359
  69. package/lib/named-node.js +7 -35
  70. package/lib/namespace.js +0 -3
  71. package/lib/node-internal.js +11 -21
  72. package/lib/node.js +1 -11
  73. package/lib/parse.d.ts +1 -1
  74. package/lib/parse.js +8 -27
  75. package/lib/patch-parser.js +10 -33
  76. package/lib/query-to-sparql.js +0 -23
  77. package/lib/query.js +46 -152
  78. package/lib/rdfaparser.js +72 -220
  79. package/lib/rdfxmlparser.js +31 -132
  80. package/lib/serialize.d.ts +1 -1
  81. package/lib/serialize.js +8 -43
  82. package/lib/serializer.d.ts +1 -0
  83. package/lib/serializer.js +121 -297
  84. package/lib/sparql-to-query.js +42 -167
  85. package/lib/statement.js +8 -24
  86. package/lib/store.d.ts +2 -2
  87. package/lib/store.js +102 -282
  88. package/lib/tf-types.d.ts +4 -4
  89. package/lib/types.d.ts +8 -8
  90. package/lib/types.js +3 -3
  91. package/lib/update-manager.d.ts +2 -2
  92. package/lib/update-manager.js +110 -254
  93. package/lib/updates-via.js +0 -30
  94. package/lib/uri.js +5 -58
  95. package/lib/utils/default-graph-uri.js +1 -3
  96. package/lib/utils/termValue.js +0 -2
  97. package/lib/utils/terms.js +15 -34
  98. package/lib/utils-js.js +16 -80
  99. package/lib/utils.js +4 -21
  100. package/lib/variable.js +0 -25
  101. package/lib/xsd-internal.js +0 -3
  102. package/lib/xsd.js +0 -4
  103. package/package.json +40 -39
  104. package/src/fetcher.ts +2 -2
  105. package/src/index.ts +0 -2
  106. package/src/jsonldparser.js +13 -4
  107. package/src/n3parser.js +12 -4
  108. package/src/serialize.ts +4 -11
  109. package/src/serializer.js +24 -0
  110. package/src/update-manager.ts +18 -7
  111. package/changes.txt +0 -59
  112. package/esm/convert.js +0 -61
  113. package/lib/convert.d.ts +0 -2
  114. package/lib/convert.js +0 -77
  115. package/src/convert.js +0 -70
package/lib/tf-types.d.ts CHANGED
@@ -142,10 +142,10 @@ export interface RdfJsDataFactory {
142
142
  supports: SupportTable;
143
143
  }
144
144
  /** A RDF/JS spec Subject */
145
- export declare type Quad_Subject = NamedNode | BlankNode | Variable;
145
+ export type Quad_Subject = NamedNode | BlankNode | Variable;
146
146
  /** A RDF/JS spec Predicate */
147
- export declare type Quad_Predicate = NamedNode | Variable;
147
+ export type Quad_Predicate = NamedNode | Variable;
148
148
  /** A RDF/JS spec Object */
149
- export declare type Quad_Object = NamedNode | BlankNode | Literal | Variable | Term;
149
+ export type Quad_Object = NamedNode | BlankNode | Literal | Variable | Term;
150
150
  /** A RDF/JS spec Graph */
151
- export declare type Quad_Graph = NamedNode | DefaultGraph | BlankNode | Variable;
151
+ export type Quad_Graph = NamedNode | DefaultGraph | BlankNode | Variable;
package/lib/types.d.ts CHANGED
@@ -19,7 +19,7 @@ export declare const DefaultGraphTermType: "DefaultGraph";
19
19
  export declare const CollectionTermType: "Collection";
20
20
  export declare const EmptyTermType: "Empty";
21
21
  export declare const GraphTermType: "Graph";
22
- export declare type TermType = typeof NamedNodeTermType | typeof BlankNodeTermType | typeof LiteralTermType | typeof VariableTermType | typeof DefaultGraphTermType | typeof CollectionTermType | typeof EmptyTermType | typeof GraphTermType;
22
+ export type TermType = typeof NamedNodeTermType | typeof BlankNodeTermType | typeof LiteralTermType | typeof VariableTermType | typeof DefaultGraphTermType | typeof CollectionTermType | typeof EmptyTermType | typeof GraphTermType;
23
23
  export declare const HTMLContentType: "text/html";
24
24
  export declare const JSONLDContentType: "application/ld+json";
25
25
  export declare const N3ContentType: "text/n3";
@@ -36,9 +36,9 @@ export declare const XHTMLContentType: "application/xhtml+xml";
36
36
  /**
37
37
  * A valid mime type header
38
38
  */
39
- export declare type ContentType = typeof RDFXMLContentType | typeof HTMLContentType | typeof JSONLDContentType | typeof N3ContentType | typeof N3LegacyContentType | typeof NQuadsAltContentType | typeof NQuadsContentType | typeof SPARQLUpdateContentType | typeof SPARQLUpdateSingleMatchContentType | typeof TurtleContentType | typeof TurtleLegacyContentType | typeof XHTMLContentType;
39
+ export type ContentType = typeof RDFXMLContentType | typeof HTMLContentType | typeof JSONLDContentType | typeof N3ContentType | typeof N3LegacyContentType | typeof NQuadsAltContentType | typeof NQuadsContentType | typeof SPARQLUpdateContentType | typeof SPARQLUpdateSingleMatchContentType | typeof TurtleContentType | typeof TurtleLegacyContentType | typeof XHTMLContentType;
40
40
  /** A type for values that serves as inputs */
41
- export declare type ValueType = Term | Node | Date | string | number | boolean | undefined | null | Collection;
41
+ export type ValueType = Term | Node | Date | string | number | boolean | undefined | null | Collection;
42
42
  /**
43
43
  * In this project, there exist two types for the same kind of RDF concept.
44
44
  * We have RDF/JS spec types (standardized, generic), and RDFlib types (internal, specific).
@@ -48,18 +48,18 @@ export declare type ValueType = Term | Node | Date | string | number | boolean |
48
48
  * Variables are missing, and the statement requires specific types of terms (e.g. NamedNode instead of Term).
49
49
  */
50
50
  /** An RDF/JS Subject */
51
- export declare type SubjectType = RDFlibBlankNode | RDFlibNamedNode | RDFlibVariable;
51
+ export type SubjectType = RDFlibBlankNode | RDFlibNamedNode | RDFlibVariable;
52
52
  /** An RDF/JS Predicate */
53
- export declare type PredicateType = RDFlibNamedNode | RDFlibVariable;
53
+ export type PredicateType = RDFlibNamedNode | RDFlibVariable;
54
54
  /** An RDF/JS Object */
55
- export declare type ObjectType = RDFlibNamedNode | RDFlibLiteral | Collection | RDFlibBlankNode | RDFlibVariable | Empty;
55
+ export type ObjectType = RDFlibNamedNode | RDFlibLiteral | Collection | RDFlibBlankNode | RDFlibVariable | Empty;
56
56
  /** An RDF/JS Graph */
57
- export declare type GraphType = RDFlibDefaultGraph | RDFlibNamedNode | RDFlibVariable;
57
+ export type GraphType = RDFlibDefaultGraph | RDFlibNamedNode | RDFlibVariable;
58
58
  export interface Bindings {
59
59
  [id: string]: Term;
60
60
  }
61
61
  /** All the types that a .fromValue() method might return */
62
- export declare type FromValueReturns<C extends Node = any> = Term | undefined | null | Collection<C>;
62
+ export type FromValueReturns<C extends Node = any> = Term | undefined | null | Collection<C>;
63
63
  export interface IRDFlibDataFactory extends DataFactory<RDFlibNamedNode | RDFlibBlankNode | RDFlibLiteral | Collection | Statement> {
64
64
  fetcher: (store: IndexedFormula, options: any) => Fetcher;
65
65
  lit: (val: string, lang?: string, dt?: NamedNode) => RDFlibLiteral;
package/lib/types.js CHANGED
@@ -12,8 +12,8 @@ var LiteralTermType = "Literal";
12
12
  exports.LiteralTermType = LiteralTermType;
13
13
  var VariableTermType = "Variable";
14
14
  exports.VariableTermType = VariableTermType;
15
- var DefaultGraphTermType = "DefaultGraph"; // Non-RDF/JS types:
16
-
15
+ var DefaultGraphTermType = "DefaultGraph";
16
+ // Non-RDF/JS types:
17
17
  exports.DefaultGraphTermType = DefaultGraphTermType;
18
18
  var CollectionTermType = "Collection";
19
19
  exports.CollectionTermType = CollectionTermType;
@@ -46,8 +46,8 @@ exports.TurtleContentType = TurtleContentType;
46
46
  var TurtleLegacyContentType = "application/x-turtle";
47
47
  exports.TurtleLegacyContentType = TurtleLegacyContentType;
48
48
  var XHTMLContentType = "application/xhtml+xml";
49
+
49
50
  /**
50
51
  * A valid mime type header
51
52
  */
52
-
53
53
  exports.XHTMLContentType = XHTMLContentType;
@@ -6,7 +6,7 @@ import { BlankNode, NamedNode, Quad, Quad_Subject, Term } from './tf-types';
6
6
  interface UpdateManagerFormula extends IndexedFormula {
7
7
  fetcher: Fetcher;
8
8
  }
9
- declare type CallBackFunction = (uri: string, ok: boolean, message: string, response: Error | Response) => {} | void;
9
+ type CallBackFunction = (uri: string, ok: boolean, message: string, response: Error | Response) => {} | void;
10
10
  /**
11
11
  * The UpdateManager is a helper object for a store.
12
12
  * Just as a Fetcher provides the store with the ability to read and write,
@@ -51,7 +51,7 @@ export default class UpdateManager {
51
51
  * Returns a list of all bnodes occurring in a list of statements
52
52
  * @private
53
53
  */
54
- statementArrayBnodes(sts: Quad[]): BlankNode[];
54
+ statementArrayBnodes(sts: ReadonlyArray<Quad>): BlankNode[];
55
55
  /**
56
56
  * Makes a cached list of [Inverse-]Functional properties
57
57
  * @private