@rdfx/data-factory 0.0.17 → 0.0.18

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/dist/BlankNode.js CHANGED
@@ -3,10 +3,11 @@ import { Term } from "./Term.js";
3
3
  * A term that represents an RDF blank node with a label.
4
4
  */
5
5
  export class BlankNode extends Term {
6
+ value;
7
+ termType = "BlankNode";
6
8
  constructor(value) {
7
9
  super();
8
10
  this.value = value;
9
- this.termType = "BlankNode";
10
11
  }
11
12
  equals(other) {
12
13
  return (!!other && other.termType === "BlankNode" && other.value === this.value);
@@ -8,8 +8,10 @@ import { Variable } from "./Variable.js";
8
8
  * A factory for instantiating RDF terms and quads.
9
9
  */
10
10
  export class DataFactory {
11
+ static XSD_STRING = new NamedNode("http://www.w3.org/2001/XMLSchema#string");
12
+ blankNodePrefix;
13
+ blankNodeCounter = 0;
11
14
  constructor(options) {
12
- this.blankNodeCounter = 0;
13
15
  options = options ?? {};
14
16
  this.blankNodePrefix =
15
17
  options.blankNodePrefix ?? `df_${dataFactoryCounter++}_`;
@@ -112,6 +114,5 @@ export class DataFactory {
112
114
  return new Variable(value);
113
115
  }
114
116
  }
115
- DataFactory.XSD_STRING = new NamedNode("http://www.w3.org/2001/XMLSchema#string");
116
117
  let dataFactoryCounter = 0;
117
118
  //# sourceMappingURL=DataFactory.js.map
@@ -4,14 +4,14 @@ import { Term } from "./Term.js";
4
4
  * It's only allowed to assign a DefaultGraph to the .graph property of a Quad.
5
5
  */
6
6
  export class DefaultGraph extends Term {
7
+ static INSTANCE = new DefaultGraph();
8
+ termType = "DefaultGraph";
9
+ value = "";
7
10
  constructor() {
8
11
  super();
9
- this.termType = "DefaultGraph";
10
- this.value = "";
11
12
  }
12
13
  equals(other) {
13
14
  return !!other && other.termType === "DefaultGraph";
14
15
  }
15
16
  }
16
- DefaultGraph.INSTANCE = new DefaultGraph();
17
17
  //# sourceMappingURL=DefaultGraph.js.map
package/dist/Literal.js CHANGED
@@ -6,10 +6,17 @@ import { Term } from "./Term.js";
6
6
  * or datatype.
7
7
  */
8
8
  export class Literal extends Term {
9
+ value;
10
+ static RDF_DIRECTIONAL_LANGUAGE_STRING = new NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString");
11
+ static RDF_LANGUAGE_STRING = new NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString");
12
+ static XSD_STRING = new NamedNode("http://www.w3.org/2001/XMLSchema#string");
13
+ datatype;
14
+ direction;
15
+ language;
16
+ termType = "Literal";
9
17
  constructor(value, languageOrDatatype) {
10
18
  super();
11
19
  this.value = value;
12
- this.termType = "Literal";
13
20
  if (typeof languageOrDatatype === "string") {
14
21
  this.language = languageOrDatatype;
15
22
  this.datatype = Literal.RDF_LANGUAGE_STRING;
@@ -45,7 +52,4 @@ export class Literal extends Term {
45
52
  this.datatype.equals(other.datatype));
46
53
  }
47
54
  }
48
- Literal.RDF_DIRECTIONAL_LANGUAGE_STRING = new NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString");
49
- Literal.RDF_LANGUAGE_STRING = new NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString");
50
- Literal.XSD_STRING = new NamedNode("http://www.w3.org/2001/XMLSchema#string");
51
55
  //# sourceMappingURL=Literal.js.map
package/dist/NamedNode.js CHANGED
@@ -3,10 +3,11 @@ import { Term } from "./Term.js";
3
3
  * A term that contains an IRI.
4
4
  */
5
5
  export class NamedNode extends Term {
6
+ value;
7
+ termType = "NamedNode";
6
8
  constructor(value) {
7
9
  super();
8
10
  this.value = value;
9
- this.termType = "NamedNode";
10
11
  }
11
12
  equals(other) {
12
13
  return (!!other && other.termType === "NamedNode" && other.value === this.value);
package/dist/Quad.js CHANGED
@@ -4,14 +4,18 @@ import { Term } from "./Term.js";
4
4
  * It's only allowed to assign a DefaultGraph to the .graph property of a Quad.
5
5
  */
6
6
  export class Quad extends Term {
7
+ subject;
8
+ predicate;
9
+ object;
10
+ graph;
11
+ termType = "Quad";
12
+ value = "";
7
13
  constructor(subject, predicate, object, graph) {
8
14
  super();
9
15
  this.subject = subject;
10
16
  this.predicate = predicate;
11
17
  this.object = object;
12
18
  this.graph = graph;
13
- this.termType = "Quad";
14
- this.value = "";
15
19
  }
16
20
  equals(other) {
17
21
  // `|| !other.termType` is for backwards-compatibility with old factories without RDF* support.
package/dist/Variable.js CHANGED
@@ -3,10 +3,11 @@ import { Term } from "./Term.js";
3
3
  * A term that represents a variable.
4
4
  */
5
5
  export class Variable extends Term {
6
+ value;
7
+ termType = "Variable";
6
8
  constructor(value) {
7
9
  super();
8
10
  this.value = value;
9
- this.termType = "Variable";
10
11
  }
11
12
  equals(other) {
12
13
  return (!!other && other.termType === "Variable" && other.value === this.value);
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "dependencies": {
3
- "@rdfx/string": "0.0.17",
3
+ "@rdfx/string": "0.0.18",
4
4
  "@rdfjs/types": "~2.0.1"
5
5
  },
6
6
  "devDependencies": {
7
- "@rdfx/testing": "0.0.17"
7
+ "@rdfx/testing": "0.0.18"
8
8
  },
9
9
  "files": [
10
10
  "LICENSE",
@@ -30,5 +30,5 @@
30
30
  },
31
31
  "type": "module",
32
32
  "types": "./dist/index.d.ts",
33
- "version": "0.0.17"
33
+ "version": "0.0.18"
34
34
  }