sanity-plugin-taxonomy-manager 2.2.2 → 2.3.1

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/README.md CHANGED
@@ -8,6 +8,20 @@
8
8
  > This is a **Sanity Studio v3** plugin.
9
9
  > For the v2 version, please refer to the [v2-branch](https://github.com/andybywire/sanity-plugin-taxonomy-manager/tree/studio-v2).
10
10
 
11
+ > 🚨 **Breaking Changes for Concept Fields**
12
+ >
13
+ > Version 2.3.1 of Sanity Taxonomy Manager is the last version to support the `baseUri` and `skosConceptScheme` fields that were part of version 1 and early (patch) versions of v2.
14
+ >
15
+ > If you are upgrading to Taxonomy Manager version 3 with concepts created in one of these early versions, install this version first. v2.3.1 includes field utilities to help you:
16
+ >
17
+ > - convert `baseUri` to the new schema
18
+ > - generate unique `concept` and `conceptScheme` identifiers
19
+ > - remove deprecated `skosConceptScheme` references in Concepts
20
+ >
21
+ > In Sanity Taxonomy Manager 3.0, both these utilities and the fields that support the deprecated schemes will be removed. Concept tags and queries will still work, but may lead to warnings in the Studio about scheme/data mismatches.
22
+ >
23
+ > Please feel free to reach out on [GitHub Discussions](https://github.com/andybywire/sanity-plugin-taxonomy-manager/discussions) with any questions.
24
+
11
25
  Taxonomies are crucial tools for organization and interoperability between and across data sets. Taxonomy Manager provides a way for content authors to create, use, and maintain standards compliant taxonomies in Sanity Studio.
12
26
 
13
27
  The Taxonomy Manager document schema is based on the [World Wide Web Consortium](https://www.w3.org/) (W3C) [Simple Knowledge Organization Scheme](https://www.w3.org/TR/skos-reference/) (SKOS) recommendation. Concept and concept scheme editor tools include standard SKOS properties, hints for creating consistent concepts and vocabularies, and validation functions for preventing consistency errors.
@@ -23,10 +37,16 @@ The Taxonomy Manager document schema is based on the [World Wide Web Consortium]
23
37
 
24
38
  ## Installation
25
39
 
26
- Install using the [Sanity CLI](https://www.sanity.io/docs/cli).
40
+ In your Sanity project folder, run
27
41
 
28
42
  ```bash
29
- $ npm i sanity-plugin-taxonomy-manager
43
+ npm i sanity-plugin-taxonomy-manager
44
+ ```
45
+
46
+ or
47
+
48
+ ```bash
49
+ yarn add sanity-plugin-taxonomy-manager
30
50
  ```
31
51
 
32
52
  ## Configuration
@@ -152,32 +172,6 @@ export const structure = (S) =>
152
172
  ```
153
173
  1. Tag resources with concepts and then integrate into search indexing, filtering, navigation, and semantic web services.
154
174
 
155
- ### Semantic Relationships
156
-
157
- The concept editor includes filtering and validation to help you create consistent SKOS vocabularies:
158
-
159
- **SKOS Broader and Related Concepts**
160
- Adding the same concept to Broader and Related fields is not allowed, and the editor validates disjunction of Related concepts with Broader Transitive up to five hierarchical levels in either direction.
161
-
162
- **Preferred, Alternative, and Hidden Labels**
163
- Preferred Labels are validated for uniqueness across concepts, and Preferred, Alternative, and Hidden are validated to prevent duplicates and overlap.
164
-
165
- **Scope Notes, Definition, and Examples**
166
- Standard optional SKOS documentation fields are included by default.
167
-
168
- **Support for Single or Multiple Taxonomy Schemes (or none)**
169
- For cases where more than one taxonomy is needed, multiple [SKOS Concept Schemes](https://www.w3.org/TR/skos-reference/#schemes) are supported. Schemes can be used to configure filtered views of concepts in Sanity Structure Builder and can be used to scope values for reference arrays.
170
-
171
- <!-- Concept Scheme views show a hierarchical list (Tree View) of the concepts included in a given scheme. This list allows for easy visualization of Top Concepts, polyhierarchy (concepts that appear in more than one place in the hierarchy), and "Orphan" terms (top level concepts not denoted as a "Top Concept"). -->
172
-
173
- ## SKOS Overview
174
-
175
- > The [Simple Knowledge Organization System (SKOS)](https://www.w3.org/TR/skos-reference/) is a common data model for sharing and linking knowledge organization systems via the Web.
176
- >
177
- > Many knowledge organization systems, such as thesauri, taxonomies, classification schemes and subject heading systems, share a similar structure, and are used in similar applications. SKOS captures much of this similarity and makes it explicit, to enable data and technology sharing across diverse applications.
178
- >
179
- > The SKOS data model provides a standard, low-cost migration path for porting existing knowledge organization systems to the Semantic Web. SKOS also provides a lightweight, intuitive language for developing and sharing new knowledge organization systems. It may be used on its own, or in combination with formal knowledge representation languages such as the Web Ontology language (OWL).
180
-
181
175
  ## License
182
176
 
183
177
  MIT © Andy Fitzgerald
package/lib/index.d.ts CHANGED
@@ -2,41 +2,47 @@
2
2
 
3
3
  import {Plugin as Plugin_2} from 'sanity'
4
4
 
5
- export declare function branchFilter(options: Options_2): branchFilterResult
5
+ export declare function branchFilter(options: BranchOptions): BranchFilterResult
6
6
 
7
- /**
8
- * Pluggable Function for Filtering to a Top Concept Branch within a SKOS Concept Scheme
9
- */
10
- declare type branchFilterResult = {
7
+ declare type BranchFilterResult = {
11
8
  filter: string
12
- params: {
13
- schemeId: string
14
- branchId: string
15
- }
9
+ params: BranchOptions
16
10
  }
17
11
 
18
- declare type Options = {
12
+ /**
13
+ * Pluggable Function for Filtering to a Top Concept Branch within a SKOS Concept Scheme
14
+ */
15
+ declare type BranchOptions = {
19
16
  schemeId: string
17
+ branchId: string
20
18
  }
21
19
 
22
- declare type Options_2 = {
23
- schemeId: string
24
- branchId: string
20
+ declare interface Options {
21
+ baseUri?: string
25
22
  }
26
23
 
27
- export declare function schemeFilter(options: Options): SchemeFilterResult
24
+ export declare function schemeFilter(options: SchemeOptions): SchemeFilterResult
25
+
26
+ declare type SchemeFilterResult = {
27
+ filter: string
28
+ params: SchemeOptions
29
+ }
28
30
 
29
31
  /**
30
32
  * Pluggable Function for Filtering to a Single SKOS Concept Scheme
31
33
  */
32
- declare type SchemeFilterResult = {
33
- filter: string
34
- params: {
35
- schemeId: string
36
- }
34
+ declare type SchemeOptions = {
35
+ schemeId: string
37
36
  }
38
37
 
39
- export declare const taxonomyManager: Plugin_2<any>
38
+ /**
39
+ * Defines a Sanity plugin for managing taxonomies.
40
+ * @param options - Optional configuration options for the plugin.
41
+ * @param options.baseUri - The base URI to use for SKOS concepts and concept schemes.
42
+ * baseURI should follow an IANA http/s scheme and should terminate with either a / or #.
43
+ * @returns A Sanity plugin object.
44
+ */
45
+ export declare const taxonomyManager: Plugin_2<Options | undefined>
40
46
 
41
47
  export declare const TreeView: ({document}: {document: any}) => JSX.Element
42
48