Skip to content

@graphty/graph-io / @graphty/graph-io / SourceBase

Interface: SourceBase<P> ​

Defined in: sources/types.ts:610

What every source has beside its one read method. Experimental.

Type Parameters ​

P ​

P

Properties ​

descriptor? ​

readonly optional descriptor?: SourceDescriptor

Defined in: sources/types.ts:614

What a form needs; optional for a source used only from code.


id ​

readonly id: string

Defined in: sources/types.ts:612

Lowercase letters, digits and dashes. A separate name space from formats.


idKey? ​

readonly optional idKey?: string

Defined in: sources/types.ts:616

The node record's id field, when not id.


sourceKey? ​

readonly optional sourceKey?: string

Defined in: sources/types.ts:618

The edge record's source field, when not source.


targetKey? ​

readonly optional targetKey?: string

Defined in: sources/types.ts:620

The edge record's target field, when not target.

Methods ​

expand()? ​

optional expand(request, sink, ctx): Promise<ImportReport>

Defined in: sources/types.ts:628

Fetch the neighborhood of some nodes into the sink.

Parameters ​

request ​

ExpandRequest<P>

the seeds and how far to go

sink ​

GraphSink

where to write

ctx ​

SourceContext

the context

Returns ​

Promise<ImportReport>

the report


list()? ​

optional list(query, ctx): Promise<SourceListing>

Defined in: sources/types.ts:642

Search what the source holds.

Parameters ​

query ​

SourceListQuery<P>

the search

ctx ​

SourceContext

the context

Returns ​

Promise<SourceListing>

one page of results


probe()? ​

optional probe(params, ctx): Promise<SourceProbe>

Defined in: sources/types.ts:635

Check the params and the credential without loading.

Parameters ​

params ​

P

the params

ctx ​

SourceContext

the context

Returns ​

Promise<SourceProbe>

what the service said


validate()? ​

optional validate(params, seen, ctx): Promise<SourceFreshness>

Defined in: sources/types.ts:650

Tell whether data loaded earlier changed.

Parameters ​

params ​

P

the params it was loaded with

seen ​

SourceValidators

the validators recorded then

ctx ​

SourceContext

the context

Returns ​

Promise<SourceFreshness>

whether it changed