@lde/sparql-importer 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/package.json +25 -0
package/README.md
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Dataset, Distribution } from '@lde/dataset';
|
|
2
|
+
/**
|
|
3
|
+
* An Importer takes a {@link Dataset}, selects a suitable {@link Distribution}
|
|
4
|
+
* and imports it to a SPARQL server.
|
|
5
|
+
*
|
|
6
|
+
* This assumes that all Distributions of the Dataset are roughly equivalent:
|
|
7
|
+
* https://docs.nde.nl/requirements-datasets/#dataset-distributions.
|
|
8
|
+
*/
|
|
9
|
+
export interface Importer {
|
|
10
|
+
/**
|
|
11
|
+
* Import a {@link Dataset} to a SPARQL server.
|
|
12
|
+
*/
|
|
13
|
+
import(dataset: Dataset): Promise<NotSupported | ImportFailed | ImportSuccessful>;
|
|
14
|
+
}
|
|
15
|
+
export declare class ImportSuccessful {
|
|
16
|
+
readonly distribution: Distribution;
|
|
17
|
+
readonly identifier?: string | undefined;
|
|
18
|
+
constructor(distribution: Distribution, identifier?: string | undefined);
|
|
19
|
+
}
|
|
20
|
+
export declare class ImportFailed {
|
|
21
|
+
readonly distribution: Distribution;
|
|
22
|
+
readonly error: string;
|
|
23
|
+
constructor(distribution: Distribution, error: string);
|
|
24
|
+
}
|
|
25
|
+
export declare class NotSupported {
|
|
26
|
+
readonly distribution?: Distribution | undefined;
|
|
27
|
+
constructor(distribution?: Distribution | undefined);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;GAMG;AAEH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,MAAM,CACJ,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,YAAY,GAAG,YAAY,GAAG,gBAAgB,CAAC,CAAC;CAC5D;AAOD,qBAAa,gBAAgB;aAET,YAAY,EAAE,YAAY;aAC1B,UAAU,CAAC,EAAE,MAAM;gBADnB,YAAY,EAAE,YAAY,EAC1B,UAAU,CAAC,EAAE,MAAM,YAAA;CAEtC;AAED,qBAAa,YAAY;aAEL,YAAY,EAAE,YAAY;aAC1B,KAAK,EAAE,MAAM;gBADb,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,MAAM;CAEhC;AAED,qBAAa,YAAY;aACK,YAAY,CAAC,EAAE,YAAY;gBAA3B,YAAY,CAAC,EAAE,YAAY,YAAA;CACxD"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// interface Events {
|
|
2
|
+
// imported: [statements: number];
|
|
3
|
+
// end: [statements: number];
|
|
4
|
+
// }
|
|
5
|
+
export class ImportSuccessful {
|
|
6
|
+
distribution;
|
|
7
|
+
identifier;
|
|
8
|
+
constructor(distribution, identifier) {
|
|
9
|
+
this.distribution = distribution;
|
|
10
|
+
this.identifier = identifier;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export class ImportFailed {
|
|
14
|
+
distribution;
|
|
15
|
+
error;
|
|
16
|
+
constructor(distribution, error) {
|
|
17
|
+
this.distribution = distribution;
|
|
18
|
+
this.error = error;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export class NotSupported {
|
|
22
|
+
distribution;
|
|
23
|
+
constructor(distribution) {
|
|
24
|
+
this.distribution = distribution;
|
|
25
|
+
}
|
|
26
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lde/sparql-importer",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
"./package.json": "./package.json",
|
|
10
|
+
".": {
|
|
11
|
+
"development": "./src/index.ts",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"!**/*.tsbuildinfo"
|
|
20
|
+
],
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"tslib": "^2.3.0",
|
|
23
|
+
"@lde/dataset": "0.2.0"
|
|
24
|
+
}
|
|
25
|
+
}
|