edalcin/biodiversitydataskills

skos-xl

Helps users build, validate, convert, and explore controlled vocabularies using SKOS (Simple Knowledge Organization System) and SKOS-XL (the W3C extension for annotatable labels).

Ver código fuente
Documento original del Skill

Contenido del repositorio de origen con títulos, ejemplos, código, tablas, enlaces e imágenes preservados.

SKOS-XL Skill

Skill for building and working with SKOS (Simple Knowledge Organization System) and SKOS-XL vocabularies, with first-class support for Darwin Core integration following the TDWG TAG SKOS-XL patterns.


Setup

1. Install Python 3.9+

bash
python --version

2. Install dependencies

bash
cd /path/to/skos-xl
pip install -r requirements.txt

One dependency: `rdflib` — handles all RDF formats (Turtle, RDF/XML, JSON-LD, N-Triples) and the SKOS namespace natively.

3. (Optional) Sync W3C schema files

Downloads the official SKOS/SKOS-XL RDF/OWL schemas and TDWG TAG examples:

bash
python scripts/sync.py

Usage

1. Explain SKOS, SKOS-XL, and CTA properties

General SKOS overview:

bash
python scripts/explain.py

Explain a specific SKOS term:

bash
python scripts/explain.py --term broader
python scripts/explain.py --term prefLabel
python scripts/explain.py --term exactMatch

List all SKOS terms:

bash
python scripts/explain.py --list

SKOS-XL overview (when to use XL vs plain SKOS):

bash
python scripts/explain.py --xl

Explain a specific SKOS-XL term:

bash
python scripts/explain.py --xl --term Label
python scripts/explain.py --xl --term literalForm
python scripts/explain.py --xl --list

Traditional Knowledge (CTA) properties overview:

bash
python scripts/explain.py --cta
python scripts/explain.py --cta --list
python scripts/explain.py --cta --term accessLevel
python scripts/explain.py --cta --term sourcePeople
python scripts/explain.py --cta --term nagoyaStatus

2. Validate a SKOS vocabulary file

Validates Turtle, RDF/XML, JSON-LD, N-Triples, or N3 files.

Standard checks (always run):

  1. File parses as valid RDF
  2. Contains at least one skos:ConceptScheme
  3. All skos:Concept instances linked via skos:inScheme
  4. Each concept has skos:prefLabel (or skosxl:prefLabel)
  5. No duplicate prefLabel in the same language within a scheme (S14)
  6. No disjointness violations (Concept / ConceptScheme / Collection)
  7. skos:related not used between broader/narrower concepts (S27)
  8. SKOS-XL: each skosxl:Label has exactly one skosxl:literalForm

CTA checks (--cta flag, Traditional Knowledge / CARE / Nagoya):

  1. ConceptScheme has dct:rightsHolder (CARE Authority)
  2. ConceptScheme has dct:license (TK Label recommended)
  3. Each skosxl:Label has etno:accessLevel
  4. Labels in non-standard languages have prov:wasAttributedTo or etno:sourcePeople
  5. Labels with accessLevel = restricted/sacred have etno:validatedBy or prov:wasAttributedTo
bash
python scripts/validate.py vocab.ttl
python scripts/validate.py vocab.ttl --verbose
python scripts/validate.py vocab.ttl --cta
python scripts/validate.py vocab.ttl --cta --verbose
python scripts/validate.py vocab.rdf --format xml

Exit code 0 on success, 1 if errors are found (suitable for CI pipelines).


3. Generate a SKOS vocabulary template

Four templates are available:

TemplateUse case
basic (default)Generic concept hierarchy with optional SKOS-XL labels
dwc-vocabDarwin Core controlled vocabulary (basisOfRecord, occurrenceStatus, etc.)
dwc-namesTaxonomic name vocabulary using the TDWG TAG NameThing pattern (SKOS-XL)
etno-tkTraditional Knowledge vocabulary with CARE/PROV-O metadata (SKOS-XL)

Basic vocabulary (plain SKOS):

bash
python scripts/generate.py my_vocab

Basic vocabulary with SKOS-XL labels:

bash
python scripts/generate.py my_vocab --xl

Darwin Core controlled vocabulary (e.g. for basisOfRecord):

bash
python scripts/generate.py basisOfRecord --template dwc-vocab

Taxonomic name vocabulary (TDWG TAG NameThing pattern, SKOS-XL):

bash
python scripts/generate.py my_names --template dwc-names

Traditional Knowledge vocabulary (CTA / EtnoTermos pattern, CARE + Nagoya, SKOS-XL):

bash
python scripts/generate.py etnotermos --template etno-tk
python scripts/generate.py etnotermos --template etno-tk --lang pt --dir ./output

Change output format and language:

