@singi-labs/sifa-sdk 0.12.69 → 0.12.71

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.
@@ -1,13 +1,29 @@
1
1
  import { L as LocationValue } from '../index-a3xqWsNm.js';
2
2
 
3
+ var vocabularies = {
4
+ schema: "https://schema.org/",
5
+ bibo: "http://purl.org/ontology/bibo/",
6
+ dcterms: "http://purl.org/dc/terms/",
7
+ foaf: "http://xmlns.com/foaf/0.1/",
8
+ org: "http://www.w3.org/ns/org#",
9
+ prism: "http://prismstandard.org/namespaces/basic/2.1/",
10
+ event: "http://purl.org/NET/c4dm/event.owl#",
11
+ skos: "http://www.w3.org/2004/02/skos/core#"
12
+ };
13
+ var document = {
14
+ vocabularies: vocabularies};
15
+
3
16
  /**
4
17
  * Reconciliation between `id.sifa.*` lexicon terms and existing RDF
5
18
  * vocabularies.
6
19
  *
7
- * This table is the single source of truth for "what does this lexicon field
8
- * mean in somebody else's vocabulary". It drives the JSON-LD emitters in this
9
- * module and is intended to also back a published machine-readable mapping
10
- * document, so the two cannot drift.
20
+ * The facts live in sifa-lexicons, as `x-skos:*` annotations on the lexicon
21
+ * defs and properties. Those annotations are published to the authority PDS,
22
+ * so a third party resolving `id.sifa.*` already reads them; that makes the
23
+ * lexicons the source of truth and `./term-mappings.json` a derived copy,
24
+ * refreshed by `scripts/sync-term-mappings.mjs` and drift-checked in CI.
25
+ *
26
+ * To change a mapping, change the lexicon, not this file.
11
27
  *
12
28
  * Scope note: RDF is adopted here as *vocabulary only*. Sifa records are
13
29
  * Lexicon JSON on the AT Protocol; nothing in this module changes how records
@@ -16,18 +32,10 @@ import { L as LocationValue } from '../index-a3xqWsNm.js';
16
32
  * When a term does not fit, the correct answer is `noMatch`, not a different
17
33
  * lexicon.
18
34
  */
35
+
19
36
  /** Vocabulary prefix -> namespace IRI. */
20
- declare const VOCABULARIES: {
21
- readonly schema: "https://schema.org/";
22
- readonly bibo: "http://purl.org/ontology/bibo/";
23
- readonly dcterms: "http://purl.org/dc/terms/";
24
- readonly foaf: "http://xmlns.com/foaf/0.1/";
25
- readonly org: "http://www.w3.org/ns/org#";
26
- readonly prism: "http://prismstandard.org/namespaces/basic/2.1/";
27
- readonly event: "http://purl.org/NET/c4dm/event.owl#";
28
- readonly skos: "http://www.w3.org/2004/02/skos/core#";
29
- };
30
- type VocabularyPrefix = keyof typeof VOCABULARIES;
37
+ declare const VOCABULARIES: Readonly<Record<string, string>>;
38
+ type VocabularyPrefix = keyof typeof document.vocabularies;
31
39
  /**
32
40
  * Strength of a mapping, using SKOS mapping relations so the table is itself
33
41
  * expressible as RDF.
@@ -47,10 +55,16 @@ interface TermMapping {
47
55
  /** CURIEs, e.g. `dcterms:title`. Empty when `match` is `noMatch`. */
48
56
  readonly terms: readonly string[];
49
57
  readonly match: MatchStrength;
50
- /** Required when `match` is `noMatch`: why no term is appropriate. */
58
+ /** Rationale. Always present when `match` is `noMatch`. */
51
59
  readonly note?: string;
52
60
  }
53
- /** Every reconciliation Sifa asserts, including the deliberate non-mappings. */
61
+ /**
62
+ * Every reconciliation Sifa asserts, including the deliberate non-mappings.
63
+ *
64
+ * The published document splits these into `mappings` and `unmapped`, which
65
+ * reads better over the wire. Callers here want one list, so they are
66
+ * flattened back together.
67
+ */
54
68
  declare const TERM_MAPPINGS: readonly TermMapping[];
55
69
  /**
56
70
  * Expand a CURIE (`dcterms:title`) to a full IRI. Returns null for an unknown