@lde/search 0.36.3 → 0.37.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/adapter.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * deployment author declaring a schema and running searches needs none of
7
7
  * this; the main entry point carries that (small) authoring surface.
8
8
  */
9
- export { assertTypeInSchema, physicalFields, irAlias, displayFieldName, displayFieldPattern, displayLangOf, searchableFields, facetableFields, filterableFields, sortableFields, outputFields, isInternalField, isInlineReference, nestedReferenceType, nestedFieldName, localLookupTargetsOf, referencedTargetsOf, storedTargetOf, TARGET_FIELD, identityFieldOf, identityFieldName, inheritedFacetPolicies, referenceFields, referenceTypeNamed, endpointFieldOf, rootTypeNamed, inlineFramingDepth, fieldNamed, datasetField, ID_FIELD, AND_KEY, OR_KEY, labelFieldOf, labelFieldNameOf, labelSourceNamesOf, labelTargetNamesOf, documentKeyOf, DEFAULT_LABEL_FIELD, isRangeFacet, isBinnedRangeFacet, storedFacetRanges, isAbsoluteIri, isoToUnixSeconds, lastSecondOf, unixSecondsToIso, isDatePrecision, } from './schema.js';
9
+ export { assertTypeInSchema, physicalFields, irAlias, displayFieldName, displayFieldPattern, displayLangOf, searchableFields, facetableFields, filterableFields, sortableFields, outputFields, isInternalField, isInlineReference, nestedReferenceType, nestedFieldName, localLookupTargetsOf, referencedTargetsOf, storedTargetOf, TARGET_FIELD, identityFieldOf, identityFieldName, inheritedFacetPolicies, referenceFields, referenceTypeNamed, endpointFieldOf, rootTypeNamed, inlineFramingDepth, fieldNamed, datasetField, ID_FIELD, AND_KEY, OR_KEY, labelFieldOf, labelFieldNameOf, labelSourceNamesOf, labelTargetNamesOf, documentKeyOf, DEFAULT_LABEL_FIELD, isRangeFacet, isBinnedRangeFacet, storedFacetRanges, isAbsoluteIri, isoToUnixSeconds, storedRangeBound, lastSecondOf, unixSecondsToIso, isDatePrecision, } from './schema.js';
10
10
  export type { PhysicalFields, DatePrecision, StoredDate } from './schema.js';
11
11
  export { missingRequiredFields } from './project.js';
12
12
  export { physicalNameTokens } from './physical-name.js';
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,MAAM,EACN,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC5D,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,WAAW,EACX,cAAc,EACd,UAAU,EACV,YAAY,EACZ,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,MAAM,EACN,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC5D,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,WAAW,EACX,cAAc,EACd,UAAU,EACV,YAAY,EACZ,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
package/dist/adapter.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * deployment author declaring a schema and running searches needs none of
7
7
  * this; the main entry point carries that (small) authoring surface.
8
8
  */
9
- export { assertTypeInSchema, physicalFields, irAlias, displayFieldName, displayFieldPattern, displayLangOf, searchableFields, facetableFields, filterableFields, sortableFields, outputFields, isInternalField, isInlineReference, nestedReferenceType, nestedFieldName, localLookupTargetsOf, referencedTargetsOf, storedTargetOf, TARGET_FIELD, identityFieldOf, identityFieldName, inheritedFacetPolicies, referenceFields, referenceTypeNamed, endpointFieldOf, rootTypeNamed, inlineFramingDepth, fieldNamed, datasetField, ID_FIELD, AND_KEY, OR_KEY, labelFieldOf, labelFieldNameOf, labelSourceNamesOf, labelTargetNamesOf, documentKeyOf, DEFAULT_LABEL_FIELD, isRangeFacet, isBinnedRangeFacet, storedFacetRanges, isAbsoluteIri, isoToUnixSeconds, lastSecondOf, unixSecondsToIso, isDatePrecision, } from './schema.js';
9
+ export { assertTypeInSchema, physicalFields, irAlias, displayFieldName, displayFieldPattern, displayLangOf, searchableFields, facetableFields, filterableFields, sortableFields, outputFields, isInternalField, isInlineReference, nestedReferenceType, nestedFieldName, localLookupTargetsOf, referencedTargetsOf, storedTargetOf, TARGET_FIELD, identityFieldOf, identityFieldName, inheritedFacetPolicies, referenceFields, referenceTypeNamed, endpointFieldOf, rootTypeNamed, inlineFramingDepth, fieldNamed, datasetField, ID_FIELD, AND_KEY, OR_KEY, labelFieldOf, labelFieldNameOf, labelSourceNamesOf, labelTargetNamesOf, documentKeyOf, DEFAULT_LABEL_FIELD, isRangeFacet, isBinnedRangeFacet, storedFacetRanges, isAbsoluteIri, isoToUnixSeconds, storedRangeBound, lastSecondOf, unixSecondsToIso, isDatePrecision, } from './schema.js';
10
10
  export { missingRequiredFields } from './project.js';
11
11
  export { physicalNameTokens } from './physical-name.js';
12
12
  export { matchLanguage } from './language.js';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { projectRoots } from './project.js';
2
2
  export type { ProjectedNode, ProjectionContext, SearchDocument, } from './project.js';
3
3
  export { defineSearchType, searchSchema, validateSearchType, assertValidSearchType, ID_FIELD, AND_KEY, OR_KEY, isoToUnixSeconds, lastSecondOf, unixSecondsToIso, isDatePrecision, } from './schema.js';
4
- export type { FieldKind, SearchField, SearchFieldBase, TextField, KeywordField, ReferenceField, ReferenceStrategy, NumericField, NumberField, DateField, BooleanField, SearchType, SearchTypeBase, RootType, ReferenceType, RootTypeOf, SearchTypeIssue, KeyField, FacetKeys, SearchSchema, FacetRange, DateFacetRange, ProjectionValue, DatePrecision, StoredDate, } from './schema.js';
4
+ export type { FieldKind, SearchField, SearchFieldBase, TextField, KeywordField, ReferenceField, ReferenceStrategy, NumericField, NumberField, DateField, PeriodField, BooleanField, SearchType, SearchTypeBase, RootType, ReferenceType, RootTypeOf, SearchTypeIssue, KeyField, FacetKeys, SearchSchema, FacetRange, DateFacetRange, ProjectionValue, DatePrecision, StoredDate, } from './schema.js';
5
5
  export { joinGraph, MAX_JOIN_DEPTH } from './join-graph.js';
6
6
  export type { JoinGraph } from './join-graph.js';