bash
python scripts/generate.py my_vocab --format jsonld --lang pt
python scripts/generate.py my_vocab --format rdfxml --dir ./output
python scripts/generate.py my_vocab --base http://vocab.example.org/myVocab

Supported formats: turtle (default), rdfxml, jsonld, nt, n3


4. Convert vocabulary format or label style

Convert RDF serialization format:

bash
python scripts/convert.py vocab.rdf --to-format turtle
python scripts/convert.py vocab.ttl --to-format jsonld --output vocab.jsonld

Upgrade plain SKOS labels to SKOS-XL (adds URI resources for each label):

bash
python scripts/convert.py vocab.ttl --to-xl

Downgrade SKOS-XL labels to plain SKOS (extracts literalForm literals back to skos:prefLabel):

bash
python scripts/convert.py vocab_xl.ttl --from-xl

Combine operations (upgrade labels + change format):

bash
python scripts/convert.py vocab.ttl --to-xl --to-format jsonld

5. Sync reference files

Downloads W3C SKOS/SKOS-XL schemas and TDWG TAG Turtle examples:

bash
python scripts/sync.py

Traditional Knowledge (CTA) Vocabularies

Overview

Traditional Knowledge Associated with Biodiversity (CTA — Conhecimento Tradicional Associado à Biodiversidade) requires a vocabulary architecture that is:

  • Polyglot — multiple indigenous languages, each with individual metadata
  • Governed — per-label access control (public / restricted / community-only / sacred)
  • Attributed — provenance traceable to the originating people (CARE principles)
  • Compliant — aligned with the Nagoya Protocol on Access and Benefit-Sharing

SKOS-XL is the correct choice because access restrictions live at the label level, not at the concept level. The scientific name of a plant may be public while the sacred ritual name is restricted — granularity impossible with skos:prefLabel literals.

CARE Principles

PrinciplePropertyDescription
Collectiveprov:wasAttributedTo, etno:sourcePeopleAttribute knowledge to originating people
Authoritydct:rightsHolder, etno:accessLevel, etno:validatedByCommunity controls its own data
Responsibilitydct:source, etno:nagoyaStatus, prov:hadPrimarySourceTraceable provenance
Ethicsetno:languageStatus, etno:consentType, dct:licenseDo no harm; respect restrictions

Access levels (etno:accessLevel)

ValueMeaning
publicAvailable to anyone
restrictedResearchers only, requires FPIC under Nagoya
community-onlyMembers of the originating community only
sacredSacred knowledge; never publish without explicit consent

Generate the template

bash
python scripts/generate.py etnotermos --template etno-tk --lang pt

This creates a Turtle file with:

  • skos:ConceptScheme with dct:rightsHolder and dct:license (TK Label)
  • Ethnotaxonomic top-level categories (not western-science categories)
  • Jatobá (Hymenaea courbaril) concept with labels in Portuguese, Guarani Mbya (@gnm), and Latin — each with full CARE metadata
  • Ayahuasca concept with a sacred label in Huni Kuĩ (@hux) alongside a public Spanish label — demonstrating per-label access control
  • prov:Agent resources for each indigenous people
  • Darwin Core dwc:vernacularName bridge on each Concept

Validate CTA compliance

bash
python scripts/validate.py etnotermos.ttl --cta --verbose

Explain CTA properties

bash
python scripts/explain.py --cta
python scripts/explain.py --cta --term accessLevel
python scripts/explain.py --cta --term sourcePeople
python scripts/explain.py --cta --term nagoyaStatus
python scripts/explain.py --cta --list

Key references


Darwin Core Integration

SKOS is the recommended representation for Darwin Core controlled vocabularies. Two patterns are supported by this skill:

Pattern 1 — Controlled vocabulary for DwC term values

Used for terms like basisOfRecord, occurrenceStatus, sex, lifeStage, establishmentMeans, degreeOfEstablishment, habitat:

bash
python scripts/generate.py basisOfRecord --template dwc-vocab

Each concept maps to the authoritative TDWG IRI via skos:exactMatch.

Pattern 2 — Taxonomic name vocabulary (TDWG TAG NameThing)

Reference: tdwg/tag/skos-xl

Used for scientific names. Labels become skosxl:Label resources carrying parsed nomenclatural components:

  • skosxl:literalForm — full name string (e.g. "Dicranum braunii Müll. Hal."@la)
  • tnc:canonicalName — genus + epithet without authorship
  • tnc:genus, tnc:specificEpithet, tnc:authorship
  • skosxl:labelRelation subproperties for basionyms and orthographic variants

This resolves the dwc: / dwciri: namespace split: SKOS-XL Labels provide a single IRI-addressable resource that bridges both.

bash
python scripts/generate.py bryophytes --template dwc-names

Key DwC Terms That Benefit from SKOS Vocabularies

