From 66b2c918203b5fb8b022bc063938e40107c2e100 Mon Sep 17 00:00:00 2001 From: maartenvandenbrande Date: Thu, 21 Nov 2024 16:21:53 +0100 Subject: [PATCH] rename StreamingHypermedia to stream --- .../config/query-source-identify/actors.json | 2 +- .../config/query-source-identify/actors/stream.json | 2 +- .../actor-query-source-identify-stream/README.md | 2 +- ...permedia.ts => ActorQuerySourceIdentifyStream.ts} | 12 ++++++------ ...permediaQuerySources.ts => StreamQuerySources.ts} | 8 ++++---- .../actor-query-source-identify-stream/lib/index.ts | 2 +- ...est.ts => ActorQuerySourceIdentifyStream-test.ts} | 0 7 files changed, 14 insertions(+), 14 deletions(-) rename packages/actor-query-source-identify-stream/lib/{ActorQuerySourceIdentifyStreamingHypermedia.ts => ActorQuerySourceIdentifyStream.ts} (79%) rename packages/actor-query-source-identify-stream/lib/{StreamingHypermediaQuerySources.ts => StreamQuerySources.ts} (96%) rename packages/actor-query-source-identify-stream/test/{ActorQuerySourceIdentifyStreamingHypermedia-test.ts => ActorQuerySourceIdentifyStream-test.ts} (100%) diff --git a/engines/config-query-sparql-incremental/config/query-source-identify/actors.json b/engines/config-query-sparql-incremental/config/query-source-identify/actors.json index 8b02624c..0cfaf5ce 100644 --- a/engines/config-query-sparql-incremental/config/query-source-identify/actors.json +++ b/engines/config-query-sparql-incremental/config/query-source-identify/actors.json @@ -22,7 +22,7 @@ }, { "@id": "urn:comunica:default:query-source-identify/actors#stream", - "@type": "ActorQuerySourceIdentifyStreamingHypermedia", + "@type": "ActorQuerySourceIdentifyStream", "beforeActors": { "@id": "urn:comunica:default:query-source-identify/actors#hypermedia" } } ] diff --git a/engines/config-query-sparql-incremental/config/query-source-identify/actors/stream.json b/engines/config-query-sparql-incremental/config/query-source-identify/actors/stream.json index 4b10dc85..4a05f5c5 100644 --- a/engines/config-query-sparql-incremental/config/query-source-identify/actors/stream.json +++ b/engines/config-query-sparql-incremental/config/query-source-identify/actors/stream.json @@ -9,7 +9,7 @@ "actors": [ { "@id": "urn:comunica:default:query-source-identify/actors#stream", - "@type": "ActorQuerySourceIdentifyStreamingHypermedia", + "@type": "ActorQuerySourceIdentifyStream", "mediatorMergeBindingsContext": { "@id": "urn:comunica:default:merge-bindings-context/mediators#main" }, "mediatorQuerySourceIdentify": { "@id": "urn:comunica:default:query-source-identify/mediators#main" } } diff --git a/packages/actor-query-source-identify-stream/README.md b/packages/actor-query-source-identify-stream/README.md index 67e2a6cf..0cf0b6a3 100644 --- a/packages/actor-query-source-identify-stream/README.md +++ b/packages/actor-query-source-identify-stream/README.md @@ -23,7 +23,7 @@ After installing, this package can be added to your engine's configuration as fo ... { "@id": "urn:comunica:default:query-source-identify/actors#stream", - "@type": "ActorQuerySourceIdentifyStreamingHypermedia", + "@type": "ActorQuerySourceIdentifyStream", "mediatorMergeBindingsContext": { "@id": "urn:comunica:default:merge-bindings-context/mediators#main" } } ] diff --git a/packages/actor-query-source-identify-stream/lib/ActorQuerySourceIdentifyStreamingHypermedia.ts b/packages/actor-query-source-identify-stream/lib/ActorQuerySourceIdentifyStream.ts similarity index 79% rename from packages/actor-query-source-identify-stream/lib/ActorQuerySourceIdentifyStreamingHypermedia.ts rename to packages/actor-query-source-identify-stream/lib/ActorQuerySourceIdentifyStream.ts index 9270f871..9bfe3f81 100644 --- a/packages/actor-query-source-identify-stream/lib/ActorQuerySourceIdentifyStreamingHypermedia.ts +++ b/packages/actor-query-source-identify-stream/lib/ActorQuerySourceIdentifyStream.ts @@ -10,16 +10,16 @@ import { KeysInitQuery } from '@comunica/context-entries'; import type { IActorTest, TestResult } from '@comunica/core'; import { failTest, passTestVoid, ActionContext } from '@comunica/core'; import type { ComunicaDataFactory } from '@comunica/types'; -import { StreamingHypermediaQuerySources } from './StreamingHypermediaQuerySources'; +import { StreamQuerySources } from './StreamQuerySources'; /** - * An incremunica Streaming Sources Query Source Identify Actor. + * An incremunica Stream Sources Query Source Identify Actor. */ -export class ActorQuerySourceIdentifyStreamingHypermedia extends ActorQuerySourceIdentify { +export class ActorQuerySourceIdentifyStream extends ActorQuerySourceIdentify { public readonly mediatorMergeBindingsContext: MediatorMergeBindingsContext; public readonly mediatorQuerySourceIdentify: MediatorQuerySourceIdentify; - public constructor(args: IActorQuerySourceIdentifyStreamingSourcesArgs) { + public constructor(args: IActorQuerySourceIdentifyStreamSourcesArgs) { super(args); } @@ -35,7 +35,7 @@ export class ActorQuerySourceIdentifyStreamingHypermedia extends ActorQuerySourc const dataFactory: ComunicaDataFactory = action.context.getSafe(KeysInitQuery.dataFactory); return { querySource: { - source: new StreamingHypermediaQuerySources( + source: new StreamQuerySources( action.querySourceUnidentified.value, dataFactory, this.mediatorQuerySourceIdentify, @@ -47,7 +47,7 @@ export class ActorQuerySourceIdentifyStreamingHypermedia extends ActorQuerySourc } } -export interface IActorQuerySourceIdentifyStreamingSourcesArgs extends IActorQuerySourceIdentifyArgs { +export interface IActorQuerySourceIdentifyStreamSourcesArgs extends IActorQuerySourceIdentifyArgs { /** * A mediator for creating binding context merge handlers */ diff --git a/packages/actor-query-source-identify-stream/lib/StreamingHypermediaQuerySources.ts b/packages/actor-query-source-identify-stream/lib/StreamQuerySources.ts similarity index 96% rename from packages/actor-query-source-identify-stream/lib/StreamingHypermediaQuerySources.ts rename to packages/actor-query-source-identify-stream/lib/StreamQuerySources.ts index 1e5e0427..2360cc2a 100644 --- a/packages/actor-query-source-identify-stream/lib/StreamingHypermediaQuerySources.ts +++ b/packages/actor-query-source-identify-stream/lib/StreamQuerySources.ts @@ -19,7 +19,7 @@ import { Queue } from 'data-structure-typed'; import { type Algebra, Factory } from 'sparqlalgebrajs'; import type { Operation } from 'sparqlalgebrajs/lib/algebra'; -export type IStreamingQuerySources = { +export type IStreamQuerySource = { isAddition: boolean; value: string; }; @@ -34,7 +34,7 @@ type ISourceWrapperSafe = { deleteCallbacks: (() => void)[]; }; -export class StreamingHypermediaQuerySources implements IQuerySource { +export class StreamQuerySources implements IQuerySource { public referenceValue: string; public context?: IActionContext; private readonly sources: Map = new Map(); @@ -43,13 +43,13 @@ export class StreamingHypermediaQuerySources implements IQuerySource { private readonly dataFactory: ComunicaDataFactory; public constructor( - stream: AsyncIterator, + stream: AsyncIterator, dataFactory: ComunicaDataFactory, mediatorQuerySourceIdentify: MediatorQuerySourceIdentify, context: IActionContext, ) { this.sourcesEventEmitter = new EventEmitter(); - stream.on('data', (item: IStreamingQuerySources) => { + stream.on('data', (item: IStreamQuerySource) => { if (item.isAddition) { const chunk: ISourceWrapper = { deleteCallbacks: [], diff --git a/packages/actor-query-source-identify-stream/lib/index.ts b/packages/actor-query-source-identify-stream/lib/index.ts index 1f03d2f1..f6102471 100644 --- a/packages/actor-query-source-identify-stream/lib/index.ts +++ b/packages/actor-query-source-identify-stream/lib/index.ts @@ -1 +1 @@ -export * from './ActorQuerySourceIdentifyStreamingHypermedia'; +export * from './ActorQuerySourceIdentifyStream'; diff --git a/packages/actor-query-source-identify-stream/test/ActorQuerySourceIdentifyStreamingHypermedia-test.ts b/packages/actor-query-source-identify-stream/test/ActorQuerySourceIdentifyStream-test.ts similarity index 100% rename from packages/actor-query-source-identify-stream/test/ActorQuerySourceIdentifyStreamingHypermedia-test.ts rename to packages/actor-query-source-identify-stream/test/ActorQuerySourceIdentifyStream-test.ts