7
7
  export { filterOn } from './query.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,cAAc,GACf,MAAM,cAAc,CAAC;AAKtB,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,QAAQ,EACR,OAAO,EACP,MAAM,EAMN,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,SAAS,EACT,WAAW,EACX,eAAe,EACf,SAAS,EACT,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,SAAS,EACT,YAAY,EACZ,UAAU,EACV,cAAc,EACd,QAAQ,EACR,aAAa,EACb,UAAU,EACV,eAAe,EACf,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,UAAU,EACV,cAAc,EACd,eAAe,EACf,aAAa,EACb,UAAU,GACX,MAAM,aAAa,CAAC;AAKrB,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC5D,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAOjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,MAAM,EACN,SAAS,EACT,aAAa,EACb,eAAe,EACf,IAAI,GACL,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,cAAc,EACd,WAAW,EACX,cAAc,EACd,SAAS,EACT,cAAc,EACd,KAAK,EACL,WAAW,EACX,WAAW,EACX,QAAQ,EACR,aAAa,EACb,aAAa,EACb,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKrD,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,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cAAc,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * The stretch of time a `period` value covers, as stored: the first and the
3
+ * last second it allows, both inclusive. An open or unknown bound is stored as
4
+ * {@link OPEN_START} or {@link OPEN_END}, so the overlap test an engine runs
5
+ * needs no special case for it.
6
+ */
7
+ export interface StoredPeriod {
8
+ readonly start: number;
9
+ readonly end: number;
10
+ }
11
+ /**
12
+ * The stored start of a period with no known beginning (`../1607`, `/1607`).
13
+ * An exact int64 further back than any year a source states – about 146
14
+ * billion years, ten times the age of the universe – so a period open at its
15
+ * start overlaps every range that reaches back far enough to meet its end.
16
+ * The codec reads years to ±2⁶³ seconds; a bound past ±2⁶² is not refused,
17
+ * just never a real one.
18
+ */
19
+ export declare const OPEN_START: number;
20
+ /** The stored end of a period with no known end (`1440/..`, `1440/`); the
21
+ * mirror of {@link OPEN_START}. */
22
+ export declare const OPEN_END: number;
23
+ /**
24
+ * The period one value covers, or `undefined` for a value that states none.
25
+ *
26
+ * A value is an [EDTF](https://www.loc.gov/standards/datetime/) Level 0 or 1
27
+ * date or interval, or anything the `date` codec reads ({@link
28
+ * isoToUnixSeconds}): an `xsd:date`, `xsd:gYear`, `xsd:dateTime` or a
29
+ * deep-time year. What each covers, from its first second to its last:
30
+ *
31
+ * | Value | Covers |
32
+ * | ----------------- | ------------------------------- |
33
+ * | `1935` | all of 1935 |
34
+ * | `1935/1955` | 1935 through 1955 |
35
+ * | `1620~`, `1620?` | all of 1620 – the qualifier is not a margin |
36
+ * | `162X` | 1620 through 1629 |
37
+ * | `1620-XX`, `1606-21` | all of 1620, all of 1606 – a season is its year |
38
+ * | `1440/..`, `1440/`| 1440 onwards, unbounded |
39
+ * | `../1607` | everything up to the end of 1607 |
40
+ *
41
+ * **An unknown bound reads as an open one.** EDTF tells them apart (`1440/` is
42
+ * an end nobody knows, `1440/..` one that has not come), but a range filter
43
+ * must answer for both, and leaving a work out of every result it might belong
44
+ * to costs a reader more than one extra hit.
45
+ *
46
+ * **Each side is read on its own**, through the `date` codec: an empty or `..`
47
+ * side is open, and what only EDTF states is rewritten into a form the codec
48
+ * reads – a qualifier dropped, an unspecified month or day dropped to the
49
+ * coarser precision, a season read as its year (EDTF fixes no months for it),
50
+ * unspecified year digits read as their lowest and highest. Anything else
51
+ * EDTF Level 1 does not allow, such as Level 2’s `1950S2`, states no period.
52
+ * A value open at both ends, or ending before it starts, is no period at all.
53
+ */
54
+ export declare function periodOf(value: string): StoredPeriod | undefined;
55
+ /**
56
+ * The period several values cover between them: the earliest start and the
57
+ * latest end, or `undefined` when none states a period. One stored range per
58
+ * document is what an engine can sort on and compare in a single clause, so a
59
+ * work dated `1668`, `1676` and `1686` is stored as 1668 through 1686 – and a
60
+ * range falling between its dates still matches it.
61
+ */
62
+ export declare function periodOfAll(values: readonly string[]): StoredPeriod | undefined;
63
+ //# sourceMappingURL=period.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"period.d.ts","sourceRoot":"","sources":["../src/period.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,QAAa,CAAC;AAErC;oCACoC;AACpC,eAAO,MAAM,QAAQ,QAAU,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAehE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,SAAS,MAAM,EAAE,GACxB,YAAY,GAAG,SAAS,CAgB1B"}
package/dist/period.js ADDED
@@ -0,0 +1,130 @@
1
+ import { isoToUnixSeconds, lastSecondOf } from './schema.js';
2
+ /**
3
+ * The stored start of a period with no known beginning (`../1607`, `/1607`).
4
+ * An exact int64 further back than any year a source states – about 146
5
+ * billion years, ten times the age of the universe – so a period open at its
6
+ * start overlaps every range that reaches back far enough to meet its end.
7
+ * The codec reads years to ±2⁶³ seconds; a bound past ±2⁶² is not refused,
8
+ * just never a real one.
9
+ */
10
+ export const OPEN_START = -(2 ** 62);
11
+ /** The stored end of a period with no known end (`1440/..`, `1440/`); the
12
+ * mirror of {@link OPEN_START}. */
13
+ export const OPEN_END = 2 ** 62;
14
+ /**
15
+ * The period one value covers, or `undefined` for a value that states none.
16
+ *
17
+ * A value is an [EDTF](https://www.loc.gov/standards/datetime/) Level 0 or 1
18
+ * date or interval, or anything the `date` codec reads ({@link
19
+ * isoToUnixSeconds}): an `xsd:date`, `xsd:gYear`, `xsd:dateTime` or a
20
+ * deep-time year. What each covers, from its first second to its last:
21
+ *
22
+ * | Value | Covers |
23
+ * | ----------------- | ------------------------------- |
24
+ * | `1935` | all of 1935 |
25
+ * | `1935/1955` | 1935 through 1955 |
26
+ * | `1620~`, `1620?` | all of 1620 – the qualifier is not a margin |
27
+ * | `162X` | 1620 through 1629 |
28
+ * | `1620-XX`, `1606-21` | all of 1620, all of 1606 – a season is its year |
29
+ * | `1440/..`, `1440/`| 1440 onwards, unbounded |
30
+ * | `../1607` | everything up to the end of 1607 |
31
+ *
32
+ * **An unknown bound reads as an open one.** EDTF tells them apart (`1440/` is
33
+ * an end nobody knows, `1440/..` one that has not come), but a range filter
34
+ * must answer for both, and leaving a work out of every result it might belong
35
+ * to costs a reader more than one extra hit.
36
+ *
37
+ * **Each side is read on its own**, through the `date` codec: an empty or `..`
38
+ * side is open, and what only EDTF states is rewritten into a form the codec
39
+ * reads – a qualifier dropped, an unspecified month or day dropped to the
40
+ * coarser precision, a season read as its year (EDTF fixes no months for it),
41
+ * unspecified year digits read as their lowest and highest. Anything else
42
+ * EDTF Level 1 does not allow, such as Level 2’s `1950S2`, states no period.
43
+ * A value open at both ends, or ending before it starts, is no period at all.
44
+ */
45
+ export function periodOf(value) {
46
+ const sides = value.split('/');
47
+ if (sides.length > 2) {
48
+ return undefined;
49
+ }
50
+ const from = sideOf(sides[0]);
51
+ // A plain date is its own first and last side.
52
+ const to = sides.length === 1 ? from : sideOf(sides[1]);
53
+ if (from === undefined || to === undefined) {
54
+ return undefined;
55
+ }
56
+ const { start } = from;
57
+ const { end } = to;
58
+ const openAtBothEnds = start === OPEN_START && end === OPEN_END;
59
+ return start <= end && !openAtBothEnds ? { start, end } : undefined;
60
+ }
61
+ /**
62
+ * The period several values cover between them: the earliest start and the
63
+ * latest end, or `undefined` when none states a period. One stored range per
64
+ * document is what an engine can sort on and compare in a single clause, so a
65
+ * work dated `1668`, `1676` and `1686` is stored as 1668 through 1686 – and a
66
+ * range falling between its dates still matches it.
67
+ */
68
+ export function periodOfAll(values) {
69
+ let covered;
70
+ for (const value of values) {
71
+ const period = periodOf(value);
72
+ if (period === undefined) {
73
+ continue;
74
+ }
75
+ covered =
76
+ covered === undefined
77
+ ? period
78
+ : {
79
+ start: Math.min(covered.start, period.start),
80
+ end: Math.max(covered.end, period.end),
81
+ };
82
+ }
83
+ return covered;
84
+ }
85
+ /** One side of an interval, or a whole plain value. */
86
+ function sideOf(text) {
87
+ const side = text.trim();
88
+ // EDTF’s open (`..`) and unknown (empty) bounds, both read as open.
89
+ if (side === '' || side === '..') {
90
+ return { start: OPEN_START, end: OPEN_END };
91
+ }
92
+ // A plain date, the common case, needs no rewriting.
93
+ const plain = isoToUnixSeconds(side.replace(DEEP_YEAR, '$1'));
94
+ if (plain !== undefined) {
95
+ return { start: plain.seconds, end: lastSecondOf(plain) };
96
+ }
97
+ // What only EDTF states, rewritten into a form the codec reads.
98
+ const date = side
99
+ .replace(HOURS_ONLY_SHIFT, '$1:00')
100
+ .replace(QUALIFIER, '$1')
101
+ .replace(DEEP_YEAR, '$1')
102
+ .replace(UNSPECIFIED_MONTH_OR_SEASON, '$1')
103
+ .replace(UNSPECIFIED_DAY, '$1');
104
+ const [lowest, highest] = UNSPECIFIED_YEAR.test(date)
105
+ ? [date.replaceAll('X', '0'), date.replaceAll('X', '9')]
106
+ : [date, date];
107
+ const first = isoToUnixSeconds(lowest);
108
+ const last = isoToUnixSeconds(highest);
109
+ return first === undefined || last === undefined
110
+ ? undefined
111
+ : { start: first.seconds, end: lastSecondOf(last) };
112
+ }
113
+ /** A time shift of whole hours (`T10:10:10+05`), which EDTF allows and the
114
+ * codec reads only as `+05:00`. */
115
+ const HOURS_ONLY_SHIFT = /(T[\d:.]+[+-]\d{2})$/;
116
+ /** An EDTF Level 1 qualifier – `~` approximate, `?` uncertain, `%` both – on a
117
+ * date. It is part of what is known, not a margin, so the date is read
118
+ * without it. */
119
+ const QUALIFIER = /^([^T]+)[~?%]$/;
120
+ /** An EDTF `Y` year – a year of any length, signed – read as the bare year
121
+ * the codec stores it as. */
122
+ const DEEP_YEAR = /^Y([+-]?\d+)$/;
123
+ /** An unspecified month (`1620-XX`, `1620-XX-XX`) or a season (`1606-21` to
124
+ * `1606-24`), read as the year. */
125
+ const UNSPECIFIED_MONTH_OR_SEASON = /^([+-]?\d{4,})-(?:XX(?:-XX)?|2[1-4])$/;
126
+ /** An unspecified day (`1620-05-XX`), read as the month. */
127
+ const UNSPECIFIED_DAY = /^([+-]?\d{4,}-\d{2})-XX$/;
128
+ /** A year with unspecified trailing digits: `162X`, `16XX`. Not `XXXX`, which
129
+ * knows no more than `../..`. */
130
+ const UNSPECIFIED_YEAR = /^(?=.{4}$)\d+X+$/;
@@ -1 +1 @@
1
- {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAuBL,KAAK,eAAe,EAIpB,KAAK,QAAQ,EAEb,KAAK,YAAY,EACjB,KAAK,UAAU,EAGhB,MAAM,aAAa,CAAC;AAErB;;;;;;GAMG;AACH,MAAM,MAAM,aA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;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpD,+DAA+D;AAC/D,MAAM,MAAM,cAAc,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,aAAa,CAAC;AAE5D;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iBAAkB,SAAQ,OAAO,CAChD,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAC1C;IACC,4CAA4C;IAC5C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAKD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,UAAU,EACtB,MAAM,CAAC,EAAE,YAAY,EACrB,OAAO,GAAE,iBAAyC,GACjD,cAAc,CAgBhB;AAsLD;;;;;;;;;;;;GAYG;AACH,wBAAuB,YAAY,CACjC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,EACrB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,QAAQ,EACpB,OAAO,GAAE,iBAAyC,GACjD,aAAa,CAAC,cAAc,CAAC,CAc/B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,aAAa,EACvB,UAAU,EAAE,UAAU,EACtB,MAAM,CAAC,EAAE,YAAY,GACpB,SAAS,MAAM,EAAE,CAmCnB"}
package/dist/project.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import { fold } from '@lde/text-normalization';
2
2
  import { matchLanguage } from './language.js';
3
3
  import { buildSubjectIndex, frameSubjects, } from './frame-by-type.js';
4
- import { assertTypeInSchema, displayFieldName, displayLangOf, documentKeyOf, endpointFieldOf, fieldNamed, identityFieldOf, inheritedFacetPolicies, inlineFramingDepth, irAlias, isAbsoluteIri, isInternalField, isInlineReference, isoToUnixSeconds, localLookupTargetsOf, physicalFields, referencedTargetsOf, referenceTypeNamed, storableUnixSeconds, storedTargetOf, TARGET_FIELD, } from './schema.js';
4
+ import { companionNames, assertTypeInSchema, displayFieldName, displayLangOf, documentKeyOf, endpointFieldOf, fieldNamed, identityFieldOf, inheritedFacetPolicies, inlineFramingDepth, irAlias, isAbsoluteIri, isInternalField, isInlineReference, isoToUnixSeconds, localLookupTargetsOf, physicalFields, referencedTargetsOf, referenceTypeNamed, storableUnixSeconds, storedTargetOf, TARGET_FIELD, } from './schema.js';
5
+ import { periodOfAll } from './period.js';
5
6
  /** The context a projection runs with when its caller supplied none. */
6
7
  const NO_PROJECTION_CONTEXT = {};
7
8
  /**
@@ -59,7 +60,10 @@ function pruneInternalFields(document, searchType, schema) {
59
60
  }
60
61
  for (const field of searchType.fields) {
61
62
  if (isInternalField(field)) {
62
- delete document[field.name];
63
+ // With its companions, which no collection declares for it either.
64
+ for (const name of [field.name, ...companionNames(field)]) {
65
+ delete document[name];
66
+ }
63
67
  continue;
64
68
  }
65
69
  if (schema === undefined || field.kind !== 'reference') {
@@ -269,6 +273,9 @@ function applyField(document, node, field, searchType, schema, context, nested)
269
273
  if (field.kind === 'date') {
270
274
  return applyDerivedDate(document, field, derived);
271
275
  }
276
+ if (field.kind === 'period') {
277
+ return setPeriod(document, field, derivedStrings(derived));
278
+ }
272
279
  const value = field.kind === 'reference' && derived !== undefined
273
280
  ? derivedIris(derived)
274
281
  : derived;
@@ -281,8 +288,10 @@ function applyField(document, node, field, searchType, schema, context, nested)
281
288
  }
282
289
  return;
283
290
  }
284
- if (field.path === undefined) {
285
- // Neither path nor derive: populated outside the projection, if at all.
291
+ if (field.path === undefined && field.name !== searchType.literalField) {
292
+ // Neither path nor derive: populated outside the projection, if at all. A
293
+ // pathless literal field is the exception: {@link literalReader} fills it
294
+ // from a literal the reference reached, never from a node.
286
295
  return;
287
296
  }
288
297
  // The framed node is keyed by the {@link irAlias IR Alias} the extraction
@@ -338,6 +347,8 @@ function applyField(document, node, field, searchType, schema, context, nested)
338
347
  const literal = firstLiteralOf(node, alias);
339
348
  return setDate(document, field, literal === undefined ? undefined : isoToUnixSeconds(literal));
340
349
  }
350
+ case 'period':
351
+ return setPeriod(document, field, literalsOf(node, alias));
341
352
  case 'boolean': {
342
353
  // The xsd:boolean lexical space: true/false/1/0.
343
354
  const literal = firstLiteralOf(node, alias);
@@ -683,7 +694,8 @@ function applyInlineReference(document, node, alias, field, schema, context, nes
683
694
  return;
684
695
  }
685
696
  const asEdge = edgeReader(referenceType, field.ref.identity);
686
- const referents = applyNestedReferents(document, valuesOf(node, alias).map(asEdge), field, [referenceType], schema, context);
697
+ const asLiteralEntry = literalReader(referenceType);
698
+ const referents = applyNestedReferents(document, valuesOf(node, alias).map((value) => asLiteralEntry(value) ?? asEdge(value)), field, [referenceType], schema, context);
687
699
  applyIdentityCompanion(document, referents, field, schema, nested);
688
700
  }
689
701
  /**
@@ -705,11 +717,32 @@ function edgeReader(referenceType, identity) {
705
717
  const endpointAlias = irAlias(referenceType, endpointField);
706
718
  return (value) =>
707
719
  // Only a node can be an endpoint: anything else is left for the
708
- // projection to discard, as it would be without an edge class.
720
+ // projection to discard, as it would be without an edge class – unless
721
+ // {@link literalReader}, which runs first, read it as a literal entry.
709
722
  !isObject(value) || classesOf(value).has(referenceType.edgeClass)
710
723
  ? value
711
724
  : { [endpointAlias]: [value] };
712
725
  }
726
+ /**
727
+ * Read a **literal** an inline reference reached in place of a node as an entry
728
+ * carrying it under the Reference Type’s
729
+ * {@link ReferenceType.literalField literal field} alone – so a value the graph
730
+ * states bare and one it states on a node project through one path. Returns
731
+ * `undefined` for anything that is not a literal, and for every value where the
732
+ * type declares no literal field, leaving it to {@link edgeReader}.
733
+ */
734
+ function literalReader(referenceType) {
735
+ const field = referenceType.literalField === undefined
736
+ ? undefined
737
+ : fieldNamed(referenceType, referenceType.literalField);
738
+ if (field === undefined) {
739
+ return () => undefined;
740
+ }
741
+ const literalAlias = irAlias(referenceType, field);
742
+ return (value) => literalString(value) === undefined
743
+ ? undefined
744
+ : { [literalAlias]: [value] };
745
+ }
713
746
  /**
714
747
  * Write the {@link ReferenceStrategy.identity identity companion} of an inline
715
748
  * reference: the ids its entries reference, flattened out of the nested
@@ -1090,6 +1123,37 @@ function setDate(document, field, stored) {
1090
1123
  document[field.name] = stored.seconds;
1091
1124
  document[physicalFields(field).precision] = stored.precision;
1092
1125
  }
1126
+ /**
1127
+ * Store a `period` field: its values verbatim under the field’s own name, for
1128
+ * output, and the stretch they cover between them in the bound companions
1129
+ * ({@link physicalFields}). A value that states no period is still stored – it
1130
+ * is what the source said – but bounds nothing.
1131
+ *
1132
+ * Blank values are dropped before a single-valued field keeps its first, so
1133
+ * an empty literal cannot cost the field the value behind it; and the bounds
1134
+ * are taken from exactly the values stored, so what is served and what is
1135
+ * filtered cannot disagree.
1136
+ */
1137
+ function setPeriod(document, field, values) {
1138
+ const nonBlank = dedupe(values.map((value) => value.trim())).filter((value) => value !== '');
1139
+ const stated = field.array === true ? nonBlank : nonBlank.slice(0, 1);
1140
+ if (stated.length === 0) {
1141
+ return;
1142
+ }
1143
+ document[field.name] = field.array === true ? stated : stated[0];
1144
+ const companions = physicalFields(field).period;
1145
+ const covered = periodOfAll(stated);
1146
+ if (companions !== undefined && covered !== undefined) {
1147
+ document[companions.start] = covered.start;
1148
+ document[companions.end] = covered.end;
1149
+ }
1150
+ }
1151
+ /** A derive’s value as the strings a `period` stores: one string, or the
1152
+ * strings in a list; anything else states no value. */
1153
+ function derivedStrings(derived) {
1154
+ const values = Array.isArray(derived) ? derived : [derived];
1155
+ return values.filter((value) => typeof value === 'string');
1156
+ }
1093
1157
  function setNumber(document, field, value) {
1094
1158
  if (value !== undefined && !Number.isNaN(value)) {
1095
1159
  document[field] = value;
package/dist/query.d.ts CHANGED
@@ -281,7 +281,15 @@ export interface QueryIssue {
281
281
  * and a rejected criterion answers a narrower one. Neither is the query,
282
282
  * and only the caller can fix the bound.
283
283
  */
284
- | 'unparseable-bound';
284
+ | 'unparseable-bound'
285
+ /**
286
+ * A range whose `min` comes after its `max` – for a `date` or `period`,
287
+ * after the last second `max` names (`1950` to `1940`, not `1950` to
288
+ * `1950`). A `date` field would match nothing and a
289
+ * `period` everything spanning the gap, and neither is what the caller
290
+ * meant, so the caller is told.
291
+ */
292
+ | 'inverted-range';
285
293
  }
286
294
  /**
287
295
  * A resolved {@link CriterionBase.on} path: which type the leaf field belongs
@@ -1 +1 @@
1
- {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,wEAAwE;IACxE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,yEAAyE;IACzE,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,SAAS,IAAI,EAAE,CAAC;IAClC,2BAA2B;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;;;;OAOG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;CACxC;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B;gEAC4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,SAAS,MAAM,EAAE,C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AAE/E;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CACzB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,MAAM,EAAE,YAAY,EACpB,KAAK,CAAC,EAAE,SAAS,GAChB,YAAY,GAAG,WAAW,CAkC5B;AAUD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,WAAW,EAClB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,YAAY,EACpB,KAAK,CAAC,EAAE,SAAS,GAChB,SAAS,UAAU,EAAE,CA+FvB;AAqFD;yEACyE;AACzE,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,WAAW,EAClB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,YAAY,EACpB,KAAK,CAAC,EAAE,SAAS,GAChB,IAAI,CAaN;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEnE"}
package/dist/query.js CHANGED
@@ -1,4 +1,4 @@
1
- import { fieldNamed, filterOperatorFor, ID_FIELD, isoToUnixSeconds, nestedReferenceType, referencedTargetsOf, } from './schema.js';
1
+ import { fieldNamed, filterOperatorFor, ID_FIELD, nestedReferenceType, referencedTargetsOf, storedRangeBound, } from './schema.js';
2
2
  import { MAX_JOIN_DEPTH } from './join-graph.js';
3
3
  /** Whether a criterion welds conditions to one entry ({@link WeldedCriterion}). */
4
4
  export function isWelded(criterion) {
@@ -113,7 +113,8 @@ export function facetSearches(query) {
113
113
  /**
114
114
  * The checks every leaf criterion answers to, wherever it sits: the field is
115
115
  * declared and `filterable` on the type it constrains, its operator matches
116
- * that field's kind, and a `date` range's bounds are readable.
116
+ * that field's kind, and a `date` or `period` range's bounds are readable and
117
+ * in order.
117
118
  *
118
119
  * Shared by an ordinary criterion and by each condition welded to an entry, so
119
120
  * a welded condition is held to exactly the same rules – there is no second,
@@ -134,13 +135,15 @@ function collectLeafIssues(criterion, constrained, field, issues) {
134
135
  issues.push({ part: 'where', field, reason: 'operator-mismatch' });
135
136
  return;
136
137
  }
137
- if (declared.kind === 'date' && 'range' in criterion) {
138
- // A `date` bound is ISO 8601 at the edge and Unix seconds in storage, so a
139
- // bound the codec cannot read has nothing to compare against. Both bounds
140
- // are checked, so a caller who wrote two bad ones is told about both
141
- // instead of fixing one to be told about the other.
142
- for (const bound of [criterion.range.min, criterion.range.max]) {
143
- if (typeof bound === 'string' && isoToUnixSeconds(bound) === undefined) {
138
+ if ('range' in criterion) {
139
+ // A `date` or `period` bound is ISO 8601 at the edge and Unix seconds in
140
+ // storage, so a bound the codec cannot read has nothing to compare
141
+ // against. Both bounds are checked, so a caller who wrote two bad ones is
142
+ // told about both instead of fixing one to be told about the other.
143
+ const [min, max] = ['min', 'max'].map((side) => {
144
+ const bound = criterion.range[side] ?? undefined;
145
+ const stored = storedRangeBound(declared, bound, side);
146
+ if (typeof bound === 'string' && stored === undefined) {
144
147
  issues.push({
145
148
  part: 'where',
146
149
  field,
@@ -148,6 +151,10 @@ function collectLeafIssues(criterion, constrained, field, issues) {
148
151
  reason: 'unparseable-bound',
149
152
  });
150
153
  }
154
+ return stored;
155
+ });
156
+ if (min !== undefined && max !== undefined && min > max) {
157
+ issues.push({ part: 'where', field, reason: 'inverted-range' });
151
158
  }
152
159
  }
153
160
  }
package/dist/schema.d.ts CHANGED
@@ -6,7 +6,7 @@ import type { ProjectedNode, ProjectionContext } from './project.js';
6
6
  * output/input type. The Typesense-vocabulary types (`string`, `int32`, …) are
7
7
  * *derived* from this by the engine adapter, never declared here.
8
8
  */
9
- export type FieldKind = 'text' | 'keyword' | 'integer' | 'number' | 'boolean' | 'date' | 'reference';
9
+ export type FieldKind = 'text' | 'keyword' | 'integer' | 'number' | 'boolean' | 'date' | 'period' | 'reference';
10
10
  /** The `where` operator a kind accepts, or `undefined` when it is not filterable
11
11
  * through `where` (`text` feeds the free-text `query` instead). */
12
12
  export type FilterOperator = 'in' | 'range' | 'is';
@@ -53,7 +53,7 @@ export declare function filterOperatorFor(kind: FieldKind): FilterOperator | und
53
53
  * `ref`←`sh:node`/`sh:class`),
54
54
  * and a hand-written declaration is just as valid.
55
55
  */
56
- export type SearchField = TextField | KeywordField | ReferenceField | NumericField | BooleanField;
56
+ export type SearchField = TextField | KeywordField | ReferenceField | NumericField | PeriodField | BooleanField;
57
57
  /** The declaration members every {@link SearchField} kind shares. */
58
58
  export interface SearchFieldBase {
59
59
  /** Logical API name; the physical fanout derives from it. Declare camelCase
@@ -372,6 +372,40 @@ export interface DateField extends SearchFieldBase, RangeFacetable<DateFacetRang
372
372
  readonly kind: 'date';
373
373
  readonly searchable?: never;
374
374
  }
375
+ /**
376
+ * A stretch of time, stated as an [EDTF](https://www.loc.gov/standards/datetime/)
377
+ * value or an ISO 8601 date: `1935/1955`, `1620~`, `162X`, `1440/..`. Where a
378
+ * `date` holds one instant, a period holds what its source knows – often only
379
+ * that something happened somewhere between two dates.
380
+ *
381
+ * - **Output** is each value verbatim, as its source stated it: `1620~` stays
382
+ * `1620~`, because the qualifier is part of what is known and how to render
383
+ * it (“c. 1620”) depends on the reader’s language.
384
+ * - **A range filter matches by overlap**: `{ min: '1940', max: '1950' }`
385
+ * matches `1935/1955`, which a filter on a start date alone would miss. The
386
+ * bounds are ISO 8601, as a `date` filter’s are, and `max` reaches through
387
+ * the end of the period it names.
388
+ * - **Sorting** ascending orders on the earliest second a value allows,
389
+ * descending on the latest, so “newest first” places `1935/1955` by 1955.
390
+ *
391
+ * The bounds are two companions the engine stores beside the values
392
+ * ({@link PhysicalFields.period}), never fields a client sees. An `array`
393
+ * field is stored as the one stretch its values cover between them – the
394
+ * earliest start to the latest end – since that is what an engine can sort on
395
+ * and test in one clause. A value no reader can parse is still served; it just
396
+ * takes no part in filtering or sorting.
397
+ *
398
+ * Not facetable: a period belongs in every bin it overlaps, which no engine
399
+ * facet counts from two bounds. And filtered only on the document that holds
400
+ * it, never through a nesting or a weld: the two bounds are compared in one
401
+ * clause, which a nested entry has no room for.
402
+ */
403
+ export interface PeriodField extends SearchFieldBase {
404
+ readonly kind: 'period';
405
+ readonly searchable?: never;
406
+ readonly facetable?: never;
407
+ readonly facetRanges?: never;
408
+ }
375
409
  /** A boolean flag; absent in a document means `false`. */
376
410
  export interface BooleanField extends SearchFieldBase {
377
411
  readonly kind: 'boolean';
@@ -528,6 +562,9 @@ export interface RootType extends SearchTypeBase {
528
562
  /** Only a Reference Type is an edge a graph may leave out
529
563
  * ({@link ReferenceType.edgeClass}). */
530
564
  readonly edgeClass?: never;
565
+ /** Only a Reference Type is a node a graph may state as a bare literal
566
+ * ({@link ReferenceType.literalField}). */
567
+ readonly literalField?: never;
531
568
  }
532
569
  /**
533
570
  * A **Reference Type**: a {@link SearchType} reached only through an
@@ -571,6 +608,23 @@ export interface ReferenceType extends SearchTypeBase {
571
608
  * of its own.
572
609
  */
573
610
  readonly edgeClass?: string;
611
+ /**
612
+ * The field a **literal** goes into where an inline reference reaches one in
613
+ * place of this type’s node, for a graph that may state the node’s value
614
+ * bare – `schema:identifier "G11125-19"` on one work, a
615
+ * `schema:PropertyValue` carrying `schema:value "12042"` on the next.
616
+ *
617
+ * Declaring it is the opt-in. A literal the reference reaches is then an
618
+ * entry carrying that literal in this field and none of the type’s other
619
+ * fields, so a consumer reads both shapes as one list; without it, a literal
620
+ * projects to nothing. The field must hold a literal – any kind but
621
+ * `reference`, with no `derive` or `from` – and no other field may be
622
+ * `required`, since a literal never carries one ({@link searchSchema}
623
+ * enforces both). Without a `path`, it is filled from a literal only: the
624
+ * display text of a `schema:size` stated bare, which no `QuantitativeValue`
625
+ * node carries.
626
+ */
627
+ readonly literalField?: string;
574
628
  }
575
629
  /**
576
630
  * One type’s complete search declaration: its logical API `name`, the queryable
@@ -784,7 +838,7 @@ export declare function storedTargetOf(entry: Readonly<Record<string, unknown>>,
784
838
  */
785
839
  export interface SearchTypeIssue {
786
840
  readonly field: string;
787
- readonly reason: 'duplicate-field-name' | 'invalid-field-name' | 'unknown-kind' | 'invalid-locale' | 'missing-ref' | 'missing-ref-type-name' | 'ref-not-allowed' | 'text-requires-locales' | 'locales-not-allowed' | 'facet-ranges-not-allowed' | 'unparseable-facet-range' | 'searchable-not-allowed' | 'transform-not-allowed' | 'derive-with-path' | 'from-not-allowed' | 'from-with-path' | 'from-with-derive' | 'from-with-inline-ref' | 'unknown-projection-value' | 'duplicate-projection-value' | 'text-not-filterable' | 'text-not-facetable' | 'joinable-not-allowed' | 'joinable-without-label-source' | 'joinable-with-inline-ref' | 'joinable-with-several-targets' | 'duplicate-target' | 'empty-target' | 'reserved-field-name' | 'key-field-unknown' | 'key-field-not-reference' | 'key-field-without-path' | 'key-field-not-array' | 'key-field-inline' | 'key-pick-not-a-function' | 'key-not-allowed' | 'facet-keys-only-not-a-function' | 'facet-keys-not-allowed';
841
+ readonly reason: 'duplicate-field-name' | 'invalid-field-name' | 'unknown-kind' | 'invalid-locale' | 'missing-ref' | 'missing-ref-type-name' | 'ref-not-allowed' | 'text-requires-locales' | 'locales-not-allowed' | 'facet-ranges-not-allowed' | 'unparseable-facet-range' | 'searchable-not-allowed' | 'transform-not-allowed' | 'derive-with-path' | 'from-not-allowed' | 'from-with-path' | 'from-with-derive' | 'from-with-inline-ref' | 'unknown-projection-value' | 'duplicate-projection-value' | 'text-not-filterable' | 'text-not-facetable' | 'period-not-facetable' | 'joinable-not-allowed' | 'joinable-without-label-source' | 'joinable-with-inline-ref' | 'joinable-with-several-targets' | 'duplicate-target' | 'empty-target' | 'reserved-field-name' | 'key-field-unknown' | 'key-field-not-reference' | 'key-field-without-path' | 'key-field-not-array' | 'key-field-inline' | 'key-pick-not-a-function' | 'key-not-allowed' | 'facet-keys-only-not-a-function' | 'facet-keys-not-allowed';
788
842
  }
789
843
  /**
790
844
  * The reserved logical name of a document’s IRI – the one field every indexed
@@ -932,6 +986,20 @@ export interface PhysicalFields {
932
986
  * other kind.
933
987
  */
934
988
  readonly precision: string | undefined;
989
+ /**
990
+ * The **bound companions** of a `period` field: `${name}_start` and
991
+ * `${name}_end`, the first and last second its values cover, in Unix
992
+ * seconds. The field itself stores the values verbatim for output, so what
993
+ * a filter compares and a sort orders on lives here. Declared for every
994
+ * period, `filterable` and `sortable` or not: a deployment may sort on a
995
+ * field it does not expose as sortable, and two int64 values per document
996
+ * cost less than a sort the engine refuses. `undefined` for every other
997
+ * field.
998
+ */
999
+ readonly period: {
1000
+ readonly start: string;
1001
+ readonly end: string;
1002
+ } | undefined;
935
1003
  }
936
1004
  /** The physical name of an inline reference’s
937
1005
  * {@link ReferenceStrategy.identity identity companion}. */
@@ -1223,6 +1291,12 @@ export declare function unixSecondsToIso(seconds: number, precision: DatePrecisi
1223
1291
  * `2000` to a range that stops at `2000`, since those are stored there too.
1224
1292
  */
1225
1293
  export declare function lastSecondOf(stored: StoredDate): number;
1294
+ /** A range bound as stored: a `date` or `period` bound, ISO 8601 at the edge,
1295
+ * becomes Unix seconds ({@link isoToUnixSeconds}) – a `min` the first second
1296
+ * of what it names, a `max` the last ({@link lastSecondOf}), so the range
1297
+ * takes in the whole of each. Any other bound is stored as given; one the
1298
+ * codec cannot read is `undefined`. */
1299
+ export declare function storedRangeBound(field: SearchField, bound: number | string | undefined, side: 'min' | 'max'): number | string | undefined;
1226
1300
  /** `seconds` if a `date` field can store it – the int64 the engine keeps
1227
1301
  * Unix seconds in – or `undefined`, the same answer {@link isoToUnixSeconds}
1228
1302
  * gives a string it cannot parse. */
@@ -1243,6 +1317,9 @@ export declare function storableUnixSeconds(seconds: number): number | undefined
1243
1317
  * a schema, where it cannot re-key a reference either.
1244
1318
  */
1245
1319
  export declare function physicalFields(field: SearchField, schema?: SearchSchema): PhysicalFields;
1320
+ /** The value companions a field stores beside its own name: a `date`’s
1321
+ * precision, a `period`’s two bounds. */
1322
+ export declare function companionNames(field: SearchField): string[];
1246
1323
  /**
1247
1324
  * The {@link FacetKeys facet policies} a field inherits, keyed by the `name` of
1248
1325
  * the Root Type declaring each: the `facetKeys` of every type the field names
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGrE;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GACnB,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,CAAC;AAE/E;oEACoE;AACpE,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,CAAC;AAcnD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,GAAG,cAAc,GAAG,SAAS,CAE7E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,MAAM,WAAW,GACrB,SAAS,GAAG,YAAY,GAAG,cAAc,GAAG,YAAY,GAAG,YAAY,CAAC;AAE1E,qEAAqE;AACrE,MAAM,WAAW,eAAe;IAC9B;wCACoC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;+EAC2E;IAC3E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;mEAK+D;IAC/D,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB;;yCAEqC;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,gEAAgE;IAChE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,yBAAyB;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,iCAAiC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,qFAAqF;I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A6ChB;AAED;0CAC0C;AAC1C,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,EAAE,CAK3D;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,YAAY,GAAG,SAAS,GAC/B,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAiBhC"}
package/dist/schema.js CHANGED
@@ -6,6 +6,7 @@ const OPERATOR_BY_KIND = {
6
6
  integer: 'range',
7
7
  number: 'range',
8
8
  date: 'range',
9
+ period: 'range',
9
10
  boolean: 'is',
10
11
  };
11
12
  /**
@@ -374,6 +375,41 @@ function assertResolvableInlineReferences(types, referenceTypes) {
374
375
  assertConsistentIdentities(types);
375
376
  for (const referenceType of referenceTypes.values()) {
376
377
  assertNoInlineCycle(referenceType, referenceTypes, new Set());
378
+ assertLiteralField(referenceType);
379
+ }
380
+ }
381
+ /**
382
+ * A Reference Type’s {@link ReferenceType.literalField literal field} can hold
383
+ * the literal it stands for: it is declared, it holds a literal (no `derive` or
384
+ * `from`, which compute a value, and not a `reference`, which reads IRIs), and
385
+ * no other field is `required` – an entry made from a literal carries that one
386
+ * field alone, so any other required one would drop it. A `path` is optional:
387
+ * without one, the field is filled from a literal only, never from a node, so
388
+ * it cannot be `required` itself.
389
+ */
390
+ function assertLiteralField(referenceType) {
391
+ const { literalField } = referenceType;
392
+ if (literalField === undefined) {
393
+ return;
394
+ }
395
+ const where = `Reference type “${referenceType.name}”`;
396
+ const field = fieldNamed(referenceType, literalField);
397
+ if (field === undefined) {
398
+ throw new Error(`${where} names literal field “${literalField}”, which it does not declare.`);
399
+ }
400
+ if (field.kind === 'reference' ||
401
+ field.derive !== undefined ||
402
+ ('from' in field && field.from !== undefined)) {
403
+ throw new Error(`${where} names literal field “${literalField}”, which reads no literal: declare it with a kind other than “reference”, and no “derive” or “from”.`);
404
+ }
405
+ const required = referenceType.fields.find((other) => other.required === true && other.name !== literalField);
406
+ if (required !== undefined) {
407
+ throw new Error(`${where} declares a “literalField” and requires “${required.name}”: an entry made from a literal carries only “${literalField}”, so it would never have “${required.name}”. Drop “required” from “${required.name}”.`);
408
+ }
409
+ // The mirror image: a literal field with no path is filled from a literal
410
+ // only, so an entry made from a node would never have it.
411
+ if (field.path === undefined && field.required === true) {
412
+ throw new Error(`${where} requires literal field “${literalField}”, which has no “path”: an entry made from a node never has it. Drop “required”, or give it a “path”.`);
377
413
  }
378
414
  }
379
415
  /**
@@ -572,6 +608,9 @@ function assertServiceableNestedFields(referenceTypes) {
572
608
  if (field.labelSource !== undefined) {
573
609
  throw new Error(`Nested field “${referenceType.name}.${field.name}” declares a label source, which an inline reference cannot serve; declare a “lookup” on the nested reference instead of resolving a label for it.`);
574
610
  }
611
+ if (field.filterable === true && field.kind === 'period') {
612
+ throw new Error(`Nested field “${referenceType.name}.${field.name}” is a filterable “period”, which a weld cannot test: a period is matched by comparing two stored bounds, and a weld compares one value per condition. Declare it “output” only, or carry the period on the Root Type.`);
613
+ }
575
614
  if (field.filterable === true && field.array === true) {
576
615
  throw new Error(`Nested field “${referenceType.name}.${field.name}” declares both “filterable” and “array”: a weld asks whether ONE entry satisfies every condition, and an entry holding a list has no single value to test – it stands for each combination at once, so the weld degenerates into the cross-product it exists to exclude. Declare the field single-valued; the projection emits one entry per combination.`);
577
616
  }
@@ -931,11 +970,10 @@ export function validateSearchType(searchType) {
931
970
  const issues = [];
932
971
  const seen = new Set();
933
972
  const seenProjectionValues = new Set();
934
- // A `date` field stores its precision under `${name}_precision`, so a
935
- // declared field of that name would overwrite it, and be overwritten.
936
- const precisionCompanions = new Set(searchType.fields
937
- .filter((field) => field.kind === 'date')
938
- .map((field) => physicalFields(field).precision));
973
+ // A `date` field stores its precision under `${name}_precision`, and a
974
+ // `period` its bounds under `${name}_start` and `${name}_end`, so a declared
975
+ // field of such a name would overwrite one, and be overwritten.
976
+ const precisionCompanions = new Set(searchType.fields.flatMap(companionNames));
939
977
  for (const declared of searchType.fields) {
940
978
  // Validation guards declarations built OUTSIDE TypeScript (a SHACL
941
979
  // generator, plain JS), so it inspects the uniform flat shape rather
@@ -1052,8 +1090,11 @@ export function validateSearchType(searchType) {
1052
1090
  filterOperatorFor(field.kind) === undefined) {
1053
1091
  issue('text-not-facetable');
1054
1092
  }
1093
+ if (field.facetable === true && field.kind === 'period') {
1094
+ issue('period-not-facetable');
1095
+ }
1055
1096
  if (field.facetRanges !== undefined &&
1056
- filterOperatorFor(field.kind) !== 'range') {
1097
+ (filterOperatorFor(field.kind) !== 'range' || field.kind === 'period')) {
1057
1098
  issue('facet-ranges-not-allowed');
1058
1099
  }
1059
1100
  if (field.kind === 'date' &&
@@ -1685,6 +1726,22 @@ export function lastSecondOf(stored) {
1685
1726
  ? seconds + span - 1
1686
1727
  : next.getTime() / 1000 - 1;
1687
1728
  }
1729
+ /** A range bound as stored: a `date` or `period` bound, ISO 8601 at the edge,
1730
+ * becomes Unix seconds ({@link isoToUnixSeconds}) – a `min` the first second
1731
+ * of what it names, a `max` the last ({@link lastSecondOf}), so the range
1732
+ * takes in the whole of each. Any other bound is stored as given; one the
1733
+ * codec cannot read is `undefined`. */
1734
+ export function storedRangeBound(field, bound, side) {
1735
+ if ((field.kind !== 'date' && field.kind !== 'period') ||
1736
+ typeof bound !== 'string') {
1737
+ return bound;
1738
+ }
1739
+ const stored = isoToUnixSeconds(bound);
1740
+ if (stored === undefined) {
1741
+ return undefined;
1742
+ }
1743
+ return side === 'min' ? stored.seconds : lastSecondOf(stored);
1744
+ }
1688
1745
  /** `seconds` if a `date` field can store it – the int64 the engine keeps
1689
1746
  * Unix seconds in – or `undefined`, the same answer {@link isoToUnixSeconds}
1690
1747
  * gives a string it cannot parse. */
@@ -1797,6 +1854,7 @@ export function physicalFields(field, schema) {
1797
1854
  facet: undefined,
1798
1855
  identity: undefined,
1799
1856
  precision: undefined,
1857
+ period: undefined,
1800
1858
  };
1801
1859
  }
1802
1860
  // A field storing a nested OBJECT cannot be filtered or faceted as itself, so
@@ -1820,8 +1878,17 @@ export function physicalFields(field, schema) {
1820
1878
  : `${filtered}_facet`,
1821
1879
  identity,
1822
1880
  precision: field.kind === 'date' ? `${field.name}_precision` : undefined,
1881
+ period: field.kind === 'period'
1882
+ ? { start: `${field.name}_start`, end: `${field.name}_end` }
1883
+ : undefined,
1823
1884
  };
1824
1885
  }
1886
+ /** The value companions a field stores beside its own name: a `date`’s
1887
+ * precision, a `period`’s two bounds. */
1888
+ export function companionNames(field) {
1889
+ const { precision, period } = physicalFields(field);
1890
+ return [precision, period?.start, period?.end].filter((name) => name !== undefined);
1891
+ }
1825
1892
  /**
1826
1893
  * The {@link FacetKeys facet policies} a field inherits, keyed by the `name` of
1827
1894
  * the Root Type declaring each: the `facetKeys` of every type the field names
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lde/search",
3
- "version": "0.36.3",
3
+ "version": "0.37.0",
4
4
  "description": "Engine- and domain-agnostic core for RDF-backed search: a unified declarative field model (SearchField/SearchType/SearchSchema), a neutral query IR, the SearchEngine port with logical result types, and a streaming CONSTRUCT-to-document projection. Bakes in no engine, protocol, or domain.",
5
5
  "repository": {
6
6
  "url": "git+https://github.com/ldelements/lde.git",