sanity-plugin-taxonomy-manager 2.0.3 → 2.0.4
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 +25 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# Sanity Taxonomy Manager Plugin
|
|
2
|
+
|
|
2
3
|

|
|
3
4
|

|
|
4
5
|
|
|
@@ -7,9 +8,9 @@
|
|
|
7
8
|
> This is a **Sanity Studio v3** plugin.
|
|
8
9
|
> For the v2 version, please refer to the [v2-branch](https://github.com/andybywire/sanity-plugin-taxonomy-manager/tree/studio-v2).
|
|
9
10
|
|
|
10
|
-
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.
|
|
11
|
+
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.
|
|
11
12
|
|
|
12
|
-
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.
|
|
13
|
+
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.
|
|
13
14
|
|
|
14
15
|
<img src="https://user-images.githubusercontent.com/3710835/212743871-14760a60-0689-4cc3-a13e-55dd7a4ef19a.png" width="700">
|
|
15
16
|
|
|
@@ -27,16 +28,17 @@ Install using the [Sanity CLI](https://www.sanity.io/docs/cli).
|
|
|
27
28
|
```bash
|
|
28
29
|
$ npm i sanity-plugin-taxonomy-manager
|
|
29
30
|
```
|
|
31
|
+
|
|
30
32
|
## Configuration
|
|
31
33
|
|
|
32
|
-
Add the plugin to your project configuration to make the skosConcept and skosConceptScheme document types available in your studio.
|
|
34
|
+
Add the plugin to your project configuration to make the skosConcept and skosConceptScheme document types available in your studio.
|
|
33
35
|
|
|
34
36
|
```js
|
|
35
37
|
// sanity.config.js
|
|
36
38
|
|
|
37
39
|
import {defineConfig} from 'sanity'
|
|
38
40
|
import {deskTool} from 'sanity/desk'
|
|
39
|
-
import {structure} from
|
|
41
|
+
import {structure} from './deskStructure'
|
|
40
42
|
import {taxonomyManager} from 'sanity-plugin-taxonomy-manager'
|
|
41
43
|
import {schemaTypes} from './schemas'
|
|
42
44
|
|
|
@@ -47,22 +49,22 @@ export default defineConfig({
|
|
|
47
49
|
dataset: 'production',
|
|
48
50
|
plugins: [
|
|
49
51
|
deskTool({
|
|
50
|
-
structure
|
|
51
|
-
}),
|
|
52
|
+
structure,
|
|
53
|
+
}),
|
|
52
54
|
// Include the taxonomy manager plugin
|
|
53
|
-
taxonomyManager()
|
|
55
|
+
taxonomyManager(),
|
|
54
56
|
],
|
|
55
57
|
schema: {
|
|
56
58
|
types: schemaTypes,
|
|
57
59
|
},
|
|
58
|
-
})
|
|
60
|
+
})
|
|
59
61
|
```
|
|
60
62
|
|
|
61
63
|
Use [Structure Builder](https://www.sanity.io/docs/structure-builder-reference) to create a separate area for your taxonomy tools and add the provided Concept Scheme Tree View component.
|
|
62
64
|
|
|
63
65
|
```js
|
|
64
66
|
// ./deskStructure.js
|
|
65
|
-
import {TreeView} from 'sanity-plugin-taxonomy-manager'
|
|
67
|
+
import {TreeView} from 'sanity-plugin-taxonomy-manager'
|
|
66
68
|
|
|
67
69
|
export const structure = (S) =>
|
|
68
70
|
S.list()
|
|
@@ -74,17 +76,14 @@ export const structure = (S) =>
|
|
|
74
76
|
.child(
|
|
75
77
|
S.documentTypeList('skosConceptScheme')
|
|
76
78
|
.title('Concept Schemes')
|
|
77
|
-
.child(id =>
|
|
79
|
+
.child((id) =>
|
|
78
80
|
S.document()
|
|
79
81
|
.schemaType('skosConceptScheme')
|
|
80
82
|
.documentId(id)
|
|
81
|
-
.views([
|
|
82
|
-
S.view.component(TreeView).title('Tree View'),
|
|
83
|
-
S.view.form()
|
|
84
|
-
])
|
|
83
|
+
.views([S.view.component(TreeView).title('Tree View'), S.view.form()])
|
|
85
84
|
)
|
|
86
|
-
|
|
87
|
-
S.documentTypeListItem(
|
|
85
|
+
),
|
|
86
|
+
S.documentTypeListItem('skosConcept').title('Concepts'),
|
|
88
87
|
S.divider(),
|
|
89
88
|
|
|
90
89
|
// Remove Taxonomy Manager types from the default document type list
|
|
@@ -92,33 +91,35 @@ export const structure = (S) =>
|
|
|
92
91
|
(listItem) => !['skosConcept', 'skosConceptScheme'].includes(listItem.getId())
|
|
93
92
|
),
|
|
94
93
|
])
|
|
95
|
-
```
|
|
94
|
+
```
|
|
96
95
|
|
|
97
96
|
## Usage
|
|
98
97
|
|
|
99
98
|
1. Create a [Concept Scheme](https://www.w3.org/TR/skos-reference/#schemes) to group related concepts
|
|
100
|
-
1. Create and describe Top Concepts. Top concepts represent the broadest concepts of a particular hierarchy and provide efficient access points to broader/narrower concept hierarchies
|
|
101
99
|
1. Create and describe Concepts.
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
- All fields _except_ Preferred Label and Base IRI are optional, and are to be used as best fits the needs of your information modeling task.
|
|
101
|
+
- Preferred Label is the preferred lexical label for a resource in a given language. In the current version of Taxonomy Manager, the Preferred Label is automatically used as the final segment for a concept's unique identifier (its URI).
|
|
102
|
+
- Base IRI is the root IRI (Internationalized Resource Identifier) used to create unique concept identifiers. Unique identifiers allow for the clear an unambiguous identification of concepts across namespaces, for example between https://shipparts.com/vocab#Bow and https://wrappingsupplies.com/vocab#Bow. In the plugin, previously used Base IRI values are pre-populated for new concepts. For a wider introduction to concept identifiers, see [Cool URIs for the Semantic Web](https://www.w3.org/TR/cooluris/).
|
|
103
|
+
- Concepts may optionally be added to a Concept Scheme as Top Concepts, to represent the broadest concepts of a particular hierarchy and provide efficient access points to broader/narrower concept hierarchies
|
|
104
|
+
- All Concept fields map to elements of the machine readable data model described in the [W3C SKOS Recommendation](https://www.w3.org/TR/skos-reference/).
|
|
104
105
|
1. Tag resources with concepts and then integrate into search indexing, filtering, navigation, and semantic web services.
|
|
105
106
|
|
|
106
107
|
### Semantic Relationships
|
|
107
108
|
|
|
108
|
-
The concept editor includes filtering and validation to help you create consistent SKOS vocabularies:
|
|
109
|
+
The concept editor includes filtering and validation to help you create consistent SKOS vocabularies:
|
|
109
110
|
|
|
110
111
|
**SKOS Broader and Related Concepts**
|
|
111
|
-
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.
|
|
112
|
+
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.
|
|
112
113
|
|
|
113
114
|
**Preferred, Alternative, and Hidden Labels**
|
|
114
|
-
Preferred Labels are validated for uniqueness across concepts, and Preferred, Alternative, and Hidden are validated to prevent duplicates and overlap.
|
|
115
|
+
Preferred Labels are validated for uniqueness across concepts, and Preferred, Alternative, and Hidden are validated to prevent duplicates and overlap.
|
|
115
116
|
|
|
116
117
|
**Scope Notes, Definition, and Examples**
|
|
117
118
|
Standard optional SKOS documentation fields are included by default.
|
|
118
119
|
|
|
119
120
|
**Support for Single or Multiple Taxonomy Schemes (or none)**
|
|
120
121
|
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.
|
|
121
|
-
|
|
122
|
+
|
|
122
123
|
<!-- 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"). -->
|
|
123
124
|
|
|
124
125
|
## SKOS Overview
|