-
-
Notifications
You must be signed in to change notification settings - Fork 76
/
ActorRdfMetadataExtract.ts
59 lines (54 loc) 路 1.57 KB
/
ActorRdfMetadataExtract.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import type { IAction, IActorArgs, IActorOutput, IActorTest, Mediate } from '@comunica/core';
import { Actor } from '@comunica/core';
import type * as RDF from '@rdfjs/types';
/**
* A comunica actor for rdf-metadata-extract events.
*
* Actor types:
* * Input: IActionRdfMetadataExtract: A metadata quad stream
* * Test: <none>
* * Output: IActorRdfMetadataExtractOutput: A metadata hash.
*
* @see IActionDereferenceRdf
* @see IActorDereferenceRdfOutput
*/
export abstract class ActorRdfMetadataExtract
extends Actor<IActionRdfMetadataExtract, IActorTest, IActorRdfMetadataExtractOutput> {
/**
* @param args - @defaultNested {<default_bus> a <cc:components/Bus.jsonld#Bus>} bus
*/
public constructor(args: IActorRdfMetadataExtractArgs) {
super(args);
}
}
export interface IActionRdfMetadataExtract extends IAction {
/**
* The page URL from which the quads were retrieved.
*/
url: string;
/**
* The resulting quad data stream.
*/
metadata: RDF.Stream;
/**
* The time it took to request the page in milliseconds.
* This is the time until the first byte arrives.
*/
requestTime: number;
/**
* The headers of the page.
*/
headers?: Headers;
}
export interface IActorRdfMetadataExtractOutput extends IActorOutput {
/**
* A metadata key-value mapping.
*/
metadata: Record<string, any>;
}
export type IActorRdfMetadataExtractArgs = IActorArgs<
IActionRdfMetadataExtract,
IActorTest,
IActorRdfMetadataExtractOutput
>;
export type MediatorRdfMetadataExtract = Mediate<IActionRdfMetadataExtract, IActorRdfMetadataExtractOutput>;