@comunica/actor-query-source-identify-serialized 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/components/ActorQuerySourceIdentifySerialized.jsonld +15 -20
- package/components/components.jsonld +1 -1
- package/components/context.jsonld +1 -1
- package/lib/ActorQuerySourceIdentifySerialized.d.ts +0 -1
- package/lib/ActorQuerySourceIdentifySerialized.js +5 -1
- package/lib/ActorQuerySourceIdentifySerialized.js.map +1 -1
- package/lib/index.d.ts +0 -0
- package/lib/index.js +0 -0
- package/lib/index.js.map +0 -0
- package/package.json +7 -7
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": [
|
|
3
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-source-identify-serialized/^
|
|
4
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^
|
|
5
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-source-identify/^
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-source-identify-serialized/^5.0.0/components/context.jsonld",
|
|
4
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/core/^5.0.0/components/context.jsonld",
|
|
5
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-source-identify/^5.0.0/components/context.jsonld"
|
|
6
6
|
],
|
|
7
7
|
"@id": "npmd:@comunica/actor-query-source-identify-serialized",
|
|
8
8
|
"components": [
|
|
@@ -45,37 +45,37 @@
|
|
|
45
45
|
"genericTypeInstances": [
|
|
46
46
|
{
|
|
47
47
|
"@type": "ParameterRangeGenericTypeReference",
|
|
48
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
48
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
"@type": "ParameterRangeGenericTypeReference",
|
|
52
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
52
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
"@type": "ParameterRangeGenericTypeReference",
|
|
56
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
56
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
"@type": "ParameterRangeGenericTypeReference",
|
|
60
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
60
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
61
61
|
}
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
"@type": "ParameterRangeGenericTypeReference",
|
|
66
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
66
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
"@type": "ParameterRangeGenericTypeReference",
|
|
70
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
70
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
"@type": "ParameterRangeGenericTypeReference",
|
|
74
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
74
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
"@type": "ParameterRangeGenericTypeReference",
|
|
78
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
78
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
79
79
|
}
|
|
80
80
|
]
|
|
81
81
|
},
|
|
@@ -112,19 +112,19 @@
|
|
|
112
112
|
"genericTypeInstances": [
|
|
113
113
|
{
|
|
114
114
|
"@type": "ParameterRangeGenericTypeReference",
|
|
115
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
115
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_I"
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
118
|
"@type": "ParameterRangeGenericTypeReference",
|
|
119
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
119
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_T"
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
"@type": "ParameterRangeGenericTypeReference",
|
|
123
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
123
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_O"
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
126
|
"@type": "ParameterRangeGenericTypeReference",
|
|
127
|
-
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^
|
|
127
|
+
"parameterRangeGenericType": "npmd:@comunica/actor-abstract-mediatyped/^5.0.0/components/ActorAbstractMediaTyped.jsonld#ActorAbstractMediaTyped__generic_TS"
|
|
128
128
|
}
|
|
129
129
|
]
|
|
130
130
|
}
|
|
@@ -138,11 +138,6 @@
|
|
|
138
138
|
}
|
|
139
139
|
],
|
|
140
140
|
"memberFields": [
|
|
141
|
-
{
|
|
142
|
-
"@id": "caqsis:components/ActorQuerySourceIdentifySerialized.jsonld#ActorQuerySourceIdentifySerialized__member_cacheSize",
|
|
143
|
-
"memberFieldName": "cacheSize",
|
|
144
|
-
"range": "xsd:number"
|
|
145
|
-
},
|
|
146
141
|
{
|
|
147
142
|
"@id": "caqsis:components/ActorQuerySourceIdentifySerialized.jsonld#ActorQuerySourceIdentifySerialized__member_mediatorRdfParse",
|
|
148
143
|
"memberFieldName": "mediatorRdfParse",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": [
|
|
3
|
-
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-source-identify-serialized/^
|
|
3
|
+
"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-source-identify-serialized/^5.0.0/components/context.jsonld"
|
|
4
4
|
],
|
|
5
5
|
"@id": "npmd:@comunica/actor-query-source-identify-serialized",
|
|
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
|
-
"caqsis": "npmd:@comunica/actor-query-source-identify-serialized/^
|
|
6
|
+
"caqsis": "npmd:@comunica/actor-query-source-identify-serialized/^5.0.0/",
|
|
7
7
|
"ActorQuerySourceIdentifySerialized": {
|
|
8
8
|
"@id": "caqsis:components/ActorQuerySourceIdentifySerialized.jsonld#ActorQuerySourceIdentifySerialized",
|
|
9
9
|
"@prefix": true,
|
|
@@ -8,7 +8,6 @@ import type * as RDF from '@rdfjs/types';
|
|
|
8
8
|
* A comunica Serialized Query Source Identify Actor.
|
|
9
9
|
*/
|
|
10
10
|
export declare class ActorQuerySourceIdentifySerialized extends ActorQuerySourceIdentify {
|
|
11
|
-
readonly cacheSize: number;
|
|
12
11
|
readonly mediatorRdfParse: MediatorRdfParseHandle;
|
|
13
12
|
readonly mediatorQuerySourceIdentify: MediatorQuerySourceIdentify;
|
|
14
13
|
constructor(args: IActorQuerySourceIdentifySerializedArgs);
|
|
@@ -9,8 +9,12 @@ const readable_stream_1 = require("readable-stream");
|
|
|
9
9
|
* A comunica Serialized Query Source Identify Actor.
|
|
10
10
|
*/
|
|
11
11
|
class ActorQuerySourceIdentifySerialized extends bus_query_source_identify_1.ActorQuerySourceIdentify {
|
|
12
|
+
mediatorRdfParse;
|
|
13
|
+
mediatorQuerySourceIdentify;
|
|
12
14
|
constructor(args) {
|
|
13
15
|
super(args);
|
|
16
|
+
this.mediatorRdfParse = args.mediatorRdfParse;
|
|
17
|
+
this.mediatorQuerySourceIdentify = args.mediatorQuerySourceIdentify;
|
|
14
18
|
}
|
|
15
19
|
async test(action) {
|
|
16
20
|
if (!this.isStringSource(action.querySourceUnidentified)) {
|
|
@@ -46,7 +50,7 @@ class ActorQuerySourceIdentifySerialized extends bus_query_source_identify_1.Act
|
|
|
46
50
|
const parseAction = {
|
|
47
51
|
context,
|
|
48
52
|
handle: {
|
|
49
|
-
metadata: { baseIRI: source.baseIRI },
|
|
53
|
+
metadata: { baseIRI: source.baseIRI, version: source.version },
|
|
50
54
|
data: textStream,
|
|
51
55
|
context,
|
|
52
56
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActorQuerySourceIdentifySerialized.js","sourceRoot":"","sources":["ActorQuerySourceIdentifySerialized.ts"],"names":[],"mappings":";;;AAMA,mFAA+E;AAG/E,yCAAwD;AAOxD,uDAA+C;AAC/C,qDAA2C;AAE3C;;GAEG;AACH,MAAa,kCAAmC,SAAQ,oDAAwB;
|
|
1
|
+
{"version":3,"file":"ActorQuerySourceIdentifySerialized.js","sourceRoot":"","sources":["ActorQuerySourceIdentifySerialized.ts"],"names":[],"mappings":";;;AAMA,mFAA+E;AAG/E,yCAAwD;AAOxD,uDAA+C;AAC/C,qDAA2C;AAE3C;;GAEG;AACH,MAAa,kCAAmC,SAAQ,oDAAwB;IAC9D,gBAAgB,CAAyB;IACzC,2BAA2B,CAA8B;IAEzE,YAAmB,IAA6C;QAC9D,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAC9C,IAAI,CAAC,2BAA2B,GAAG,IAAI,CAAC,2BAA2B,CAAC;IACtE,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,MAAkC;QAClD,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,uBAAuB,CAAC,EAAE,CAAC;YACzD,OAAO,IAAA,eAAQ,EAAC,GAAG,IAAI,CAAC,IAAI,oFAAoF,CAAC,CAAC;QACpH,CAAC;QACD,OAAO,IAAA,mBAAY,GAAE,CAAC;IACxB,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,MAAkC;QACjD,uGAAuG;QACvG,OAAO,MAAM,IAAI,CAAC,2BAA2B,CAAC,OAAO,CAAC;YACpD,uBAAuB,EAAE;gBACvB,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,EAA2B,MAAM,CAAC,uBAAuB,CAAC;gBACvG,OAAO,EAAE,MAAM,CAAC,uBAAuB,CAAC,OAAO;aAChD;YACD,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACO,KAAK,CAAC,YAAY,CAAC,OAAuB,EAAE,MAA8B;QAClF,MAAM,UAAU,GAAG,IAAI,0BAAQ,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,0BAA0B;QAC1B,UAAU,CAAC,KAAK,GAAG,GAAG,EAAE;YACtB,aAAa;QACf,CAAC,CAAC;QACF,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9B,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEtB,MAAM,WAAW,GAA0B;YACzC,OAAO;YACP,MAAM,EAAE;gBACN,QAAQ,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE;gBAC9D,IAAI,EAAE,UAAU;gBAChB,OAAO;aACR;YACD,eAAe,EAAE,MAAM,CAAC,SAAS;SAClC,CAAC;QAEF,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACrE,OAAO,MAAM,IAAA,8BAAW,EAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;IAEO,cAAc,CAAC,MAAuC;QAC5D,IAAI,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,EAAE,CAAC;YACxB,IAAI,CAAC,CAAC,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,EAAE,CAAC;gBACxC,OAAO,KAAK,CAAC;YACf,CAAC;YACD,OAAO,WAAW,IAAI,MAAM,CAAC;QAC/B,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC;IACtC,CAAC;CACF;AAnED,gFAmEC","sourcesContent":["import type {\n IActionQuerySourceIdentify,\n IActorQuerySourceIdentifyOutput,\n IActorQuerySourceIdentifyArgs,\n MediatorQuerySourceIdentify,\n} from '@comunica/bus-query-source-identify';\nimport { ActorQuerySourceIdentify } from '@comunica/bus-query-source-identify';\nimport type { IActionRdfParseHandle, MediatorRdfParseHandle } from '@comunica/bus-rdf-parse';\nimport type { IActorTest, TestResult } from '@comunica/core';\nimport { failTest, passTestVoid } from '@comunica/core';\nimport type {\n IQuerySourceSerialized,\n QuerySourceUnidentifiedExpanded,\n IActionContext,\n} from '@comunica/types';\nimport type * as RDF from '@rdfjs/types';\nimport { storeStream } from 'rdf-store-stream';\nimport { Readable } from 'readable-stream';\n\n/**\n * A comunica Serialized Query Source Identify Actor.\n */\nexport class ActorQuerySourceIdentifySerialized extends ActorQuerySourceIdentify {\n public readonly mediatorRdfParse: MediatorRdfParseHandle;\n public readonly mediatorQuerySourceIdentify: MediatorQuerySourceIdentify;\n\n public constructor(args: IActorQuerySourceIdentifySerializedArgs) {\n super(args);\n this.mediatorRdfParse = args.mediatorRdfParse;\n this.mediatorQuerySourceIdentify = args.mediatorQuerySourceIdentify;\n }\n\n public async test(action: IActionQuerySourceIdentify): Promise<TestResult<IActorTest>> {\n if (!this.isStringSource(action.querySourceUnidentified)) {\n return failTest(`${this.name} requires a single query source with serialized type to be present in the context.`);\n }\n return passTestVoid();\n }\n\n public async run(action: IActionQuerySourceIdentify): Promise<IActorQuerySourceIdentifyOutput> {\n // Delegate source identification to the same bus again, by converting the string into an RDF/JS source\n return await this.mediatorQuerySourceIdentify.mediate({\n querySourceUnidentified: {\n type: 'rdfjs',\n value: await this.getRdfSource(action.context, <IQuerySourceSerialized> action.querySourceUnidentified),\n context: action.querySourceUnidentified.context,\n },\n context: action.context,\n });\n }\n\n /**\n * Parses the string data source through the RDF parse bus, returning the RDF source.\n * @param context The run action context\n * @param source The source from the run action context\n * @returns Parsed RDF source that can be passed to quad pattern resolve mediator as an RDF/JS source\n */\n protected async getRdfSource(context: IActionContext, source: IQuerySourceSerialized): Promise<RDF.Source> {\n const textStream = new Readable({ objectMode: true });\n /* istanbul ignore next */\n textStream._read = () => {\n // Do nothing\n };\n textStream.push(source.value);\n textStream.push(null);\n\n const parseAction: IActionRdfParseHandle = {\n context,\n handle: {\n metadata: { baseIRI: source.baseIRI, version: source.version },\n data: textStream,\n context,\n },\n handleMediaType: source.mediaType,\n };\n\n const parseResult = await this.mediatorRdfParse.mediate(parseAction);\n return await storeStream(parseResult.handle.data);\n }\n\n private isStringSource(source: QuerySourceUnidentifiedExpanded): source is IQuerySourceSerialized {\n if (!('type' in source)) {\n if (!(typeof source.value === 'string')) {\n return false;\n }\n return 'mediaType' in source;\n }\n return source.type === 'serialized';\n }\n}\n\nexport interface IActorQuerySourceIdentifySerializedArgs extends IActorQuerySourceIdentifyArgs {\n /**\n * The quad pattern parser mediator.\n */\n mediatorRdfParse: MediatorRdfParseHandle;\n /**\n * The query source identify mediator.\n */\n mediatorQuerySourceIdentify: MediatorQuerySourceIdentify;\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-query-source-identify-serialized",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "A serialized query-source-identify actor",
|
|
5
5
|
"lsd:module": true,
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"build:components": "componentsjs-generator"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@comunica/bus-query-source-identify": "^
|
|
45
|
-
"@comunica/bus-rdf-parse": "^
|
|
46
|
-
"@comunica/core": "^
|
|
47
|
-
"@comunica/types": "^
|
|
44
|
+
"@comunica/bus-query-source-identify": "^5.0.0",
|
|
45
|
+
"@comunica/bus-rdf-parse": "^5.0.0",
|
|
46
|
+
"@comunica/core": "^5.0.0",
|
|
47
|
+
"@comunica/types": "^5.0.0",
|
|
48
48
|
"@rdfjs/types": "*",
|
|
49
49
|
"rdf-store-stream": "^3.0.0",
|
|
50
|
-
"readable-stream": "^4.
|
|
50
|
+
"readable-stream": "^4.7.0"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "0b1756fdb9bef014133432489627c1bd71779bd0"
|
|
53
53
|
}
|