@comunica/actor-function-factory-term-str-before 4.5.0 → 5.0.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 CHANGED
@@ -24,7 +24,7 @@ After installing, this package can be added to your engine's configuration as fo
24
24
  {
25
25
  "@context": [
26
26
  ...
27
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-term-str-before/^4.0.0/components/context.jsonld"
27
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-term-str-before/^5.0.0/components/context.jsonld"
28
28
  ],
29
29
  "actors": [
30
30
  ...
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-term-str-before/^4.0.0/components/context.jsonld",
4
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-function-factory/^4.0.0/components/context.jsonld",
5
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-term-str-before/^5.0.0/components/context.jsonld",
4
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-function-factory/^5.0.0/components/context.jsonld",
5
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^5.0.0/components/context.jsonld"
6
6
  ],
7
7
  "@id": "npmd:@comunica/actor-function-factory-term-str-before",
8
8
  "components": [
@@ -35,37 +35,37 @@
35
35
  "genericTypeInstances": [
36
36
  {
37
37
  "@type": "ParameterRangeGenericTypeReference",
38
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
38
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
39
39
  },
40
40
  {
41
41
  "@type": "ParameterRangeGenericTypeReference",
42
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
42
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
43
43
  },
44
44
  {
45
45
  "@type": "ParameterRangeGenericTypeReference",
46
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
46
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
47
47
  },
48
48
  {
49
49
  "@type": "ParameterRangeGenericTypeReference",
50
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
50
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
51
51
  }
52
52
  ]
53
53
  },
54
54
  {
55
55
  "@type": "ParameterRangeGenericTypeReference",
56
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
56
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
57
57
  },
58
58
  {
59
59
  "@type": "ParameterRangeGenericTypeReference",
60
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
60
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
61
61
  },
62
62
  {
63
63
  "@type": "ParameterRangeGenericTypeReference",
64
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
64
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
65
65
  },
66
66
  {
67
67
  "@type": "ParameterRangeGenericTypeReference",
68
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
68
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
69
69
  }
70
70
  ]
71
71
  },
@@ -102,19 +102,19 @@
102
102
  "genericTypeInstances": [
103
103
  {
104
104
  "@type": "ParameterRangeGenericTypeReference",
105
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
105
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
106
106
  },
107
107
  {
108
108
  "@type": "ParameterRangeGenericTypeReference",
109
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
109
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
110
110
  },
111
111
  {
112
112
  "@type": "ParameterRangeGenericTypeReference",
113
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
113
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
114
114
  },
115
115
  {
116
116
  "@type": "ParameterRangeGenericTypeReference",
117
- "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
117
+ "parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
118
118
  }
119
119
  ]
120
120
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-term-str-before/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-term-str-before/^5.0.0/components/context.jsonld"
4
4
  ],
5
5
  "@id": "npmd:@comunica/actor-function-factory-term-str-before",
6
6
  "@type": "Module",
@@ -3,7 +3,7 @@
3
3
  "https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^6.0.0/components/context.jsonld",
