@lde/dataset 0.3.1 → 0.4.2
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/dist/distribution.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export declare class Distribution {
|
|
2
2
|
readonly accessUrl: URL;
|
|
3
|
-
readonly mimeType
|
|
3
|
+
readonly mimeType?: string | undefined;
|
|
4
4
|
readonly conformsTo?: URL | undefined;
|
|
5
5
|
byteSize?: number;
|
|
6
6
|
lastModified?: Date;
|
|
7
7
|
isValid?: boolean;
|
|
8
8
|
namedGraph?: string;
|
|
9
9
|
subjectFilter?: string;
|
|
10
|
-
constructor(accessUrl: URL, mimeType
|
|
10
|
+
constructor(accessUrl: URL, mimeType?: string | undefined, conformsTo?: URL | undefined);
|
|
11
11
|
isSparql(): boolean;
|
|
12
12
|
static sparql(endpoint: URL, namedGraph?: string): Distribution;
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../src/distribution.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../src/distribution.ts"],"names":[],"mappings":"AAEA,qBAAa,YAAY;aAQL,SAAS,EAAE,GAAG;aACd,QAAQ,CAAC,EAAE,MAAM;aACjB,UAAU,CAAC,EAAE,GAAG;IAT3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;gBAGZ,SAAS,EAAE,GAAG,EACd,QAAQ,CAAC,EAAE,MAAM,YAAA,EACjB,UAAU,CAAC,EAAE,GAAG,YAAA;IAG3B,QAAQ;WASD,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,UAAU,CAAC,EAAE,MAAM;CAWxD;AAED,oBAAY,SAAS;IACnB,WAAW,0BAA0B;IACrC,SAAS,wBAAwB;IACjC,MAAM,gBAAgB;CACvB;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAWrE"}
|
package/dist/distribution.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const SPARQL_URI = 'https://www.w3.org/TR/sparql11-protocol/';
|
|
1
2
|
export class Distribution {
|
|
2
3
|
accessUrl;
|
|
3
4
|
mimeType;
|
|
@@ -13,12 +14,13 @@ export class Distribution {
|
|
|
13
14
|
this.conformsTo = conformsTo;
|
|
14
15
|
}
|
|
15
16
|
isSparql() {
|
|
16
|
-
return ((this.
|
|
17
|
+
return ((this.conformsTo?.toString() == SPARQL_URI ||
|
|
18
|
+
this.mimeType === 'application/sparql-query' ||
|
|
17
19
|
this.mimeType === 'application/sparql-results+json') &&
|
|
18
20
|
this.accessUrl !== null);
|
|
19
21
|
}
|
|
20
22
|
static sparql(endpoint, namedGraph) {
|
|
21
|
-
const distribution = new this(endpoint, 'application/sparql-query');
|
|
23
|
+
const distribution = new this(endpoint, 'application/sparql-query', new URL(SPARQL_URI));
|
|
22
24
|
distribution.isValid = true;
|
|
23
25
|
distribution.namedGraph = namedGraph;
|
|
24
26
|
return distribution;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lde/dataset",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.2",
|
|
4
|
+
"repository": {
|
|
5
|
+
"url": "https://github.com/ldengine/lde"
|
|
6
|
+
},
|
|
4
7
|
"type": "module",
|
|
5
|
-
"main": "./dist/index.js",
|
|
6
|
-
"module": "./dist/index.js",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
"./package.json": "./package.json",
|
|
10
10
|
".": {
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
"default": "./dist/index.js"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
|
+
"main": "./dist/index.js",
|
|
18
|
+
"module": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
17
20
|
"files": [
|
|
18
21
|
"dist",
|
|
19
22
|
"!**/*.tsbuildinfo"
|