Skip to content

Commit

Permalink
rename StreamingHypermedia to stream
Browse files Browse the repository at this point in the history
  • Loading branch information
maartyman committed Nov 21, 2024
1 parent 5792f96 commit 66b2c91
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
}
Expand Down
2 changes: 1 addition & 1 deletion packages/actor-query-source-identify-stream/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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(
<any>action.querySourceUnidentified.value,
dataFactory,
this.mediatorQuerySourceIdentify,
Expand All @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand All @@ -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<string, ISourceWrapper> = new Map();
Expand All @@ -43,13 +43,13 @@ export class StreamingHypermediaQuerySources implements IQuerySource {
private readonly dataFactory: ComunicaDataFactory;

public constructor(
stream: AsyncIterator<IStreamingQuerySources>,
stream: AsyncIterator<IStreamQuerySource>,
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: [],
Expand Down
2 changes: 1 addition & 1 deletion packages/actor-query-source-identify-stream/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './ActorQuerySourceIdentifyStreamingHypermedia';
export * from './ActorQuerySourceIdentifyStream';

0 comments on commit 66b2c91

Please sign in to comment.