parent
b95b8568d3
commit
9d8e3a7235
@ -0,0 +1,43 @@ |
||||
import type { LdoBase, ShapeType } from "@ldo/ldo"; |
||||
import { LdoBuilder } from "@ldo/ldo"; |
||||
import type { IConnectedLdoBuilder } from "./types/IConnectedLdoBuilder"; |
||||
import type { JsonldDatasetProxyBuilder } from "@ldo/jsonld-dataset-proxy"; |
||||
import type { SubjectNode } from "@ldo/rdf-utils"; |
||||
import type { LQInput, ILinkQuery } from "./types/ILinkQuery"; |
||||
import { ResourceLinkQuery } from "./ResourceLinkQuery"; |
||||
import type { ConnectedLdoDataset } from "./ConnectedLdoDataset"; |
||||
import type { ConnectedPlugin } from "./types/ConnectedPlugin"; |
||||
|
||||
export class ConnectedLdoBuilder< |
||||
Type extends LdoBase, |
||||
Plugins extends ConnectedPlugin[], |
||||
> |
||||
extends LdoBuilder<Type> |
||||
implements IConnectedLdoBuilder<Type, Plugins> |
||||
{ |
||||
protected parentDataset: ConnectedLdoDataset<Plugins>; |
||||
|
||||
constructor( |
||||
parentDataset: ConnectedLdoDataset<Plugins>, |
||||
jsonldDatasetProxyBuilder: JsonldDatasetProxyBuilder, |
||||
shapeType: ShapeType<Type>, |
||||
) { |
||||
super(jsonldDatasetProxyBuilder, shapeType); |
||||
this.parentDataset = parentDataset; |
||||
} |
||||
|
||||
startLinkQuery<Input extends LQInput<Type>>( |
||||
startingResource: Plugins[number]["types"]["resource"], |
||||
startingSubject: SubjectNode | string, |
||||
linkQueryInput: Input, |
||||
): ILinkQuery<Type, Input> { |
||||
return new ResourceLinkQuery( |
||||
this.parentDataset, |
||||
this.shapeType, |
||||
this.jsonldDatasetProxyBuilder, |
||||
startingResource, |
||||
startingSubject, |
||||
linkQueryInput, |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,43 @@ |
||||
import type { LdoBase, ShapeType } from "@ldo/ldo"; |
||||
import type { |
||||
ExpandDeep, |
||||
ILinkQuery, |
||||
LQInput, |
||||
LQReturn, |
||||
} from "./types/ILinkQuery"; |
||||
import type { ConnectedPlugin } from "./types/ConnectedPlugin"; |
||||
import type { JsonldDatasetProxyBuilder } from "@ldo/jsonld-dataset-proxy"; |
||||
import type { ConnectedLdoDataset } from "./ConnectedLdoDataset"; |
||||
import type { SubjectNode } from "@ldo/rdf-utils"; |
||||
|
||||
export class ResourceLinkQuery< |
||||
Type extends LdoBase, |
||||
QueryInput extends LQInput<Type>, |
||||
Plugins extends ConnectedPlugin[], |
||||
> implements ILinkQuery<Type, QueryInput> |
||||
{ |
||||
constructor( |
||||
protected parentDataset: ConnectedLdoDataset<Plugins>, |
||||
protected shapeType: ShapeType<Type>, |
||||
protected jsonldDatasetProxyBuilder: JsonldDatasetProxyBuilder, |
||||
protected startingResource: Plugins[number]["types"]["resource"], |
||||
protected startingSubject: SubjectNode | string, |
||||
protected linkQueryInput: QueryInput, |
||||
) {} |
||||
|
||||
run(): Promise<ExpandDeep<LQReturn<Type, QueryInput>>> { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
subscribe(): Promise<void> { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
unsubscribe(): void { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
fromSubject(): ExpandDeep<LQReturn<Type, QueryInput>> { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
} |
@ -1,12 +1,15 @@ |
||||
import type { LdoBase, LdoBuilder } from "@ldo/ldo"; |
||||
import type { ConnectedPlugin } from "./ConnectedPlugin"; |
||||
import { SubjectNode } from "@ldo/rdf-utils"; |
||||
import type { SubjectNode } from "@ldo/rdf-utils"; |
||||
import type { ILinkQuery, LQInput } from "./ILinkQuery"; |
||||
|
||||
export interface IConnectedLdoBuilder< |
||||
Type extends LdoBase, |
||||
Plugins extends ConnectedPlugin[], |
||||
> extends LdoBuilder<Type> { |
||||
fromLinkQuery(startingResource: Plugins[number]["types"]["resource"], startingSubject: SubjectNode | string, linkQueryInput:
|
||||
|
||||
) |
||||
startLinkQuery<Input extends LQInput<Type>>( |
||||
startingResource: Plugins[number]["types"]["resource"], |
||||
startingSubject: SubjectNode | string, |
||||
linkQueryInput: Input, |
||||
): ILinkQuery<Type, Input>; |
||||
} |
||||
|
Loading…
Reference in new issue