4
4
  {
5
5
  "npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
6
- "cafftsb": "npmd:@comunica/actor-function-factory-term-str-before/^4.0.0/",
6
+ "cafftsb": "npmd:@comunica/actor-function-factory-term-str-before/^5.0.0/",
7
7
  "ActorFunctionFactoryTermStrBefore": {
8
8
  "@id": "cafftsb:components/ActorFunctionFactoryTermStrBefore.jsonld#ActorFunctionFactoryTermStrBefore",
9
9
  "@prefix": true,
File without changes
File without changes
File without changes
File without changes
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TermFunctionStrBefore = void 0;
4
4
  const bus_function_factory_1 = require("@comunica/bus-function-factory");
5
5
  const utils_expression_evaluator_1 = require("@comunica/utils-expression-evaluator");
6
+ const Helpers_1 = require("@comunica/utils-expression-evaluator/lib/functions/Helpers");
7
+ const Errors_1 = require("@comunica/utils-expression-evaluator/lib/util/Errors");
6
8
  /**
7
9
  * https://www.w3.org/TR/sparql11-query/#func-strbefore
8
10
  */
@@ -25,6 +27,30 @@ class TermFunctionStrBefore extends bus_function_factory_1.TermFunctionBase {
25
27
  const [a1, a2] = [arg1.typedValue, arg2.typedValue];
26
28
  const sub = arg1.typedValue.slice(0, Math.max(0, a1.indexOf(a2)));
27
29
  return sub || !a2 ? (0, utils_expression_evaluator_1.langString)(sub, arg1.language) : (0, utils_expression_evaluator_1.string)(sub);
30
+ })
31
+ .onBinary([utils_expression_evaluator_1.TypeURL.RDF_DIR_LANG_STRING, utils_expression_evaluator_1.TypeURL.XSD_STRING], () => (arg1, arg2) => {
32
+ const [a1, a2] = [arg1.typedValue, arg2.typedValue];
33
+ const sub = arg1.typedValue.slice(0, Math.max(0, a1.indexOf(a2)));
34
+ return sub || !a2 ? (0, Helpers_1.dirLangString)(sub, arg1.language, arg1.direction) : (0, utils_expression_evaluator_1.string)(sub);
35
+ })
36
+ .onBinary([utils_expression_evaluator_1.TypeURL.RDF_DIR_LANG_STRING, utils_expression_evaluator_1.TypeURL.RDF_LANG_STRING], () => (arg1, arg2) => {
37
+ if (arg1.language !== arg2.language) {
38
+ throw new utils_expression_evaluator_1.IncompatibleLanguageOperation(arg1, arg2);
39
+ }
40
+ const [a1, a2] = [arg1.typedValue, arg2.typedValue];
41
+ const sub = arg1.typedValue.slice(0, Math.max(0, a1.indexOf(a2)));
42
+ return sub || !a2 ? (0, Helpers_1.dirLangString)(sub, arg1.language, arg1.direction) : (0, utils_expression_evaluator_1.string)(sub);
43
+ })
44
+ .onBinary([utils_expression_evaluator_1.TypeURL.RDF_DIR_LANG_STRING, utils_expression_evaluator_1.TypeURL.RDF_DIR_LANG_STRING], () => (arg1, arg2) => {
45
+ if (arg1.language !== arg2.language) {
46
+ throw new utils_expression_evaluator_1.IncompatibleLanguageOperation(arg1, arg2);
47
+ }
48
+ if (arg1.direction !== arg2.direction) {
49
+ throw new Errors_1.IncompatibleDirectionalLanguageOperation(arg1, arg2);
50
+ }
51
+ const [a1, a2] = [arg1.typedValue, arg2.typedValue];
52
+ const sub = arg1.typedValue.slice(0, Math.max(0, a1.indexOf(a2)));
53
+ return sub || !a2 ? (0, Helpers_1.dirLangString)(sub, arg1.language, arg1.direction) : (0, utils_expression_evaluator_1.string)(sub);
28
54
  })
29
55
  .collect(),
30
56
  });
