@lde/dataset 0.2.0 → 0.3.0

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/dataset.d.ts CHANGED
@@ -1,8 +1,32 @@
1
1
  import { Distribution } from './distribution.js';
2
- export declare class Dataset {
2
+ export interface Publisher {
3
+ readonly iri: URL;
4
+ readonly name: Record<string, string>;
5
+ }
6
+ export interface Creator {
3
7
  readonly iri: URL;
8
+ readonly name: Record<string, string>;
9
+ }
10
+ export interface DatasetArguments {
11
+ iri: URL;
12
+ title?: Record<string, string>;
13
+ description?: Record<string, string>;
14
+ language?: string[];
15
+ license?: URL;
4
16
  distributions: Distribution[];
5
- constructor(iri: URL, distributions: Distribution[]);
17
+ creator?: Creator[];
18
+ publisher?: Publisher;
19
+ }
20
+ export declare class Dataset {
21
+ readonly iri: URL;
22
+ readonly title: Record<string, string>;
23
+ readonly description?: Record<string, string>;
24
+ readonly language: string[];
25
+ readonly license?: URL;
26
+ readonly distributions: Distribution[];
27
+ readonly creator: Creator[];
28
+ readonly publisher?: Publisher;
29
+ constructor(options: DatasetArguments);
6
30
  getSparqlDistribution(): Distribution | null;
7
31
  getDownloadDistributions(): Distribution[];
8
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dataset.d.ts","sourceRoot":"","sources":["../src/dataset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,qBAAa,OAAO;aACU,GAAG,EAAE,GAAG;IAAS,aAAa,EAAE,YAAY,EAAE;gBAA9C,GAAG,EAAE,GAAG,EAAS,aAAa,EAAE,YAAY,EAAE;IAEnE,qBAAqB,IAAI,YAAY,GAAG,IAAI;IAQ5C,wBAAwB,IAAI,YAAY,EAAE;CAqBlD"}
1
+ {"version":3,"file":"dataset.d.ts","sourceRoot":"","sources":["../src/dataset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAA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wB,IAAI,YAAY,EAAE;CAqBlD"}
package/dist/dataset.js CHANGED
@@ -1,9 +1,21 @@
1
1
  export class Dataset {
2
2
  iri;
3
+ title;
4
+ description;
5
+ language;
6
+ license;
3
7
  distributions;
4
- constructor(iri, distributions) {
5
- this.iri = iri;
6
- this.distributions = distributions;
8
+ creator;
9
+ publisher;
10
+ constructor(options) {
11
+ this.iri = options.iri;
12
+ this.title = options.title ?? { '': '' };
13
+ this.description = options.description;
14
+ this.language = options.language ?? [];
15
+ this.license = options.license;
16
+ this.distributions = options.distributions;
17
+ this.creator = options.creator ?? [];
18
+ this.publisher = options.publisher;
7
19
  }
8
20
  getSparqlDistribution() {
9
21
  return (this.distributions.filter((distribution) => distribution.isSparql() && distribution.isValid)[0] ?? null);
@@ -1,12 +1,13 @@
1
1
  export declare class Distribution {
2
2
  readonly accessUrl: URL;
3
3
  readonly mimeType: string;
4
+ readonly conformsTo?: URL | undefined;
4
5
  byteSize?: number;
5
6
  lastModified?: Date;
6
7
  isValid?: boolean;
7
8
  namedGraph?: string;
8
9
  subjectFilter?: string;
9
- constructor(accessUrl: URL, mimeType: string);
10
+ constructor(accessUrl: URL, mimeType: string, conformsTo?: URL | undefined);
10
11
  isSparql(): boolean;
11
12
  static sparql(endpoint: URL, namedGraph?: string): Distribution;
12
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../src/distribution.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAY;aAQL,SAAS,EAAE,GAAG;aACd,QAAQ,EAAE,MAAM;IAR3B,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,EAAE,MAAM;IAG3B,QAAQ;WAQD,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,UAAU,CAAC,EAAE,MAAM;CAOxD;AAED,oBAAY,SAAS;IACnB,WAAW,0BAA0B;IACrC,SAAS,wBAAwB;IACjC,MAAM,gBAAgB;CACvB;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAWrE"}
1
+ {"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../src/distribution.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAY;aAQL,SAAS,EAAE,GAAG;aACd,QAAQ,EAAE,MAAM;aAChB,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,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,GAAG,YAAA;IAG3B,QAAQ;WAQD,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,UAAU,CAAC,EAAE,MAAM;CAOxD;AAED,oBAAY,SAAS;IACnB,WAAW,0BAA0B;IACrC,SAAS,wBAAwB;IACjC,MAAM,gBAAgB;CACvB;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAWrE"}
@@ -1,14 +1,16 @@
1
1
  export class Distribution {
2
2
  accessUrl;
3
3
  mimeType;
4
+ conformsTo;
4
5
  byteSize;
5
6
  lastModified;
6
7
  isValid;
7
8
  namedGraph;
8
9
  subjectFilter;
9
- constructor(accessUrl, mimeType) {
10
+ constructor(accessUrl, mimeType, conformsTo) {
10
11
  this.accessUrl = accessUrl;
11
12
  this.mimeType = mimeType;
13
+ this.conformsTo = conformsTo;
12
14
  }
13
15
  isSparql() {
14
16
  return ((this.mimeType === 'application/sparql-query' ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lde/dataset",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",