@comunica/actor-init-query 2.0.1-alpha.5.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 +54 -0
- package/components/ActorInitQuery.jsonld +335 -0
- package/components/ActorInitQueryBase.jsonld +468 -0
- package/components/ActorInitSparql.jsonld +328 -0
- package/components/ActorInitSparqlBase.jsonld +373 -0
- package/components/HttpServiceSparqlEndpoint.jsonld +62 -0
- package/components/MemoryPhysicalQueryPlanLogger.jsonld +54 -0
- package/components/QueryEngineBase.jsonld +87 -0
- package/components/QueryEngineFactoryBase.jsonld +33 -0
- package/components/cli/CliArgsHandlerBase.jsonld +67 -0
- package/components/cli/CliArgsHandlerHttp.jsonld +30 -0
- package/components/cli/CliArgsHandlerQuery.jsonld +93 -0
- package/components/cli/ICliArgsHandler.jsonld +20 -0
- package/components/components.jsonld +19 -0
- package/components/context.jsonld +290 -0
- package/lib/ActorInitQuery-browser.d.ts +3 -0
- package/lib/ActorInitQuery-browser.js +10 -0
- package/lib/ActorInitQuery.d.ts +10 -0
- package/lib/ActorInitQuery.js +85 -0
- package/lib/ActorInitQueryBase.d.ts +107 -0
- package/lib/ActorInitQueryBase.js +20 -0
- package/lib/HttpServiceSparqlEndpoint.d.ts +113 -0
- package/lib/HttpServiceSparqlEndpoint.js +440 -0
- package/lib/MemoryPhysicalQueryPlanLogger.d.ts +14 -0
- package/lib/MemoryPhysicalQueryPlanLogger.js +73 -0
- package/lib/QueryEngineBase.d.ts +68 -0
- package/lib/QueryEngineBase.js +302 -0
- package/lib/QueryEngineFactoryBase.d.ts +36 -0
- package/lib/QueryEngineFactoryBase.js +40 -0
- package/lib/cli/CliArgsHandlerBase.d.ts +19 -0
- package/lib/cli/CliArgsHandlerBase.js +170 -0
- package/lib/cli/CliArgsHandlerHttp.d.ts +9 -0
- package/lib/cli/CliArgsHandlerHttp.js +67 -0
- package/lib/cli/CliArgsHandlerQuery.d.ts +13 -0
- package/lib/cli/CliArgsHandlerQuery.js +105 -0
- package/lib/index-browser.d.ts +3 -0
- package/lib/index-browser.js +20 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +26 -0
- package/package.json +67 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-query/^2.0.0/components/context.jsonld",
|
|
4
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/types/^2.0.0/components/context.jsonld"
|
|
5
|
+
],
|
|
6
|
+
"@id": "npmd:@comunica/actor-init-query",
|
|
7
|
+
"components": [
|
|
8
|
+
{
|
|
9
|
+
"@id": "caiq:components/cli/CliArgsHandlerBase.jsonld#CliArgsHandlerBase",
|
|
10
|
+
"@type": "Class",
|
|
11
|
+
"requireElement": "CliArgsHandlerBase",
|
|
12
|
+
"extends": [
|
|
13
|
+
"ct:components/ICliArgsHandler.jsonld#ICliArgsHandler"
|
|
14
|
+
],
|
|
15
|
+
"comment": "Basic CLI arguments handler that handles common options.",
|
|
16
|
+
"parameters": [
|
|
17
|
+
{
|
|
18
|
+
"@id": "caiq:components/cli/CliArgsHandlerBase.jsonld#CliArgsHandlerBase_initialContext",
|
|
19
|
+
"range": {
|
|
20
|
+
"@type": "ParameterRangeUnion",
|
|
21
|
+
"parameterRangeElements": [
|
|
22
|
+
"ct:components/IActionContext.jsonld#IActionContext",
|
|
23
|
+
{
|
|
24
|
+
"@type": "ParameterRangeUndefined"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"memberFields": [
|
|
31
|
+
{
|
|
32
|
+
"@id": "caiq:components/cli/CliArgsHandlerBase.jsonld#CliArgsHandlerBase__member_initialContext",
|
|
33
|
+
"memberFieldName": "initialContext"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"@id": "caiq:components/cli/CliArgsHandlerBase.jsonld#CliArgsHandlerBase__member_constructor",
|
|
37
|
+
"memberFieldName": "constructor"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"@id": "caiq:components/cli/CliArgsHandlerBase.jsonld#CliArgsHandlerBase__member_getScriptOutput",
|
|
41
|
+
"memberFieldName": "getScriptOutput"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"@id": "caiq:components/cli/CliArgsHandlerBase.jsonld#CliArgsHandlerBase__member_isDevelopmentEnvironment",
|
|
45
|
+
"memberFieldName": "isDevelopmentEnvironment"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"@id": "caiq:components/cli/CliArgsHandlerBase.jsonld#CliArgsHandlerBase__member_getSourceObjectFromString",
|
|
49
|
+
"memberFieldName": "getSourceObjectFromString"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"@id": "caiq:components/cli/CliArgsHandlerBase.jsonld#CliArgsHandlerBase__member_populateYargs",
|
|
53
|
+
"memberFieldName": "populateYargs"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"@id": "caiq:components/cli/CliArgsHandlerBase.jsonld#CliArgsHandlerBase__member_handleArgs",
|
|
57
|
+
"memberFieldName": "handleArgs"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"constructorArguments": [
|
|
61
|
+
{
|
|
62
|
+
"@id": "caiq:components/cli/CliArgsHandlerBase.jsonld#CliArgsHandlerBase_initialContext"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-query/^2.0.0/components/context.jsonld",
|
|
4
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/types/^2.0.0/components/context.jsonld"
|
|
5
|
+
],
|
|
6
|
+
"@id": "npmd:@comunica/actor-init-query",
|
|
7
|
+
"components": [
|
|
8
|
+
{
|
|
9
|
+
"@id": "caiq:components/cli/CliArgsHandlerHttp.jsonld#CliArgsHandlerHttp",
|
|
10
|
+
"@type": "Class",
|
|
11
|
+
"requireElement": "CliArgsHandlerHttp",
|
|
12
|
+
"extends": [
|
|
13
|
+
"ct:components/ICliArgsHandler.jsonld#ICliArgsHandler"
|
|
14
|
+
],
|
|
15
|
+
"comment": "CLI arguments handler that handles options for HTTP servers.",
|
|
16
|
+
"parameters": [],
|
|
17
|
+
"memberFields": [
|
|
18
|
+
{
|
|
19
|
+
"@id": "caiq:components/cli/CliArgsHandlerHttp.jsonld#CliArgsHandlerHttp__member_populateYargs",
|
|
20
|
+
"memberFieldName": "populateYargs"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"@id": "caiq:components/cli/CliArgsHandlerHttp.jsonld#CliArgsHandlerHttp__member_handleArgs",
|
|
24
|
+
"memberFieldName": "handleArgs"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"constructorArguments": []
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-query/^2.0.0/components/context.jsonld",
|
|
4
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/types/^2.0.0/components/context.jsonld"
|
|
5
|
+
],
|
|
6
|
+
"@id": "npmd:@comunica/actor-init-query",
|
|
7
|
+
"components": [
|
|
8
|
+
{
|
|
9
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery",
|
|
10
|
+
"@type": "Class",
|
|
11
|
+
"requireElement": "CliArgsHandlerQuery",
|
|
12
|
+
"extends": [
|
|
13
|
+
"ct:components/ICliArgsHandler.jsonld#ICliArgsHandler"
|
|
14
|
+
],
|
|
15
|
+
"comment": "CLI arguments handler that handles options for query execution.",
|
|
16
|
+
"parameters": [
|
|
17
|
+
{
|
|
18
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery_defaultQueryInputFormat",
|
|
19
|
+
"range": {
|
|
20
|
+
"@type": "ParameterRangeUnion",
|
|
21
|
+
"parameterRangeElements": [
|
|
22
|
+
"xsd:string",
|
|
23
|
+
{
|
|
24
|
+
"@type": "ParameterRangeUndefined"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery_queryString",
|
|
31
|
+
"range": {
|
|
32
|
+
"@type": "ParameterRangeUnion",
|
|
33
|
+
"parameterRangeElements": [
|
|
34
|
+
"xsd:string",
|
|
35
|
+
{
|
|
36
|
+
"@type": "ParameterRangeUndefined"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery_context",
|
|
43
|
+
"range": {
|
|
44
|
+
"@type": "ParameterRangeUnion",
|
|
45
|
+
"parameterRangeElements": [
|
|
46
|
+
"xsd:string",
|
|
47
|
+
{
|
|
48
|
+
"@type": "ParameterRangeUndefined"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"memberFields": [
|
|
55
|
+
{
|
|
56
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery__member_defaultQueryInputFormat",
|
|
57
|
+
"memberFieldName": "defaultQueryInputFormat"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery__member_queryString",
|
|
61
|
+
"memberFieldName": "queryString"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery__member_context",
|
|
65
|
+
"memberFieldName": "context"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery__member_constructor",
|
|
69
|
+
"memberFieldName": "constructor"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery__member_populateYargs",
|
|
73
|
+
"memberFieldName": "populateYargs"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery__member_handleArgs",
|
|
77
|
+
"memberFieldName": "handleArgs"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"constructorArguments": [
|
|
81
|
+
{
|
|
82
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery_defaultQueryInputFormat"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery_queryString"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery_context"
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-query/^2.0.0/components/context.jsonld"
|
|
4
|
+
],
|
|
5
|
+
"@id": "npmd:@comunica/actor-init-query",
|
|
6
|
+
"components": [
|
|
7
|
+
{
|
|
8
|
+
"@id": "caiq:components/cli/ICliArgsHandler.jsonld#ICliArgsHandler",
|
|
9
|
+
"@type": "AbstractClass",
|
|
10
|
+
"requireElement": "ICliArgsHandler",
|
|
11
|
+
"comment": "These handlers enable manipulation of the CLI arguments and their processing. Implementations of this interface can be passed via the {@link KeysInitSparql.cliArgsHandlers} context entry.",
|
|
12
|
+
"parameters": [],
|
|
13
|
+
"memberKeys": [
|
|
14
|
+
"populateYargs",
|
|
15
|
+
"handleArgs"
|
|
16
|
+
],
|
|
17
|
+
"constructorArguments": []
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-init-query/^2.0.0/components/context.jsonld"
|
|
4
|
+
],
|
|
5
|
+
"@id": "npmd:@comunica/actor-init-query",
|
|
6
|
+
"@type": "Module",
|
|
7
|
+
"requireName": "@comunica/actor-init-query",
|
|
8
|
+
"import": [
|
|
9
|
+
"caiq:components/QueryEngineBase.jsonld",
|
|
10
|
+
"caiq:components/ActorInitQueryBase.jsonld",
|
|
11
|
+
"caiq:components/ActorInitQuery.jsonld",
|
|
12
|
+
"caiq:components/HttpServiceSparqlEndpoint.jsonld",
|
|
13
|
+
"caiq:components/cli/CliArgsHandlerBase.jsonld",
|
|
14
|
+
"caiq:components/cli/CliArgsHandlerHttp.jsonld",
|
|
15
|
+
"caiq:components/cli/CliArgsHandlerQuery.jsonld",
|
|
16
|
+
"caiq:components/MemoryPhysicalQueryPlanLogger.jsonld",
|
|
17
|
+
"caiq:components/QueryEngineFactoryBase.jsonld"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": [
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^4.0.0/components/context.jsonld",
|
|
4
|
+
{
|
|
5
|
+
"npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
|
|
6
|
+
"caiq": "npmd:@comunica/actor-init-query/^2.0.0/",
|
|
7
|
+
"QueryEngineBase": {
|
|
8
|
+
"@id": "caiq:components/QueryEngineBase.jsonld#QueryEngineBase",
|
|
9
|
+
"@prefix": true,
|
|
10
|
+
"@context": {
|
|
11
|
+
"actorInitQuery": {
|
|
12
|
+
"@id": "caiq:components/QueryEngineBase.jsonld#QueryEngineBase_actorInitQuery"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"ActorInitQueryBase": {
|
|
17
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase",
|
|
18
|
+
"@prefix": true,
|
|
19
|
+
"@context": {
|
|
20
|
+
"args_mediatorOptimizeQueryOperation": {
|
|
21
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_mediatorOptimizeQueryOperation"
|
|
22
|
+
},
|
|
23
|
+
"args_mediatorQueryOperation": {
|
|
24
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_mediatorQueryOperation"
|
|
25
|
+
},
|
|
26
|
+
"args_mediatorQueryParse": {
|
|
27
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_mediatorQueryParse"
|
|
28
|
+
},
|
|
29
|
+
"args_mediatorQueryResultSerialize": {
|
|
30
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_mediatorQueryResultSerialize"
|
|
31
|
+
},
|
|
32
|
+
"args_mediatorQueryResultSerializeMediaTypeCombiner": {
|
|
33
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_mediatorQueryResultSerializeMediaTypeCombiner"
|
|
34
|
+
},
|
|
35
|
+
"args_mediatorQueryResultSerializeMediaTypeFormatCombiner": {
|
|
36
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_mediatorQueryResultSerializeMediaTypeFormatCombiner"
|
|
37
|
+
},
|
|
38
|
+
"args_mediatorContextPreprocess": {
|
|
39
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_mediatorContextPreprocess"
|
|
40
|
+
},
|
|
41
|
+
"args_mediatorHttpInvalidate": {
|
|
42
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_mediatorHttpInvalidate"
|
|
43
|
+
},
|
|
44
|
+
"args_logger": {
|
|
45
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_logger"
|
|
46
|
+
},
|
|
47
|
+
"args_queryString": {
|
|
48
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_queryString"
|
|
49
|
+
},
|
|
50
|
+
"args_defaultQueryInputFormat": {
|
|
51
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_defaultQueryInputFormat"
|
|
52
|
+
},
|
|
53
|
+
"args_context": {
|
|
54
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_context"
|
|
55
|
+
},
|
|
56
|
+
"args_contextKeyShortcuts": {
|
|
57
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_contextKeyShortcuts",
|
|
58
|
+
"@type": "@json"
|
|
59
|
+
},
|
|
60
|
+
"args_name": {
|
|
61
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_name"
|
|
62
|
+
},
|
|
63
|
+
"args_bus": {
|
|
64
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_bus"
|
|
65
|
+
},
|
|
66
|
+
"args_beforeActors": {
|
|
67
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_beforeActors",
|
|
68
|
+
"@container": "@list"
|
|
69
|
+
},
|
|
70
|
+
"mediatorOptimizeQueryOperation": {
|
|
71
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_mediatorOptimizeQueryOperation"
|
|
72
|
+
},
|
|
73
|
+
"mediatorQueryOperation": {
|
|
74
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_mediatorQueryOperation"
|
|
75
|
+
},
|
|
76
|
+
"mediatorQueryParse": {
|
|
77
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_mediatorQueryParse"
|
|
78
|
+
},
|
|
79
|
+
"mediatorQueryResultSerialize": {
|
|
80
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_mediatorQueryResultSerialize"
|
|
81
|
+
},
|
|
82
|
+
"mediatorQueryResultSerializeMediaTypeCombiner": {
|
|
83
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_mediatorQueryResultSerializeMediaTypeCombiner"
|
|
84
|
+
},
|
|
85
|
+
"mediatorQueryResultSerializeMediaTypeFormatCombiner": {
|
|
86
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_mediatorQueryResultSerializeMediaTypeFormatCombiner"
|
|
87
|
+
},
|
|
88
|
+
"mediatorContextPreprocess": {
|
|
89
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_mediatorContextPreprocess"
|
|
90
|
+
},
|
|
91
|
+
"mediatorHttpInvalidate": {
|
|
92
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_mediatorHttpInvalidate"
|
|
93
|
+
},
|
|
94
|
+
"logger": {
|
|
95
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_logger"
|
|
96
|
+
},
|
|
97
|
+
"queryString": {
|
|
98
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_queryString"
|
|
99
|
+
},
|
|
100
|
+
"defaultQueryInputFormat": {
|
|
101
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_defaultQueryInputFormat"
|
|
102
|
+
},
|
|
103
|
+
"context": {
|
|
104
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_context"
|
|
105
|
+
},
|
|
106
|
+
"contextKeyShortcuts": {
|
|
107
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_contextKeyShortcuts",
|
|
108
|
+
"@type": "@json"
|
|
109
|
+
},
|
|
110
|
+
"name": {
|
|
111
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_name"
|
|
112
|
+
},
|
|
113
|
+
"bus": {
|
|
114
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_bus"
|
|
115
|
+
},
|
|
116
|
+
"beforeActors": {
|
|
117
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#ActorInitQueryBase_args_beforeActors",
|
|
118
|
+
"@container": "@list"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"IActorInitQueryBaseArgs": {
|
|
123
|
+
"@id": "caiq:components/ActorInitQueryBase.jsonld#IActorInitQueryBaseArgs",
|
|
124
|
+
"@prefix": true,
|
|
125
|
+
"@context": {}
|
|
126
|
+
},
|
|
127
|
+
"ActorInitQuery": {
|
|
128
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery",
|
|
129
|
+
"@prefix": true,
|
|
130
|
+
"@context": {
|
|
131
|
+
"args_mediatorOptimizeQueryOperation": {
|
|
132
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_mediatorOptimizeQueryOperation"
|
|
133
|
+
},
|
|
134
|
+
"args_mediatorQueryOperation": {
|
|
135
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_mediatorQueryOperation"
|
|
136
|
+
},
|
|
137
|
+
"args_mediatorQueryParse": {
|
|
138
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_mediatorQueryParse"
|
|
139
|
+
},
|
|
140
|
+
"args_mediatorQueryResultSerialize": {
|
|
141
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_mediatorQueryResultSerialize"
|
|
142
|
+
},
|
|
143
|
+
"args_mediatorQueryResultSerializeMediaTypeCombiner": {
|
|
144
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_mediatorQueryResultSerializeMediaTypeCombiner"
|
|
145
|
+
},
|
|
146
|
+
"args_mediatorQueryResultSerializeMediaTypeFormatCombiner": {
|
|
147
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_mediatorQueryResultSerializeMediaTypeFormatCombiner"
|
|
148
|
+
},
|
|
149
|
+
"args_mediatorContextPreprocess": {
|
|
150
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_mediatorContextPreprocess"
|
|
151
|
+
},
|
|
152
|
+
"args_mediatorHttpInvalidate": {
|
|
153
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_mediatorHttpInvalidate"
|
|
154
|
+
},
|
|
155
|
+
"args_logger": {
|
|
156
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_logger"
|
|
157
|
+
},
|
|
158
|
+
"args_queryString": {
|
|
159
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_queryString"
|
|
160
|
+
},
|
|
161
|
+
"args_defaultQueryInputFormat": {
|
|
162
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_defaultQueryInputFormat"
|
|
163
|
+
},
|
|
164
|
+
"args_context": {
|
|
165
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_context"
|
|
166
|
+
},
|
|
167
|
+
"args_contextKeyShortcuts": {
|
|
168
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_contextKeyShortcuts",
|
|
169
|
+
"@type": "@json"
|
|
170
|
+
},
|
|
171
|
+
"args_name": {
|
|
172
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_name"
|
|
173
|
+
},
|
|
174
|
+
"args_bus": {
|
|
175
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_bus"
|
|
176
|
+
},
|
|
177
|
+
"args_beforeActors": {
|
|
178
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_beforeActors",
|
|
179
|
+
"@container": "@list"
|
|
180
|
+
},
|
|
181
|
+
"mediatorOptimizeQueryOperation": {
|
|
182
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_mediatorOptimizeQueryOperation"
|
|
183
|
+
},
|
|
184
|
+
"mediatorQueryOperation": {
|
|
185
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_mediatorQueryOperation"
|
|
186
|
+
},
|
|
187
|
+
"mediatorQueryParse": {
|
|
188
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_mediatorQueryParse"
|
|
189
|
+
},
|
|
190
|
+
"mediatorQueryResultSerialize": {
|
|
191
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_mediatorQueryResultSerialize"
|
|
192
|
+
},
|
|
193
|
+
"mediatorQueryResultSerializeMediaTypeCombiner": {
|
|
194
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_mediatorQueryResultSerializeMediaTypeCombiner"
|
|
195
|
+
},
|
|
196
|
+
"mediatorQueryResultSerializeMediaTypeFormatCombiner": {
|
|
197
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_mediatorQueryResultSerializeMediaTypeFormatCombiner"
|
|
198
|
+
},
|
|
199
|
+
"mediatorContextPreprocess": {
|
|
200
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_mediatorContextPreprocess"
|
|
201
|
+
},
|
|
202
|
+
"mediatorHttpInvalidate": {
|
|
203
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_mediatorHttpInvalidate"
|
|
204
|
+
},
|
|
205
|
+
"logger": {
|
|
206
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_logger"
|
|
207
|
+
},
|
|
208
|
+
"queryString": {
|
|
209
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_queryString"
|
|
210
|
+
},
|
|
211
|
+
"defaultQueryInputFormat": {
|
|
212
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_defaultQueryInputFormat"
|
|
213
|
+
},
|
|
214
|
+
"context": {
|
|
215
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_context"
|
|
216
|
+
},
|
|
217
|
+
"contextKeyShortcuts": {
|
|
218
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_contextKeyShortcuts",
|
|
219
|
+
"@type": "@json"
|
|
220
|
+
},
|
|
221
|
+
"name": {
|
|
222
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_name"
|
|
223
|
+
},
|
|
224
|
+
"bus": {
|
|
225
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_bus"
|
|
226
|
+
},
|
|
227
|
+
"beforeActors": {
|
|
228
|
+
"@id": "caiq:components/ActorInitQuery.jsonld#ActorInitQuery_args_beforeActors",
|
|
229
|
+
"@container": "@list"
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
"IQueryBody": {
|
|
234
|
+
"@id": "caiq:components/HttpServiceSparqlEndpoint.jsonld#IQueryBody",
|
|
235
|
+
"@prefix": true,
|
|
236
|
+
"@context": {}
|
|
237
|
+
},
|
|
238
|
+
"IHttpServiceSparqlEndpointArgs": {
|
|
239
|
+
"@id": "caiq:components/HttpServiceSparqlEndpoint.jsonld#IHttpServiceSparqlEndpointArgs",
|
|
240
|
+
"@prefix": true,
|
|
241
|
+
"@context": {}
|
|
242
|
+
},
|
|
243
|
+
"CliArgsHandlerBase": {
|
|
244
|
+
"@id": "caiq:components/cli/CliArgsHandlerBase.jsonld#CliArgsHandlerBase",
|
|
245
|
+
"@prefix": true,
|
|
246
|
+
"@context": {
|
|
247
|
+
"initialContext": {
|
|
248
|
+
"@id": "caiq:components/cli/CliArgsHandlerBase.jsonld#CliArgsHandlerBase_initialContext"
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"CliArgsHandlerHttp": {
|
|
253
|
+
"@id": "caiq:components/cli/CliArgsHandlerHttp.jsonld#CliArgsHandlerHttp",
|
|
254
|
+
"@prefix": true,
|
|
255
|
+
"@context": {}
|
|
256
|
+
},
|
|
257
|
+
"CliArgsHandlerQuery": {
|
|
258
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery",
|
|
259
|
+
"@prefix": true,
|
|
260
|
+
"@context": {
|
|
261
|
+
"defaultQueryInputFormat": {
|
|
262
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery_defaultQueryInputFormat"
|
|
263
|
+
},
|
|
264
|
+
"queryString": {
|
|
265
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery_queryString"
|
|
266
|
+
},
|
|
267
|
+
"context": {
|
|
268
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery_context"
|
|
269
|
+
},
|
|
270
|
+
"ueryInputFormat": {
|
|
271
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery_defaultQueryInputFormat"
|
|
272
|
+
},
|
|
273
|
+
"ing": {
|
|
274
|
+
"@id": "caiq:components/cli/CliArgsHandlerQuery.jsonld#CliArgsHandlerQuery_queryString"
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
"MemoryPhysicalQueryPlanLogger": {
|
|
279
|
+
"@id": "caiq:components/MemoryPhysicalQueryPlanLogger.jsonld#MemoryPhysicalQueryPlanLogger",
|
|
280
|
+
"@prefix": true,
|
|
281
|
+
"@context": {}
|
|
282
|
+
},
|
|
283
|
+
"IDynamicQueryEngineOptions": {
|
|
284
|
+
"@id": "caiq:components/QueryEngineFactoryBase.jsonld#IDynamicQueryEngineOptions",
|
|
285
|
+
"@prefix": true,
|
|
286
|
+
"@context": {}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
]
|
|
290
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActorInitQuery = void 0;
|
|
4
|
+
/* eslint-disable unicorn/filename-case */
|
|
5
|
+
/* eslint-enable unicorn/filename-case */
|
|
6
|
+
const ActorInitQueryBase_1 = require("./ActorInitQueryBase");
|
|
7
|
+
class ActorInitQuery extends ActorInitQueryBase_1.ActorInitQueryBase {
|
|
8
|
+
}
|
|
9
|
+
exports.ActorInitQuery = ActorInitQuery;
|
|
10
|
+
//# sourceMappingURL=ActorInitQuery-browser.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IActionInit, IActorOutputInit } from '@comunica/bus-init';
|
|
2
|
+
import type { IActorInitQueryBaseArgs } from './ActorInitQueryBase';
|
|
3
|
+
import { ActorInitQueryBase } from './ActorInitQueryBase';
|
|
4
|
+
/**
|
|
5
|
+
* A comunica Query Init Actor.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ActorInitQuery extends ActorInitQueryBase {
|
|
8
|
+
constructor(args: IActorInitQueryBaseArgs);
|
|
9
|
+
run(action: IActionInit): Promise<IActorOutputInit>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActorInitQuery = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const context_entries_1 = require("@comunica/context-entries");
|
|
6
|
+
const yargs_1 = require("yargs");
|
|
7
|
+
const ActorInitQueryBase_1 = require("./ActorInitQueryBase");
|
|
8
|
+
const CliArgsHandlerBase_1 = require("./cli/CliArgsHandlerBase");
|
|
9
|
+
const CliArgsHandlerQuery_1 = require("./cli/CliArgsHandlerQuery");
|
|
10
|
+
const QueryEngineBase_1 = require("./QueryEngineBase");
|
|
11
|
+
const streamifyString = require('streamify-string');
|
|
12
|
+
/**
|
|
13
|
+
* A comunica Query Init Actor.
|
|
14
|
+
*/
|
|
15
|
+
class ActorInitQuery extends ActorInitQueryBase_1.ActorInitQueryBase {
|
|
16
|
+
constructor(args) {
|
|
17
|
+
super(args);
|
|
18
|
+
}
|
|
19
|
+
async run(action) {
|
|
20
|
+
// Wrap this actor in a query engine so we can conveniently execute queries
|
|
21
|
+
const queryEngine = new QueryEngineBase_1.QueryEngineBase(this);
|
|
22
|
+
const cliArgsHandlers = [
|
|
23
|
+
new CliArgsHandlerBase_1.CliArgsHandlerBase(action.context),
|
|
24
|
+
new CliArgsHandlerQuery_1.CliArgsHandlerQuery(this.defaultQueryInputFormat, this.queryString, this.context),
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/non-nullable-type-assertion-style
|
|
26
|
+
...action.context?.get(context_entries_1.KeysInitQuery.cliArgsHandlers) || [],
|
|
27
|
+
];
|
|
28
|
+
// Populate yargs arguments object
|
|
29
|
+
let argumentsBuilder = (0, yargs_1.default)({});
|
|
30
|
+
for (const cliArgsHandler of cliArgsHandlers) {
|
|
31
|
+
argumentsBuilder = cliArgsHandler.populateYargs(argumentsBuilder);
|
|
32
|
+
}
|
|
33
|
+
// Extract raw argument values from parsed yargs object, so that we can handle each of them hereafter
|
|
34
|
+
let args;
|
|
35
|
+
try {
|
|
36
|
+
args = await argumentsBuilder.parse(action.argv);
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
return {
|
|
40
|
+
stderr: require('streamify-string')(`${await argumentsBuilder.getHelp()}\n\n${error.message}\n`),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
// Print supported MIME types
|
|
44
|
+
if (args.listformats) {
|
|
45
|
+
const mediaTypes = await queryEngine.getResultMediaTypes();
|
|
46
|
+
return { stdout: require('streamify-string')(`${Object.keys(mediaTypes).join('\n')}\n`) };
|
|
47
|
+
}
|
|
48
|
+
// Define query
|
|
49
|
+
// We need to do this before the cliArgsHandlers, as we may modify the sources array
|
|
50
|
+
let query;
|
|
51
|
+
if (args.query) {
|
|
52
|
+
query = args.query;
|
|
53
|
+
}
|
|
54
|
+
else if (args.file) {
|
|
55
|
+
query = (0, fs_1.readFileSync)(args.file, { encoding: 'utf8' });
|
|
56
|
+
}
|
|
57
|
+
else if (args.sources.length > 0) {
|
|
58
|
+
query = args.sources[args.sources.length - 1];
|
|
59
|
+
args.sources.pop();
|
|
60
|
+
}
|
|
61
|
+
// Invoke args handlers to process any remaining args
|
|
62
|
+
const context = {};
|
|
63
|
+
try {
|
|
64
|
+
for (const cliArgsHandler of cliArgsHandlers) {
|
|
65
|
+
await cliArgsHandler.handleArgs(args, context);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
return { stderr: require('streamify-string')(error.message) };
|
|
70
|
+
}
|
|
71
|
+
// Evaluate query
|
|
72
|
+
const queryResult = await queryEngine.queryOrExplain(query, context);
|
|
73
|
+
// Output query explanations in a different way
|
|
74
|
+
if ('explain' in queryResult) {
|
|
75
|
+
return {
|
|
76
|
+
stdout: streamifyString(JSON.stringify(queryResult.data, null, ' ')),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
// Serialize output according to media type
|
|
80
|
+
const stdout = (await queryEngine.resultToString(queryResult, args.outputType, queryResult.context)).data;
|
|
81
|
+
return { stdout };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.ActorInitQuery = ActorInitQuery;
|
|
85
|
+
//# sourceMappingURL=ActorInitQuery.js.map
|