@comunica/actor-optimize-query-operation-set-seed-sources-quadpattern-iris 0.0.2-alpha.6.0 → 0.0.2-alpha.7.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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActorOptimizeQueryOperationSetSeedSourcesQuadpatternIris.js","sourceRoot":"","sources":["ActorOptimizeQueryOperationSetSeedSourcesQuadpatternIris.ts"],"names":[],"mappings":";;;AAIA,yFAAqF;AACrF,+DAAsE;AAGtE,qDAAgD;AAEhD;;GAEG;AACH,MAAa,wDAAyD,SAAQ,0DAA2B;IAOvG,YAAmB,IAAmE;QACpF,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,MAAqC;QACrD,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,MAAqC;QACpD,MAAM,cAAc,GAA4B,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,2CAAyB,CAAC,OAAO,CAAC,CAAC;QACtG,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;YAClD,MAAM,OAAO,GAAa,CAAE,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAE,CAAC;YAC1F,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,2CAAyB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;SACjF;QACD,OAAO,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;IAChD,CAAC;IAEM,wBAAwB,CAAC,SAA4B;QAC1D,MAAM,IAAI,GAAa,EAAE,CAAC;QAC1B,sBAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE;YAC/B,CAAC,yBAAO,CAAC,KAAK,CAAC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C,KAAK,CAAC,CAAC;iBACjC;gBACD,IAAI,IAAI,CAAC,aAAa,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,KAAK,WAAW,EAAE;oBAChE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;iBAChC;gBACD,OAAO,KAAK,CAAC;YACf,CAAC;SACF,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA3DD,4HA2DC","sourcesContent":["import type {\n IActionOptimizeQueryOperation,\n IActorOptimizeQueryOperationOutput,\n} from '@comunica/bus-optimize-query-operation';\nimport { ActorOptimizeQueryOperation } from '@comunica/bus-optimize-query-operation';\nimport { KeysRdfResolveQuadPattern } from '@comunica/context-entries';\nimport type { IActorArgs, IActorTest } from '@comunica/core';\nimport type { DataSources } from '@comunica/types';\nimport { Algebra, Util } from 'sparqlalgebrajs';\n\n/**\n * A comunica Set Seed Sources Quadpattern IRIs Optimize Query Operation Actor.\n */\nexport class ActorOptimizeQueryOperationSetSeedSourcesQuadpatternIris extends ActorOptimizeQueryOperation {\n private readonly extractSubjects: boolean;\n private readonly extractPredicates: boolean;\n private readonly extractObjects: boolean;\n private readonly extractGraphs: boolean;\n private readonly extractVocabIris: boolean;\n\n public constructor(args: IActorOptimizeQueryOperationSetSeedSourcesQuadpatternIrisArgs) {\n super(args);\n }\n\n public async test(action: IActionOptimizeQueryOperation): Promise<IActorTest> {\n return true;\n }\n\n public async run(action: IActionOptimizeQueryOperation): Promise<IActorOptimizeQueryOperationOutput> {\n const contextSources: DataSources | undefined = action.context.get(KeysRdfResolveQuadPattern.sources);\n if (!contextSources || contextSources.length === 0) {\n const sources: string[] = [ ...new Set(this.extractIrisFromOperation(action.operation)) ];\n action.context = action.context.set(KeysRdfResolveQuadPattern.sources, sources);\n }\n return { ...action, context: action.context };\n }\n\n public extractIrisFromOperation(operation: Algebra.Operation): string[] {\n const iris: string[] = [];\n Util.recurseOperation(operation, {\n [Algebra.types.PATH]: path => {\n if (this.extractSubjects && path.subject.termType === 'NamedNode') {\n iris.push(path.subject.value);\n }\n // Predicates are ignored\n if (this.extractObjects && path.object.termType === 'NamedNode') {\n iris.push(path.object.value);\n }\n if (this.extractGraphs && path.graph.termType === 'NamedNode') {\n iris.push(path.graph.value);\n }\n return false;\n },\n [Algebra.types.PATTERN]: pattern => {\n if (this.extractSubjects && pattern.subject.termType === 'NamedNode') {\n iris.push(pattern.subject.value);\n }\n if (this.extractPredicates && pattern.predicate.termType === 'NamedNode') {\n iris.push(pattern.predicate.value);\n }\n if (this.extractObjects && pattern.object.termType === 'NamedNode' &&\n (this.extractVocabIris || pattern.predicate.value !== 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type')) {\n iris.push(pattern.object.value);\n }\n if (this.extractGraphs && pattern.graph.termType === 'NamedNode') {\n iris.push(pattern.graph.value);\n }\n return false;\n },\n });\n return iris;\n }\n}\n\nexport interface IActorOptimizeQueryOperationSetSeedSourcesQuadpatternIrisArgs\n extends IActorArgs<IActionOptimizeQueryOperation, IActorTest, IActorOptimizeQueryOperationOutput> {\n /**\n * If IRIs should be extracted from subject positions.\n * @default {true}\n */\n extractSubjects: boolean;\n /**\n * If IRIs should be extracted from predicate positions.\n * @default {false}\n */\n extractPredicates: boolean;\n /**\n * If IRIs should be extracted from object positions.\n * @default {true}\n */\n extractObjects: boolean;\n /**\n * If IRIs should be extracted from graph positions.\n * @default {true}\n */\n extractGraphs: boolean;\n /**\n * If object IRIs should be extracted if the predicate is rdf:type.\n * @default {false}\n */\n extractVocabIris: boolean;\n}\n"]}
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6FAA2E","sourcesContent":["export * from './ActorOptimizeQueryOperationSetSeedSourcesQuadpatternIris';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comunica/actor-optimize-query-operation-set-seed-sources-quadpattern-iris",
|
|
3
|
-
"version": "0.0.2-alpha.
|
|
3
|
+
"version": "0.0.2-alpha.7.0",
|
|
4
4
|
"description": "A set-seed-sources-quadpattern-iris optimize-query-operation actor",
|
|
5
5
|
"lsd:module": true,
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"files": [
|
|
29
29
|
"components",
|
|
30
30
|
"lib/**/*.d.ts",
|
|
31
|
-
"lib/**/*.js"
|
|
31
|
+
"lib/**/*.js",
|
|
32
|
+
"lib/**/*.js.map"
|
|
32
33
|
],
|
|
33
34
|
"dependencies": {
|
|
34
35
|
"@comunica/bus-optimize-query-operation": "^2.0.1",
|
|
@@ -42,5 +43,5 @@
|
|
|
42
43
|
"build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
|
|
43
44
|
"build:components": "componentsjs-generator"
|
|
44
45
|
},
|
|
45
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "6835f852887aed0637d5a5706d62bc11696d2484"
|
|
46
47
|
}
|