prez-lib 4.0.4 → 4.1.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/store.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Store, Quad_Object, Quad_Subject, Term } from 'n3';
2
- import { PrezProperties, PrezSearchResult, PrezFocusNode, PrezLink, PrezConceptNode, PrezLinkParent } from './types';
2
+ import { PrezProperties, PrezSearchResult, PrezFocusNode, PrezLink, PrezConceptNode, PrezLinkParent, PrezFacet } from './types';
3
3
  /**
4
4
  * An in-memory N3.js store containing convenience functions
5
5
  */
@@ -121,4 +121,10 @@ export declare class RDFStore {
121
121
  * Returns search results
122
122
  */
123
123
  search(): PrezSearchResult[];
124
+ /**
125
+ * Returns a list of facets
126
+ *
127
+ * @returns a list of facets
128
+ */
129
+ getFacets(): PrezFacet[];
124
130
  }
package/dist/types.d.ts CHANGED
@@ -107,8 +107,9 @@ export type PrezNodeList = {
107
107
  node: PrezNode;
108
108
  list?: PrezNodeList[];
109
109
  };
110
+ export type PrezProfile = PrezNodeList[];
110
111
  /** Used to define a set of profiles along with a node property list structure */
111
- export type PrezProfiles = Record<string, PrezNodeList[]>;
112
+ export type PrezProfiles = Record<string, PrezProfile>;
112
113
  /**
113
114
  * Represents an RDF Blank Node
114
115
  */
@@ -205,6 +206,7 @@ export interface PrezData {
205
206
  data: PrezFocusNode | PrezFocusNode[] | PrezSearchResult[];
206
207
  profiles: PrezProfileHeader[];
207
208
  parents: PrezLinkParent[];
209
+ facets: PrezFacet[];
208
210
  }
209
211
  export interface PrezDataList extends PrezData {
210
212
  type: 'list';
@@ -227,3 +229,11 @@ export interface PrezDataSearch extends PrezData {
227
229
  data: PrezSearchResult[];
228
230
  maxReached: boolean;
229
231
  }
232
+ export type PrezFacetValue = {
233
+ term: (PrezLiteral | PrezNode);
234
+ count: number;
235
+ };
236
+ export type PrezFacet = {
237
+ facetName: PrezNode;
238
+ facetValues: PrezFacetValue[];
239
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prez-lib",
3
- "version": "4.0.4",
3
+ "version": "4.1.0",
4
4
  "description": "A JS library for processing RDF data for use with Prez UI",
5
5
  "type": "module",
6
6
  "license": "BSD-3-Clause",