@comunica/actor-function-factory-term-langdir 4.4.2-alpha.49.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/LICENSE.txt +22 -0
- package/README.md +37 -0
- package/components/ActorFunctionFactoryTermLangdir.jsonld +173 -0
- package/components/components.jsonld +11 -0
- package/components/context.jsonld +41 -0
- package/lib/ActorFunctionFactoryTermLangdir.d.ts +11 -0
- package/lib/ActorFunctionFactoryTermLangdir.js +23 -0
- package/lib/ActorFunctionFactoryTermLangdir.js.map +1 -0
- package/lib/TermFunctionLangdir.d.ts +7 -0
- package/lib/TermFunctionLangdir.js +21 -0
- package/lib/TermFunctionLangdir.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/package.json +44 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright © 2017–now Ruben Taelman, Joachim Van Herwegen
|
|
4
|
+
Comunica Association and Ghent University – imec, Belgium
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
|
14
|
+
all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Comunica Term Function Langdir Function Factory Actor
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@comunica/actor-function-factory-term-lang)
|
|
4
|
+
|
|
5
|
+
A [function factory](https://github.com/comunica/comunica/tree/master/packages/bus-function-factory) actor
|
|
6
|
+
that constructs a [term function](https://github.com/comunica/comunica/tree/master/packages/bus-function-factory/lib/ActorFunctionFactory.ts)
|
|
7
|
+
capable of evaluating the [Lang](https://www.w3.org/TR/sparql11-query/#func-lang) function.
|
|
8
|
+
|
|
9
|
+
This module is part of the [Comunica framework](https://github.com/comunica/comunica),
|
|
10
|
+
and should only be used by [developers that want to build their own query engine](https://comunica.dev/docs/modify/).
|
|
11
|
+
|
|
12
|
+
[Click here if you just want to query with Comunica](https://comunica.dev/docs/query/).
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
$ yarn add @comunica/actor-function-factory-term-langdir
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Configure
|
|
21
|
+
|
|
22
|
+
After installing, this package can be added to your engine's configuration as follows:
|
|
23
|
+
```text
|
|
24
|
+
{
|
|
25
|
+
"@context": [
|
|
26
|
+
...
|
|
27
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-term-langdir/^4.0.0/components/context.jsonld"
|
|
28
|
+
],
|
|
29
|
+
"actors": [
|
|
30
|
+
...
|
|
31
|
+
{
|
|
32
|
+
"@id": "urn:comunica:default:function-factory/actors#term-function-langdir",
|
|
33
|
+
"@type": "ActorFunctionFactoryTermLangdir"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
```
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-term-langdir/^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"
|
|
6
|
+
],
|
|
7
|
+
"@id": "npmd:@comunica/actor-function-factory-term-langdir",
|
|
8
|
+
"components": [
|
|
9
|
+
{
|
|
10
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir",
|
|
11
|
+
"@type": "Class",
|
|
12
|
+
"requireElement": "ActorFunctionFactoryTermLangdir",
|
|
13
|
+
"extends": [
|
|
14
|
+
"cbff:components/ActorFunctionFactoryDedicated.jsonld#ActorFunctionFactoryDedicated"
|
|
15
|
+
],
|
|
16
|
+
"comment": "A comunica TermFunctionLangdir Function Factory Actor.",
|
|
17
|
+
"parameters": [
|
|
18
|
+
{
|
|
19
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir_args_name",
|
|
20
|
+
"range": "xsd:string",
|
|
21
|
+
"default": {
|
|
22
|
+
"@id": "rdf:subject"
|
|
23
|
+
},
|
|
24
|
+
"comment": "The name for this actor."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir_args_bus",
|
|
28
|
+
"range": {
|
|
29
|
+
"@type": "ParameterRangeGenericComponent",
|
|
30
|
+
"component": "cc:components/Bus.jsonld#Bus",
|
|
31
|
+
"genericTypeInstances": [
|
|
32
|
+
{
|
|
33
|
+
"@type": "ParameterRangeGenericComponent",
|
|
34
|
+
"component": "cc:components/Actor.jsonld#Actor",
|
|
35
|
+
"genericTypeInstances": [
|
|
36
|
+
{
|
|
37
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
38
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
42
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
46
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
50
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
56
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
60
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
64
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
68
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"default": {
|
|
73
|
+
"@id": "cbff:components/ActorFunctionFactory.jsonld#ActorFunctionFactory_default_bus",
|
|
74
|
+
"@type": "cbff:components/BusFunctionFactory.jsonld#BusFunctionFactory"
|
|
75
|
+
},
|
|
76
|
+
"comment": "The bus this actor subscribes to."
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir_args_busFailMessage",
|
|
80
|
+
"range": {
|
|
81
|
+
"@type": "ParameterRangeUnion",
|
|
82
|
+
"parameterRangeElements": [
|
|
83
|
+
"xsd:string",
|
|
84
|
+
{
|
|
85
|
+
"@type": "ParameterRangeUndefined"
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
"default": "Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}",
|
|
90
|
+
"comment": "The message that will be configured in the bus for reporting failures. This message may be a template string that contains references to the executed `action`. For example, the following templated string is allowed: \"RDF dereferencing failed: no actors could handle ${action.handle.mediaType}\""
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir_args_beforeActors",
|
|
94
|
+
"range": {
|
|
95
|
+
"@type": "ParameterRangeUnion",
|
|
96
|
+
"parameterRangeElements": [
|
|
97
|
+
{
|
|
98
|
+
"@type": "ParameterRangeArray",
|
|
99
|
+
"parameterRangeValue": {
|
|
100
|
+
"@type": "ParameterRangeGenericComponent",
|
|
101
|
+
"component": "cc:components/Actor.jsonld#Actor",
|
|
102
|
+
"genericTypeInstances": [
|
|
103
|
+
{
|
|
104
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
105
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
109
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
113
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"@type": "ParameterRangeGenericTypeReference",
|
|
117
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^4.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"@type": "ParameterRangeUndefined"
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"comment": "Actor that must be registered in the bus before this actor."
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"memberFields": [
|
|
131
|
+
{
|
|
132
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir__member_constructor",
|
|
133
|
+
"memberFieldName": "constructor"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir__member_run",
|
|
137
|
+
"memberFieldName": "run"
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"constructorArguments": [
|
|
141
|
+
{
|
|
142
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir_args__constructorArgument",
|
|
143
|
+
"fields": [
|
|
144
|
+
{
|
|
145
|
+
"keyRaw": "name",
|
|
146
|
+
"value": {
|
|
147
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir_args_name"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"keyRaw": "bus",
|
|
152
|
+
"value": {
|
|
153
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir_args_bus"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"keyRaw": "busFailMessage",
|
|
158
|
+
"value": {
|
|
159
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir_args_busFailMessage"
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"keyRaw": "beforeActors",
|
|
164
|
+
"value": {
|
|
165
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir_args_beforeActors"
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-function-factory-term-langdir/^4.0.0/components/context.jsonld"
|
|
4
|
+
],
|
|
5
|
+
"@id": "npmd:@comunica/actor-function-factory-term-langdir",
|
|
6
|
+
"@type": "Module",
|
|
7
|
+
"requireName": "@comunica/actor-function-factory-term-langdir",
|
|
8
|
+
"import": [
|
|
9
|
+
"cafftl:components/ActorFunctionFactoryTermLangdir.jsonld"
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^6.0.0/components/context.jsonld",
|
|
4
|
+
{
|
|
5
|
+
"npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
|
|
6
|
+
"cafftl": "npmd:@comunica/actor-function-factory-term-langdir/^4.0.0/",
|
|
7
|
+
"ActorFunctionFactoryTermLangdir": {
|
|
8
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir",
|
|
9
|
+
"@prefix": true,
|
|
10
|
+
"@context": {
|
|
11
|
+
"args_name": {
|
|
12
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir_args_name"
|
|
13
|
+
},
|
|
14
|
+
"args_bus": {
|
|
15
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir_args_bus"
|
|
16
|
+
},
|
|
17
|
+
"args_busFailMessage": {
|
|
18
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir_args_busFailMessage"
|
|
19
|
+
},
|
|
20
|
+
"args_beforeActors": {
|
|
21
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir_args_beforeActors",
|
|
22
|
+
"@container": "@list"
|
|
23
|
+
},
|
|
24
|
+
"name": {
|
|
25
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir_args_name"
|
|
26
|
+
},
|
|
27
|
+
"bus": {
|
|
28
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir_args_bus"
|
|
29
|
+
},
|
|
30
|
+
"busFailMessage": {
|
|
31
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir_args_busFailMessage"
|
|
32
|
+
},
|
|
33
|
+
"beforeActors": {
|
|
34
|
+
"@id": "cafftl:components/ActorFunctionFactoryTermLangdir.jsonld#ActorFunctionFactoryTermLangdir_args_beforeActors",
|
|
35
|
+
"@container": "@list"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IActionFunctionFactory, IActorFunctionFactoryArgs, IActorFunctionFactoryOutput, IActorFunctionFactoryOutputTerm } from '@comunica/bus-function-factory';
|
|
2
|
+
import { ActorFunctionFactoryDedicated } from '@comunica/bus-function-factory';
|
|
3
|
+
/**
|
|
4
|
+
* A comunica TermFunctionLangdir Function Factory Actor.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ActorFunctionFactoryTermLangdir extends ActorFunctionFactoryDedicated {
|
|
7
|
+
constructor(args: IActorFunctionFactoryArgs);
|
|
8
|
+
run<T extends IActionFunctionFactory>(_: T): Promise<T extends {
|
|
9
|
+
requireTermExpression: true;
|
|
10
|
+
} ? IActorFunctionFactoryOutputTerm : IActorFunctionFactoryOutput>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActorFunctionFactoryTermLangdir = void 0;
|
|
4
|
+
const bus_function_factory_1 = require("@comunica/bus-function-factory");
|
|
5
|
+
const utils_expression_evaluator_1 = require("@comunica/utils-expression-evaluator");
|
|
6
|
+
const TermFunctionLangdir_1 = require("./TermFunctionLangdir");
|
|
7
|
+
/**
|
|
8
|
+
* A comunica TermFunctionLangdir Function Factory Actor.
|
|
9
|
+
*/
|
|
10
|
+
class ActorFunctionFactoryTermLangdir extends bus_function_factory_1.ActorFunctionFactoryDedicated {
|
|
11
|
+
constructor(args) {
|
|
12
|
+
super({
|
|
13
|
+
...args,
|
|
14
|
+
functionNames: [utils_expression_evaluator_1.SparqlOperator.LANGDIR],
|
|
15
|
+
termFunction: true,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
async run(_) {
|
|
19
|
+
return new TermFunctionLangdir_1.TermFunctionLangdir();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.ActorFunctionFactoryTermLangdir = ActorFunctionFactoryTermLangdir;
|
|
23
|
+
//# sourceMappingURL=ActorFunctionFactoryTermLangdir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActorFunctionFactoryTermLangdir.js","sourceRoot":"","sources":["ActorFunctionFactoryTermLangdir.ts"],"names":[],"mappings":";;;AAMA,yEAEwC;AAExC,qFAAsE;AACtE,+DAA4D;AAE5D;;GAEG;AACH,MAAa,+BAAgC,SAAQ,oDAA6B;IAChF,YAAmB,IAA+B;QAChD,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,aAAa,EAAE,CAAE,2CAAc,CAAC,OAAO,CAAE;YACzC,YAAY,EAAE,IAAI;SACnB,CAAC,CAAC;IACL,CAAC;IAEM,KAAK,CAAC,GAAG,CAAmC,CAAI;QAErD,OAAO,IAAI,yCAAmB,EAAE,CAAC;IACnC,CAAC;CACF;AAbD,0EAaC","sourcesContent":["import type {\n IActionFunctionFactory,\n IActorFunctionFactoryArgs,\n IActorFunctionFactoryOutput,\n IActorFunctionFactoryOutputTerm,\n} from '@comunica/bus-function-factory';\nimport {\n ActorFunctionFactoryDedicated,\n} from '@comunica/bus-function-factory';\n\nimport { SparqlOperator } from '@comunica/utils-expression-evaluator';\nimport { TermFunctionLangdir } from './TermFunctionLangdir';\n\n/**\n * A comunica TermFunctionLangdir Function Factory Actor.\n */\nexport class ActorFunctionFactoryTermLangdir extends ActorFunctionFactoryDedicated {\n public constructor(args: IActorFunctionFactoryArgs) {\n super({\n ...args,\n functionNames: [ SparqlOperator.LANGDIR ],\n termFunction: true,\n });\n }\n\n public async run<T extends IActionFunctionFactory>(_: T):\n Promise<T extends { requireTermExpression: true } ? IActorFunctionFactoryOutputTerm : IActorFunctionFactoryOutput> {\n return new TermFunctionLangdir();\n }\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TermFunctionLangdir = void 0;
|
|
4
|
+
const bus_function_factory_1 = require("@comunica/bus-function-factory");
|
|
5
|
+
const utils_expression_evaluator_1 = require("@comunica/utils-expression-evaluator");
|
|
6
|
+
/**
|
|
7
|
+
* https://www.w3.org/TR/sparql11-query/#func-lang
|
|
8
|
+
*/
|
|
9
|
+
class TermFunctionLangdir extends bus_function_factory_1.TermFunctionBase {
|
|
10
|
+
constructor() {
|
|
11
|
+
super({
|
|
12
|
+
arity: 1,
|
|
13
|
+
operator: utils_expression_evaluator_1.SparqlOperator.LANGDIR,
|
|
14
|
+
overloads: (0, utils_expression_evaluator_1.declare)(utils_expression_evaluator_1.SparqlOperator.LANGDIR)
|
|
15
|
+
.onLiteral1(() => lit => (0, utils_expression_evaluator_1.string)(lit.direction ?? ''))
|
|
16
|
+
.collect(),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.TermFunctionLangdir = TermFunctionLangdir;
|
|
21
|
+
//# sourceMappingURL=TermFunctionLangdir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TermFunctionLangdir.js","sourceRoot":"","sources":["TermFunctionLangdir.ts"],"names":[],"mappings":";;;AAAA,yEAAkE;AAElE,qFAI8C;AAE9C;;GAEG;AACH,MAAa,mBAAoB,SAAQ,uCAAgB;IACvD;QACE,KAAK,CAAC;YACJ,KAAK,EAAE,CAAC;YACR,QAAQ,EAAE,2CAAc,CAAC,OAAO;YAChC,SAAS,EAAE,IAAA,oCAAO,EAAC,2CAAc,CAAC,OAAO,CAAC;iBACvC,UAAU,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAA,mCAAM,EAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;iBACpD,OAAO,EAAE;SACb,CAAC,CAAC;IACL,CAAC;CACF;AAVD,kDAUC","sourcesContent":["import { TermFunctionBase } from '@comunica/bus-function-factory';\n\nimport {\n declare,\n SparqlOperator,\n string,\n} from '@comunica/utils-expression-evaluator';\n\n/**\n * https://www.w3.org/TR/sparql11-query/#func-lang\n */\nexport class TermFunctionLangdir extends TermFunctionBase {\n public constructor() {\n super({\n arity: 1,\n operator: SparqlOperator.LANGDIR,\n overloads: declare(SparqlOperator.LANGDIR)\n .onLiteral1(() => lit => string(lit.direction ?? ''))\n .collect(),\n });\n }\n}\n"]}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ActorFunctionFactoryTermLangdir';
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ActorFunctionFactoryTermLangdir"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oEAAkD","sourcesContent":["export * from './ActorFunctionFactoryTermLangdir';\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@comunica/actor-function-factory-term-langdir",
|
|
3
|
+
"version": "4.4.2-alpha.49.0",
|
|
4
|
+
"description": "A term-langdir function-factory actor",
|
|
5
|
+
"lsd:module": true,
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://comunica.dev/",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/comunica/comunica.git",
|
|
11
|
+
"directory": "packages/actor-function-factory-term-langdir"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/comunica/comunica/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"comunica",
|
|
18
|
+
"actor",
|
|
19
|
+
"function-factory",
|
|
20
|
+
"term-function-langdir"
|
|
21
|
+
],
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"main": "lib/index.js",
|
|
24
|
+
"typings": "lib/index",
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"components",
|
|
30
|
+
"lib/**/*.d.ts",
|
|
31
|
+
"lib/**/*.js",
|
|
32
|
+
"lib/**/*.js.map"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "yarn run build:ts && yarn run build:components",
|
|
36
|
+
"build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
|
|
37
|
+
"build:components": "componentsjs-generator"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@comunica/bus-function-factory": "4.4.2-alpha.49.0",
|
|
41
|
+
"@comunica/utils-expression-evaluator": "4.4.2-alpha.49.0"
|
|
42
|
+
},
|
|
43
|
+
"gitHead": "ef6f96cfd8faf7c37955bb7e0fe9f6fc6a994bdf"
|
|
44
|
+
}
|