Skip to content

Commit

Permalink
merge dev (#52)
Browse files Browse the repository at this point in the history
* feat: add baseUri default options (#49)

* feat: add baseUri from plugin options

- when absent, baseUri falls back to the last updated baseUri
or blank if none.

* chore: update README with baseUri default behavior details

* Dev (#50)

* 19 add popover to taxonomy term list views (#44)

Add information dialogues to taxonomy terms
in Tree View, when definition, example, or scope note information
is available.

* Update CHANGELOG

* Update CHANGELOG

* 43 add base uri default option (#51)

* feat: add baseUri from plugin options

- when absent, baseUri falls back to the last updated baseUri
or blank if none.

* chore: update README with baseUri default behavior details
  • Loading branch information
andybywire committed Jun 5, 2023
1 parent a617417 commit a821ab6
Show file tree
Hide file tree
Showing 4 changed files with 425 additions and 397 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,23 @@ export default defineConfig({
structure,
}),
// Include the taxonomy manager plugin
taxonomyManager(),
taxonomyManager({
// Optional: Set a Base URI to use when
// creating new concepts & schemes
baseUri: 'https://example.com/'
}),
],
schema: {
types: schemaTypes,
},
})
```
The `baseURI` option allows you to set a default URI (Uniform Resource Identifier) for new concepts and concept schemes. 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`. The base URI of these concepts is `https://shipparts.com/` and `https://wrappingsupplies.com/`, respectively.

- In most cases, it makes sense for your base URI to be the root or a subdirectory of your website.
- In all cases, the URI you choose should be in a domain that you control.
- The `baseUri` default is optional. If you omit it, the Base URI for new concepts and concept schemes is pre-populated based on the most recently used Base URI value.


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.

Expand Down Expand Up @@ -99,7 +109,7 @@ export const structure = (S) =>
1. Create and describe Concepts.
- 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.
- 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).
- 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/).
- 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`. The base URI of these concepts is `https://shipparts.com/` and `https://wrappingsupplies.com/`, respectively. For a wider introduction to concept identifiers, see [Cool URIs for the Semantic Web](https://www.w3.org/TR/cooluris/).
- 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
- 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/).
1. Tag resources with concepts and then integrate into search indexing, filtering, navigation, and semantic web services.
Expand Down
15 changes: 10 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ import skosConceptScheme from './skosConceptScheme'
import baseIri from './objects/baseIri'
import TreeView from './components/TreeView'

const taxonomyManager = definePlugin({
name: 'taxonomyManager',
schema: {
types: [skosConcept, skosConceptScheme, baseIri],
},
const taxonomyManager = definePlugin((options: any) => {
const {baseUri} = options || {}

return {
name: 'taxonomyManager',
options,
schema: {
types: [skosConcept(baseUri), skosConceptScheme(baseUri), baseIri],
},
}
})

export {taxonomyManager, TreeView}
Loading

0 comments on commit a821ab6

Please sign in to comment.