@comunica/actor-function-factory-term-langmatches 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-langmatches/^4.0.0/components/context.jsonld"
27
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-term-langmatches/^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-langmatches/^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-langmatches/^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-langmatches",
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-langmatches/^4.0.0/components/context.jsonld"
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-term-langmatches/^5.0.0/components/context.jsonld"
4
4
  ],
5
5
  "@id": "npmd:@comunica/actor-function-factory-term-langmatches",
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
- "cafftl": "npmd:@comunica/actor-function-factory-term-langmatches/^4.0.0/",
6
+ "cafftl": "npmd:@comunica/actor-function-factory-term-langmatches/^5.0.0/",
7
7
  "ActorFunctionFactoryTermLangmatches": {
8
8
  "@id": "cafftl:components/ActorFunctionFactoryTermLangmatches.jsonld#ActorFunctionFactoryTermLangmatches",
9
9
  "@prefix": true,
File without changes
File without changes
File without changes
File without changes
@@ -15,8 +15,6 @@ class TermFunctionLangmatches extends bus_function_factory_1.TermFunctionBase {
15
15
  .onBinaryTyped([utils_expression_evaluator_1.TypeURL.XSD_STRING, utils_expression_evaluator_1.TypeURL.XSD_STRING], () => (tag, range) => (0, utils_expression_evaluator_1.bool)(TermFunctionLangmatches.langMatches(tag, range))).collect(),
16
16
  });
17
17
  }
18
- // TODO: Not an XPath function
19
- // TODO: Publish as package
20
18
  // https://www.ietf.org/rfc/rfc4647.txt
21
19
  // https://www.w3.org/TR/sparql11-query/#func-langMatches