@@ -1 +1 @@
1
- {"version":3,"file":"TermFunctionStrBefore.js","sourceRoot":"","sources":["TermFunctionStrBefore.ts"],"names":[],"mappings":";;;AAAA,yEAAkE;AAMlE,qFAO8C;AAE9C;;GAEG;AACH,MAAa,qBAAsB,SAAQ,uCAAgB;IACzD;QACE,KAAK,CAAC;YACJ,KAAK,EAAE,CAAC;YACR,QAAQ,EAAE,2CAAc,CAAC,SAAS;YAClC,SAAS,EAAE,IAAA,oCAAO,EAAC,2CAAc,CAAC,SAAS,CAAC;iBACzC,aAAa,CACZ,CAAE,oCAAO,CAAC,UAAU,EAAE,oCAAO,CAAC,UAAU,CAAE,EAC1C,GAAG,EAAE,CAAC,CAAC,IAAY,EAAE,IAAY,EAAE,EAAE,CAAC,IAAA,mCAAM,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAC7F;iBACA,QAAQ,CACP,CAAE,oCAAO,CAAC,eAAe,EAAE,oCAAO,CAAC,UAAU,CAAE,EAC/C,GAAG,EAAE,CAAC,CAAC,IAAuB,EAAE,IAAmB,EAAE,EAAE;gBACrD,MAAM,CAAE,EAAE,EAAE,EAAE,CAAE,GAAG,CAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAE,CAAC;gBAC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comunica/utils-expression-evaluator';\nimport {\n declare,\n IncompatibleLanguageOperation,\n langString,\n SparqlOperator,\n string,\n TypeURL,\n} from '@comunica/utils-expression-evaluator';\n\n/**\n * https://www.w3.org/TR/sparql11-query/#func-strbefore\n */\nexport class TermFunctionStrBefore extends TermFunctionBase {\n public constructor() {\n super({\n arity: 2,\n operator: SparqlOperator.STRBEFORE,\n overloads: declare(SparqlOperator.STRBEFORE)\n .onBinaryTyped(\n [ TypeURL.XSD_STRING, TypeURL.XSD_STRING ],\n () => (arg1: string, arg2: string) => string(arg1.slice(0, Math.max(0, arg1.indexOf(arg2)))),\n )\n .onBinary(\n [ TypeURL.RDF_LANG_STRING, TypeURL.XSD_STRING ],\n () => (arg1: LangStringLiteral, arg2: StringLiteral) => {\n const [ a1, a2 ] = [ arg1.typedValue, arg2.typedValue ];\n const sub = arg1.typedValue.slice(0, Math.max(0, a1.indexOf(a2)));\n return sub || !a2 ? langString(sub, arg1.language) : string(sub);\n },\n )\n .onBinary(\n [ TypeURL.RDF_LANG_STRING, TypeURL.RDF_LANG_STRING ],\n () => (arg1: LangStringLiteral, arg2: LangStringLiteral) => {\n if (arg1.language !== arg2.language) {\n throw new IncompatibleLanguageOperation(arg1, arg2);\n }\n const [ a1, a2 ] = [ arg1.typedValue, arg2.typedValue ];\n const sub = arg1.typedValue.slice(0, Math.max(0, a1.indexOf(a2)));\n return sub || !a2 ? langString(sub, arg1.language) : string(sub);\n },\n )\n .collect(),\n });\n }\n}\n"]}
1
+ {"version":3,"file":"TermFunctionStrBefore.js","sourceRoot":"","sources":["TermFunctionStrBefore.ts"],"names":[],"mappings":";;;AAAA,yEAAkE;AAMlE,qFAO8C;AAE9C,wFAA2F;AAC3F,iFAAgH;AAEhH;;GAEG;AACH,MAAa,qBAAsB,SAAQ,uCAAgB;IACzD;QACE,KAAK,CAAC;YACJ,KAAK,EAAE,CAAC;YACR,QAAQ,EAAE,2CAAc,CAAC,SAAS;YAClC,SAAS,EAAE,IAAA,oCAAO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C,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;gBAClE,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAA,uBAAa,EAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAA,mCAAM,EAAC,GAAG,CAAC,CAAC;YACtF,CAAC,CACF;iBACA,OAAO,EAAE;SACb,CAAC,CAAC;IACL,CAAC;CACF;AAjED,sDAiEC","sourcesContent":["import { TermFunctionBase } from '@comunica/bus-function-factory';\nimport type {\n StringLiteral,\n\n LangStringLiteral,\n} from '@comunica/utils-expression-evaluator';\nimport {\n declare,\n IncompatibleLanguageOperation,\n langString,\n SparqlOperator,\n string,\n TypeURL,\n} from '@comunica/utils-expression-evaluator';\nimport type { DirLangStringLiteral } from '@comunica/utils-expression-evaluator/lib/expressions';\nimport { dirLangString } from '@comunica/utils-expression-evaluator/lib/functions/Helpers';\nimport { IncompatibleDirectionalLanguageOperation } from '@comunica/utils-expression-evaluator/lib/util/Errors';\n\n/**\n * https://www.w3.org/TR/sparql11-query/#func-strbefore\n */\nexport class TermFunctionStrBefore extends TermFunctionBase {\n public constructor() {\n super({\n arity: 2,\n operator: SparqlOperator.STRBEFORE,\n overloads: declare(SparqlOperator.STRBEFORE)\n .onBinaryTyped(\n [ TypeURL.XSD_STRING, TypeURL.XSD_STRING ],\n () => (arg1: string, arg2: string) => string(arg1.slice(0, Math.max(0, arg1.indexOf(arg2)))),\n )\n .onBinary(\n [ TypeURL.RDF_LANG_STRING, TypeURL.XSD_STRING ],\n () => (arg1: LangStringLiteral, arg2: StringLiteral) => {\n const [ a1, a2 ] = [ arg1.typedValue, arg2.typedValue ];\n const sub = arg1.typedValue.slice(0, Math.max(0, a1.indexOf(a2)));\n return sub || !a2 ? langString(sub, arg1.language) : string(sub);\n },\n )\n .onBinary(\n [ TypeURL.RDF_LANG_STRING, TypeURL.RDF_LANG_STRING ],\n () => (arg1: LangStringLiteral, arg2: LangStringLiteral) => {\n if (arg1.language !== arg2.language) {\n throw new IncompatibleLanguageOperation(arg1, arg2);\n }\n const [ a1, a2 ] = [ arg1.typedValue, arg2.typedValue ];\n const sub = arg1.typedValue.slice(0, Math.max(0, a1.indexOf(a2)));\n return sub || !a2 ? langString(sub, arg1.language) : string(sub);\n },\n )\n .onBinary(\n [ TypeURL.RDF_DIR_LANG_STRING, TypeURL.XSD_STRING ],\n () => (arg1: DirLangStringLiteral, arg2: StringLiteral) => {\n const [ a1, a2 ] = [ arg1.typedValue, arg2.typedValue ];\n const sub = arg1.typedValue.slice(0, Math.max(0, a1.indexOf(a2)));\n return sub || !a2 ? dirLangString(sub, arg1.language, arg1.direction) : string(sub);\n },\n )\n .onBinary(\n [ TypeURL.RDF_DIR_LANG_STRING, TypeURL.RDF_LANG_STRING ],\n () => (arg1: DirLangStringLiteral, arg2: LangStringLiteral) => {\n if (arg1.language !== arg2.language) {\n throw new IncompatibleLanguageOperation(arg1, arg2);\n }\n const [ a1, a2 ] = [ arg1.typedValue, arg2.typedValue ];\n const sub = arg1.typedValue.slice(0, Math.max(0, a1.indexOf(a2)));\n return sub || !a2 ? dirLangString(sub, arg1.language, arg1.direction) : string(sub);\n },\n )\n .onBinary(\n [ TypeURL.RDF_DIR_LANG_STRING, TypeURL.RDF_DIR_LANG_STRING ],\n () => (arg1: DirLangStringLiteral, arg2: DirLangStringLiteral) => {\n if (arg1.language !== arg2.language) {\n throw new IncompatibleLanguageOperation(arg1, arg2);\n }\n if (arg1.direction !== arg2.direction) {\n throw new IncompatibleDirectionalLanguageOperation(arg1, arg2);\n }\n const [ a1, a2 ] = [ arg1.typedValue, arg2.typedValue ];\n const sub = arg1.typedValue.slice(0, Math.max(0, a1.indexOf(a2)));\n return sub || !a2 ? dirLangString(sub, arg1.language, arg1.direction) : string(sub);\n },\n )\n .collect(),\n });\n }\n}\n"]}
package/lib/index.d.ts CHANGED
File without changes
package/lib/index.js CHANGED
File without changes
package/lib/index.js.map CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comunica/actor-function-factory-term-str-before",
3
- "version": "4.5.0",
3
+ "version": "5.0.0",
4
4
  "description": "A term-str-before function-factory actor",
5
5
  "lsd:module": true,
6
6
  "license": "MIT",
@@ -37,8 +37,8 @@
37
37
  "build:components": "componentsjs-generator"
38
38
  },
39
39
  "dependencies": {
40
- "@comunica/bus-function-factory": "^4.5.0",
41
- "@comunica/utils-expression-evaluator": "^4.5.0"
40
+ "@comunica/bus-function-factory": "^5.0.0",
41
+ "@comunica/utils-expression-evaluator": "^5.0.0"
42
42
  },
43
- "gitHead": "2bcd98c387a021fc5c08d375793c205ca3d1bf0d"
43
+ "gitHead": "0b1756fdb9bef014133432489627c1bd71779bd0"
44
44
  }