DwC TermTemplateNotes
basisOfRecorddwc-vocab6 standard values
occurrenceStatusdwc-vocabpresent / absent
sexdwc-vocabMultilingual labels
lifeStagedwc-vocabHierarchical stages
establishmentMeansdwc-vocabIUCN pathway-aligned
degreeOfEstablishmentdwc-vocabOrdered progression
typeStatusdwc-vocabType specimen designations
habitatdwc-vocabEUNIS / IUCN hierarchy
scientificNamedwc-namesNameThing with parsed components
recordedBy / identifiedBydwc-namesPerson labels with provenance

References


Related Skills

[darwin-core](../darwin-core/) — Use alongside this skill to package and validate occurrence data. Darwin Core defines the fields; SKOS defines the controlled vocabularies for the values. The dwc-vocab template generates SKOS representations of any Darwin Core controlled term.

[DataProvenance](../DataProvenance/) — Normative reference for the prov: terms (prov:wasAttributedTo, prov:Agent, qualification, prov:hadPrimarySource) already used by this skill's Traditional Knowledge (CTA) template, for provenance trails deeper than the template covers.

del mismo repositorio

Más Skills

Todos los Skills
edalcin
Comunidad

biohousekeeper

Analyzes biodiversity spreadsheets (CSV/XLSX) and proposes a restructured column layout aligned with Darwin Core (DwC), asking the user clarifying questions about anything ambiguous before finalizing the report. Detects columns that should be renamed to DwC terms, composite columns that should be split (e.g. packed "lat,long" pairs, "Genus species" binomials, delimited locality hierarchies), redundant duplicate columns, and missing recommended fields (occurrenceID, basisOfRecord, eventDate, coordinates). Use when the user mentions "biohousekeeper", "clean up my spreadsheet", "restructure my biodiversity data", "map my spreadsheet to Darwin Core", or asks to analyze/tidy/fix columns in an occurrence/species/collection spreadsheet.

instalaciones
1
GitHub Stars
4
Actualizado
26 ago
edalcin
Comunidad

darwin-core

Helps users work with Darwin Core (DwC), Darwin Core Archive (DwC-A), Darwin Core Conceptual Model (DwC-CM), and Darwin Core Data Package (DwC-DP), the biodiversity data standards maintained by TDWG. Validates DwC-A files, generates templates, maps CSV columns to DwC terms, explains the standard, explains class relationships via DwC-CM, and helps create DwC-DP packages. Use when the user mentions "Darwin Core", "DwC", "DwC-A", "DwC-DP", "DwC-CM", "GBIF", "biodiversity data", "occurrence", "taxon", "biodiversity", "conceptual model", "data package", "frictionless data", or "datapackage.json".

instalaciones
1
GitHub Stars
4
Actualizado
26 ago
edalcin
Comunidad

grist-master

Provides comprehensive technical knowledge about Grist (getgrist.com), the spreadsheet-database hybrid tool: REST API, SQL endpoint, MCP server, OAuth apps, webhooks, Python formulas and the full Excel-like function reference, column types, references/lookups, summary tables, access rules, self-hosted (Docker) installation and administration, and integrations (Zapier, n8n, Make, embedding, custom widgets). Use when the user mentions "Grist", "getgrist.com", "grist-core", "grist-widget", building or debugging Grist formulas, querying the Grist REST/SQL API, connecting an MCP client to Grist, self-hosting Grist with Docker, writing Grist access rules, or building a Grist custom widget or integration.

instalaciones
1
GitHub Stars
4
Actualizado
26 ago
edalcin
Comunidad

iczn

Expert knowledge of the International Code of Zoological Nomenclature (ICZN, 4th edition 1999, with Declarations 44-47 and the 2012 electronic-publication amendment) for zoological taxonomists and for anyone structuring taxonomic data. Decides whether a name is available, which of two competing names is valid, whether a type designation is effective, how authorship and parentheses are cited, and how to model names, taxa and nomenclatural acts in a database. Use this skill whenever the user mentions "ICZN", "zoological nomenclature", "Code of Zoological Nomenclature", an Article number of the Code, "available name", "valid name", "senior/junior synonym", "homonym", "nomen nudum", "nomen oblitum", "nomen protectum", "nomen novum", "holotype", "syntype", "lectotype", "neotype", "paratype", "type species", "type genus", "type locality", "priority", "typification", "emendation", "new combination", "ZooBank", "LSID", "Bulletin of Zoological Nomenclature", or the ICZN Commission -- and also whenever they are describing a new animal species, reviewing a taxonomic manuscript, cleaning or validating animal name strings, resolving a synonymy or a spelling variant, deciding what belongs in scientificName / scientificNameAuthorship / nomenclaturalStatus / taxonomicStatus / typeStatus, or designing a database or checklist that holds animal names, even if they never say "ICZN".

instalaciones
1
GitHub Stars
4
Actualizado
26 ago