22
20
  static langMatches(tag, range) {
@@ -1 +1 @@
1
- {"version":3,"file":"TermFunctionLangmatches.js","sourceRoot":"","sources":["TermFunctionLangmatches.ts"],"names":[],"mappings":";;;AAAA,yEAAkE;AAElE,qFAK8C;AAE9C;;GAEG;AACH,MAAa,uBAAwB,SAAQ,uCAAgB;IAC3D;QACE,KAAK,CAAC;YACJ,KAAK,EAAE,CAAC;YACR,QAAQ,EAAE,2CAAc,CAAC,YAAY;YACrC,SAAS,EAAE,IAAA,oCAAO,EAAC,2CAAc,CAAC,YAAY,CAAC;iBAC5C,aAAa,CACZ,CAAE,oCAAO,CAAC,UAAU,EAAE,oCAAO,CAAC,UAAU,CAAE,EAC1C,GAAG,EAAE,CAAC,CAAC,GAAW,EAAE,KAAa,EAAE,EAAE,CAAC,IAAA,iCAAI,EAAC,uBAAuB,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAC5F,CAAC,OAAO,EAAE;SACd,CAAC,CAAC;IACL,CAAC;IAED,8BAA8B;IAC9B,2BAA2B;IAC3B,uCAAuC;IACvC,yDAAyD;IACjD,MAAM,CAAC,WAAW,CAAC,GAAW,EAAE,KAAa;QACnD,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChC,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEnC,IAAI,CAAC,uBAAuB,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;YAClE,CAAC,uBAAuB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACnD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,EAAE,GAAG,CAAC,CAAC;QACX,IAAI,EAAE,GAAG,CAAC,CAAC;QACX,OAAO,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;YAC7B,IAAI,uBAAuB,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;gBACtD,EAAE,EAAE,CAAC;gBACL,SAAS;YACX,CAAC;YACD,IAAI,EAAE,KAAK,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAC3B,OAAO,KAAK,CAAC;YACf,CAAC;YACD,IAAI,uBAAuB,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;gBACtE,EAAE,EAAE,CAAC;gBACL,EAAE,EAAE,CAAC;gBACL,SAAS;YACX,CAAC;YACD,IAAI,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC9B,OAAO,KAAK,CAAC;YACf,CAAC;YACD,EAAE,EAAE,CAAC;QACP,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,MAAM,CAAC,UAAU,CAAC,GAAW;QACnC,OAAO,GAAG,KAAK,GAAG,CAAC;IACrB,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,IAAY,EAAE,KAAa;QACrD,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,IAAI,IAAI,GAAG,EAAE,IAAI,CAAC,CAAC;QACnD,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC;IACzC,CAAC;CACF;AAzDD,0DAyDC","sourcesContent":["import { TermFunctionBase } from '@comunica/bus-function-factory';\n\nimport {\n bool,\n declare,\n SparqlOperator,\n TypeURL,\n} from '@comunica/utils-expression-evaluator';\n\n/**\n * https://www.w3.org/TR/sparql11-query/#func-langMatches\n */\nexport class TermFunctionLangmatches extends TermFunctionBase {\n public constructor() {\n super({\n arity: 2,\n operator: SparqlOperator.LANG_MATCHES,\n overloads: declare(SparqlOperator.LANG_MATCHES)\n .onBinaryTyped(\n [ TypeURL.XSD_STRING, TypeURL.XSD_STRING ],\n () => (tag: string, range: string) => bool(TermFunctionLangmatches.langMatches(tag, range)),\n ).collect(),\n });\n }\n\n // TODO: Not an XPath function\n // TODO: Publish as package\n // https://www.ietf.org/rfc/rfc4647.txt\n // https://www.w3.org/TR/sparql11-query/#func-langMatches\n private static langMatches(tag: string, range: string): boolean {\n const langTags = tag.split('-');\n const rangeTags = range.split('-');\n\n if (!TermFunctionLangmatches.matchLangTag(rangeTags[0], langTags[0]) &&\n !TermFunctionLangmatches.isWildCard(langTags[0])) {\n return false;\n }\n\n let lI = 1;\n let rI = 1;\n while (rI < rangeTags.length) {\n if (TermFunctionLangmatches.isWildCard(rangeTags[rI])) {\n rI++;\n continue;\n }\n if (lI === langTags.length) {\n return false;\n }\n if (TermFunctionLangmatches.matchLangTag(rangeTags[rI], langTags[lI])) {\n lI++;\n rI++;\n continue;\n }\n if (langTags[lI].length === 1) {\n return false;\n }\n lI++;\n }\n return true;\n }\n\n private static isWildCard(tag: string): boolean {\n return tag === '*';\n }\n\n private static matchLangTag(left: string, right: string): boolean {\n const matchInitial = new RegExp(`/${left}/`, 'iu');\n return matchInitial.test(`/${right}/`);\n }\n}\n"]}
1
+ {"version":3,"file":"TermFunctionLangmatches.js","sourceRoot":"","sources":["TermFunctionLangmatches.ts"],"names":[],"mappings":";;;AAAA,yEAAkE;AAElE,qFAK8C;AAE9C;;GAEG;AACH,MAAa,uBAAwB,SAAQ,uCAAgB;IAC3D;QACE,KAAK,CAAC;YACJ,KAAK,EAAE,CAAC;YACR,QAAQ,EAAE,2CAAc,CAAC,YAAY;YACrC,SAAS,EAAE,IAAA,oCAAO,EAAC,2CAAc,CAAC,YAAY,CAAC;iBAC5C,aAAa,CAC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,CAAC,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC9B,OAAO,KAAK,CAAC;YACf,CAAC;YACD,EAAE,EAAE,CAAC;QACP,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,MAAM,CAAC,UAAU,CAAC,GAAW;QACnC,OAAO,GAAG,KAAK,GAAG,CAAC;IACrB,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,IAAY,EAAE,KAAa;QACrD,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,IAAI,IAAI,GAAG,EAAE,IAAI,CAAC,CAAC;QACnD,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC;IACzC,CAAC;CACF;AAvDD,0DAuDC","sourcesContent":["import { TermFunctionBase } from '@comunica/bus-function-factory';\n\nimport {\n bool,\n declare,\n SparqlOperator,\n TypeURL,\n} from '@comunica/utils-expression-evaluator';\n\n/**\n * https://www.w3.org/TR/sparql11-query/#func-langMatches\n */\nexport class TermFunctionLangmatches extends TermFunctionBase {\n public constructor() {\n super({\n arity: 2,\n operator: SparqlOperator.LANG_MATCHES,\n overloads: declare(SparqlOperator.LANG_MATCHES)\n .onBinaryTyped(\n [ TypeURL.XSD_STRING, TypeURL.XSD_STRING ],\n () => (tag: string, range: string) => bool(TermFunctionLangmatches.langMatches(tag, range)),\n ).collect(),\n });\n }\n\n // https://www.ietf.org/rfc/rfc4647.txt\n // https://www.w3.org/TR/sparql11-query/#func-langMatches\n private static langMatches(tag: string, range: string): boolean {\n const langTags = tag.split('-');\n const rangeTags = range.split('-');\n\n if (!TermFunctionLangmatches.matchLangTag(rangeTags[0], langTags[0]) &&\n !TermFunctionLangmatches.isWildCard(langTags[0])) {\n return false;\n }\n\n let lI = 1;\n let rI = 1;\n while (rI < rangeTags.length) {\n if (TermFunctionLangmatches.isWildCard(rangeTags[rI])) {\n rI++;\n continue;\n }\n if (lI === langTags.length) {\n return false;\n }\n if (TermFunctionLangmatches.matchLangTag(rangeTags[rI], langTags[lI])) {\n lI++;\n rI++;\n continue;\n }\n if (langTags[lI].length === 1) {\n return false;\n }\n lI++;\n }\n return true;\n }\n\n private static isWildCard(tag: string): boolean {\n return tag === '*';\n }\n\n private static matchLangTag(left: string, right: string): boolean {\n const matchInitial = new RegExp(`/${left}/`, 'iu');\n return matchInitial.test(`/${right}/`);\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-langmatches",
3
- "version": "4.5.0",
3
+ "version": "5.0.0",
4
4
  "description": "A term-langmatches 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
  }